10
10
import java .sql .Array ;
11
11
import java .sql .CallableStatement ;
12
12
import java .sql .SQLException ;
13
- import java .util .List ;
14
- import java .util .concurrent .Callable ;
15
13
16
14
import static org .hamcrest .CoreMatchers .containsString ;
17
15
import static org .hamcrest .MatcherAssert .assertThat ;
@@ -22,8 +20,7 @@ public class DynamicTestRunnerStatementTest {
22
20
@ Test
23
21
void explore () throws SQLException {
24
22
// 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" )};
27
24
28
25
// Mock some internals. This is not pretty, but a first step
29
26
OracleConnection oracleConnection = mock (OracleConnection .class );
@@ -42,7 +39,7 @@ void explore() throws SQLException {
42
39
when (fileMapperStatement .getArray (1 ))
43
40
.thenReturn (fileMapperArray );
44
41
when (fileMapperArray .getArray ())
45
- .thenReturn (expectedSourceFileMapping );
42
+ .thenReturn (expectedFileMapping );
46
43
47
44
// Act
48
45
TestRunnerOptions options = TestRunnerStatementProviderIT .getCompletelyFilledOptions ();
@@ -85,7 +82,10 @@ void explore() throws SQLException {
85
82
86
83
assertThat (testRunnerStatement .getSql (), containsString ("a_source_file_mappings => ?" ));
87
84
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 );
89
89
90
90
91
91
}
0 commit comments