1010import java .sql .Array ;
1111import java .sql .CallableStatement ;
1212import java .sql .SQLException ;
13- import java .util .List ;
14- import java .util .concurrent .Callable ;
1513
1614import static org .hamcrest .CoreMatchers .containsString ;
1715import static org .hamcrest .MatcherAssert .assertThat ;
@@ -22,8 +20,7 @@ public class DynamicTestRunnerStatementTest {
2220 @ Test
2321 void explore () throws SQLException {
2422 // Expectation objects
25- Object [] expectedSourceFileMapping = new Object []{new FileMapping ("source" , "owner" , "source" , "PACKAGE" )};
26- Object [] expectedTestFileMapping = new Object []{new FileMapping ("test" , "owner" , "test" , "PACKAGE" )};
23+ Object [] expectedFileMapping = new Object []{new FileMapping ("someFile" , "owner" , "object" , "PACKAGE" )};
2724
2825 // Mock some internals. This is not pretty, but a first step
2926 OracleConnection oracleConnection = mock (OracleConnection .class );
@@ -42,7 +39,7 @@ void explore() throws SQLException {
4239 when (fileMapperStatement .getArray (1 ))
4340 .thenReturn (fileMapperArray );
4441 when (fileMapperArray .getArray ())
45- .thenReturn (expectedSourceFileMapping );
42+ .thenReturn (expectedFileMapping );
4643
4744 // Act
4845 TestRunnerOptions options = TestRunnerStatementProviderIT .getCompletelyFilledOptions ();
@@ -85,7 +82,10 @@ void explore() throws SQLException {
8582
8683 assertThat (testRunnerStatement .getSql (), containsString ("a_source_file_mappings => ?" ));
8784 verify (callableStatement ).setArray (5 , null );
88- verify (oracleConnection ).createOracleArray (CustomTypes .UT_FILE_MAPPINGS , expectedSourceFileMapping );
85+
86+ assertThat (testRunnerStatement .getSql (), containsString ("a_test_file_mappings => ?" ));
87+ verify (callableStatement ).setArray (6 , null );
88+ verify (oracleConnection , times (2 )).createOracleArray (CustomTypes .UT_FILE_MAPPINGS , expectedFileMapping );
8989
9090
9191 }
0 commit comments