File tree 4 files changed +20
-8
lines changed
src/test/java/org/utplsql/api
4 files changed +20
-8
lines changed Original file line number Diff line number Diff line change 53
53
<version >${junit.jupiter.version} </version >
54
54
<scope >test</scope >
55
55
</dependency >
56
+ <dependency >
57
+ <groupId >org.hamcrest</groupId >
58
+ <artifactId >hamcrest</artifactId >
59
+ <version >2.1</version >
60
+ <scope >test</scope >
61
+ </dependency >
56
62
57
63
<dependency >
58
64
<groupId >ch.qos.logback</groupId >
Original file line number Diff line number Diff line change 2
2
3
3
import org .junit .jupiter .api .Test ;
4
4
5
- import static org .junit .jupiter .api .Assertions .assertTrue ;
5
+ import static org .hamcrest .MatcherAssert .assertThat ;
6
+ import static org .hamcrest .Matchers .startsWith ;
6
7
7
8
class JavaApiVersionTest {
8
9
9
10
@ Test
10
11
void getJavaApiVersion () {
11
- assertTrue (JavaApiVersionInfo .getVersion (). startsWith ("3.1" ));
12
+ assertThat (JavaApiVersionInfo .getVersion (), startsWith ("3.1" ));
12
13
}
13
14
}
Original file line number Diff line number Diff line change 17
17
import java .util .List ;
18
18
import java .util .concurrent .*;
19
19
20
- import static org .junit .jupiter .api .Assertions .*;
20
+ import static org .hamcrest .MatcherAssert .assertThat ;
21
+ import static org .hamcrest .Matchers .emptyIterable ;
22
+ import static org .hamcrest .Matchers .not ;
23
+ import static org .junit .jupiter .api .Assertions .assertEquals ;
24
+ import static org .junit .jupiter .api .Assertions .fail ;
21
25
22
26
/**
23
27
* Integration-test for OutputBuffers
@@ -104,7 +108,7 @@ void fetchAllLines() throws SQLException {
104
108
105
109
List <String > outputLines = reporter .getOutputBuffer ().fetchAll (getConnection ());
106
110
107
- assertTrue (outputLines . size () > 0 );
111
+ assertThat (outputLines , not ( emptyIterable ()) );
108
112
}
109
113
110
114
@ Test
@@ -118,7 +122,7 @@ void getOutputFromSonarReporter() throws SQLException {
118
122
119
123
List <String > outputLines = reporter .getOutputBuffer ().fetchAll (getConnection ());
120
124
121
- assertTrue (outputLines . size () > 0 );
125
+ assertThat (outputLines , not ( emptyIterable ()) );
122
126
}
123
127
124
128
@ Test
Original file line number Diff line number Diff line change 1
1
package org .utplsql .api ;
2
2
3
+ import org .hamcrest .Matchers ;
3
4
import org .junit .jupiter .api .Test ;
4
5
import org .utplsql .api .compatibility .CompatibilityProxy ;
5
6
import org .utplsql .api .reporter .CoreReporters ;
9
10
10
11
import java .sql .SQLException ;
11
12
12
- import static org .junit . jupiter . api . Assertions . assertTrue ;
13
+ import static org .hamcrest . MatcherAssert . assertThat ;
13
14
14
15
class ReporterFactoryIT extends AbstractDatabaseTest {
15
16
@@ -20,7 +21,7 @@ void createDefaultReporterFactoryMethod() throws SQLException {
20
21
21
22
ReporterFactory reporterFactory = ReporterFactory .createDefault (proxy );
22
23
23
- assertTrue ( reporterFactory .createReporter (CoreReporters .UT_DOCUMENTATION_REPORTER .name ()) instanceof DocumentationReporter );
24
- assertTrue ( reporterFactory .createReporter (CoreReporters .UT_COVERAGE_HTML_REPORTER .name ()) instanceof CoverageHTMLReporter );
24
+ assertThat ( reporterFactory .createReporter (CoreReporters .UT_DOCUMENTATION_REPORTER .name ()), Matchers . isA ( DocumentationReporter . class ) );
25
+ assertThat ( reporterFactory .createReporter (CoreReporters .UT_COVERAGE_HTML_REPORTER .name ()), Matchers . isA ( CoverageHTMLReporter . class ) );
25
26
}
26
27
}
You can’t perform that action at this time.
0 commit comments