17
17
18
18
import static org .assertj .core .api .Assertions .assertThat ;
19
19
import static org .assertj .core .api .Assertions .assertThatNoException ;
20
- import static org .assertj .core .api .Assumptions .assumeThat ;
21
20
22
21
import com .nextbreakpoint .flinkclient .model .JarRunResponseBody ;
23
22
import com .nextbreakpoint .flinkclient .model .JarUploadResponseBody ;
@@ -40,16 +39,13 @@ class FlinkMainIT extends AbstractITSupport {
40
39
static Stream <Arguments > sqlScripts () {
41
40
var scripts = List .of ("flink.sql" , "test_sql.sql" );
42
41
var config = List .of (true , false );
43
- var block = List .of (true , false );
44
- return Lists .cartesianProduct (scripts , config , block ).stream ()
42
+ return Lists .cartesianProduct (scripts , config ).stream ()
45
43
.map (pair -> Arguments .of (pair .toArray ()));
46
44
}
47
45
48
- @ ParameterizedTest (name = "{0} {1} {2} " )
46
+ @ ParameterizedTest (name = "{0} {1}" )
49
47
@ MethodSource ("sqlScripts" )
50
- void givenSqlScript_whenExecuting_thenSuccess (String filename , boolean config , boolean block ) {
51
- assumeThat (block ).as ("`--block` doesn't seem to work" ).isFalse ();
52
-
48
+ void givenSqlScript_whenExecuting_thenSuccess (String filename , boolean config ) {
53
49
String sqlFile = "/opt/flink/usrlib/sql/" + filename ;
54
50
var args = new ArrayList <String >();
55
51
args .add ("--sqlfile" );
@@ -58,17 +54,28 @@ void givenSqlScript_whenExecuting_thenSuccess(String filename, boolean config, b
58
54
args .add ("--config-dir" );
59
55
args .add ("/opt/flink/usrlib/config/" );
60
56
}
61
- if (block ) {
62
- args .add ("--block" );
63
- }
64
57
execute (args .toArray (String []::new ));
65
58
}
66
59
60
+ static Stream <Arguments > planScripts () {
61
+ var scripts = List .of ("compiled-plan.json" , "test_plan.json" );
62
+ var config = List .of (true , false );
63
+ return Lists .cartesianProduct (scripts , config ).stream ()
64
+ .map (pair -> Arguments .of (pair .toArray ()));
65
+ }
66
+
67
67
@ ParameterizedTest (name = "{0}" )
68
- @ CsvSource ({ "compiled-plan.json" , "test_plan.json" } )
69
- void givenPlansScript_whenExecuting_thenSuccess (String filename ) {
68
+ @ MethodSource ( "planScripts" )
69
+ void givenPlansScript_whenExecuting_thenSuccess (String filename , boolean config ) {
70
70
String planFile = "/opt/flink/usrlib/plans/" + filename ;
71
- execute ("--planfile" , planFile );
71
+ var args = new ArrayList <String >();
72
+ args .add ("--planfile" );
73
+ args .add (planFile );
74
+ if (config ) {
75
+ args .add ("--config-dir" );
76
+ args .add ("/opt/flink/usrlib/config/" );
77
+ }
78
+ execute (args .toArray (String []::new ));
72
79
}
73
80
74
81
@ SneakyThrows
0 commit comments