File tree Expand file tree Collapse file tree 4 files changed +20
-8
lines changed
src/test/java/org/utplsql/api Expand file tree Collapse file tree 4 files changed +20
-8
lines changed Original file line number Diff line number Diff line change 5353 <version >${junit.jupiter.version} </version >
5454 <scope >test</scope >
5555 </dependency >
56+ <dependency >
57+ <groupId >org.hamcrest</groupId >
58+ <artifactId >hamcrest</artifactId >
59+ <version >2.1</version >
60+ <scope >test</scope >
61+ </dependency >
5662
5763 <dependency >
5864 <groupId >ch.qos.logback</groupId >
Original file line number Diff line number Diff line change 22
33import org .junit .jupiter .api .Test ;
44
5- import static org .junit .jupiter .api .Assertions .assertTrue ;
5+ import static org .hamcrest .MatcherAssert .assertThat ;
6+ import static org .hamcrest .Matchers .startsWith ;
67
78class JavaApiVersionTest {
89
910 @ Test
1011 void getJavaApiVersion () {
11- assertTrue (JavaApiVersionInfo .getVersion (). startsWith ("3.1" ));
12+ assertThat (JavaApiVersionInfo .getVersion (), startsWith ("3.1" ));
1213 }
1314}
Original file line number Diff line number Diff line change 1717import java .util .List ;
1818import java .util .concurrent .*;
1919
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 ;
2125
2226/**
2327 * Integration-test for OutputBuffers
@@ -104,7 +108,7 @@ void fetchAllLines() throws SQLException {
104108
105109 List <String > outputLines = reporter .getOutputBuffer ().fetchAll (getConnection ());
106110
107- assertTrue (outputLines . size () > 0 );
111+ assertThat (outputLines , not ( emptyIterable ()) );
108112 }
109113
110114 @ Test
@@ -118,7 +122,7 @@ void getOutputFromSonarReporter() throws SQLException {
118122
119123 List <String > outputLines = reporter .getOutputBuffer ().fetchAll (getConnection ());
120124
121- assertTrue (outputLines . size () > 0 );
125+ assertThat (outputLines , not ( emptyIterable ()) );
122126 }
123127
124128 @ Test
Original file line number Diff line number Diff line change 11package org .utplsql .api ;
22
3+ import org .hamcrest .Matchers ;
34import org .junit .jupiter .api .Test ;
45import org .utplsql .api .compatibility .CompatibilityProxy ;
56import org .utplsql .api .reporter .CoreReporters ;
910
1011import java .sql .SQLException ;
1112
12- import static org .junit . jupiter . api . Assertions . assertTrue ;
13+ import static org .hamcrest . MatcherAssert . assertThat ;
1314
1415class ReporterFactoryIT extends AbstractDatabaseTest {
1516
@@ -20,7 +21,7 @@ void createDefaultReporterFactoryMethod() throws SQLException {
2021
2122 ReporterFactory reporterFactory = ReporterFactory .createDefault (proxy );
2223
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 ) );
2526 }
2627}
You can’t perform that action at this time.
0 commit comments