18
18
19
19
import org .apache .nifi .flowfile .FlowFile ;
20
20
import org .apache .nifi .reporting .InitializationException ;
21
- import org .apache .nifi .util .TestRunners ;
22
- import org .george0st .cql .CQLControllerService ;
23
- import org .george0st .processors .cql .helper .ReadableValue ;
24
21
import org .george0st .processors .cql .helper .TestSetup ;
25
- import org .junit .jupiter .api .BeforeEach ;
26
22
import org .junit .jupiter .api .Test ;
27
23
28
24
import static org .junit .jupiter .api .Assertions .*;
29
25
import static org .junit .jupiter .api .Assumptions .assumeTrue ;
30
26
31
27
import java .io .IOException ;
32
- import java .util .*;
33
28
34
29
public class PutCQLFunction extends PutCQLBase {
35
30
// Helper
@@ -48,7 +43,7 @@ public void testBasic() {
48
43
FlowFile result ;
49
44
50
45
for (TestSetup setup : setups ) {
51
- result = coreTest (setup , content );
46
+ result = runTest (setup , content );
52
47
// check amount of write items
53
48
assertNotNull (result , String .format ("Issue with processing in '%s'" , setup .name ));
54
49
assertEquals (4 , Long .parseLong (result .getAttribute (PutCQL .ATTRIBUTE_COUNT )));
@@ -65,7 +60,7 @@ public void testBatchLoggedTypes() {
65
60
FlowFile result ;
66
61
67
62
for (TestSetup setup : setups ) {
68
- result = coreTest (setup , content , PutCQL .BATCH_TYPE , PutCQL .BT_LOGGED .getValue ());
63
+ result = runTestWithProperty (setup , content , PutCQL .BATCH_TYPE , PutCQL .BT_LOGGED .getValue ());
69
64
// check amount of write items
70
65
assertNotNull (result , String .format ("Issue with processing in '%s'" , setup .name ));
71
66
assertEquals (4 , Long .parseLong (result .getAttribute (PutCQL .ATTRIBUTE_COUNT )));
@@ -82,7 +77,7 @@ public void testBatchUnLoggedTypes() {
82
77
FlowFile result ;
83
78
84
79
for (TestSetup setup : setups ) {
85
- result = coreTest (setup , content , PutCQL .BATCH_TYPE , PutCQL .BT_LOGGED .getValue ());
80
+ result = runTestWithProperty (setup , content , PutCQL .BATCH_TYPE , PutCQL .BT_LOGGED .getValue ());
86
81
// check amount of write items
87
82
assertNotNull (result , String .format ("Issue with processing in '%s'" , setup .name ));
88
83
assertEquals (4 , Long .parseLong (result .getAttribute (PutCQL .ATTRIBUTE_COUNT )));
@@ -107,12 +102,12 @@ public void testMoreItems() {
107
102
FlowFile result ;
108
103
109
104
for (TestSetup setup : setups ) {
110
- result = coreTest (setup , content );
105
+ result = runTest (setup , content );
111
106
// check amount of write items
112
107
assertNotNull (result , String .format ("Issue with processing in '%s'" , setup .name ));
113
108
assertEquals (5 , Long .parseLong (result .getAttribute (PutCQL .ATTRIBUTE_COUNT )));
114
109
115
- result = coreTest (setup , content2 );
110
+ result = runTest (setup , content2 );
116
111
// check amount of write items
117
112
assertNotNull (result , String .format ("Issue with processing in '%s'" , setup .name ));
118
113
assertEquals (4 , Long .parseLong (result .getAttribute (PutCQL .ATTRIBUTE_COUNT )));
@@ -129,7 +124,7 @@ public void testNoQuotas() {
129
124
FlowFile result ;
130
125
131
126
for (TestSetup setup : setups ) {
132
- result = coreTest (setup , content );
127
+ result = runTest (setup , content );
133
128
// check amount of write items
134
129
assertNotNull (result , String .format ("Issue with processing in '%s'" , setup .name ));
135
130
assertEquals (4 , Long .parseLong (result .getAttribute (PutCQL .ATTRIBUTE_COUNT )));
@@ -142,7 +137,7 @@ public void testEmptyInput() {
142
137
FlowFile result ;
143
138
144
139
for (TestSetup setup : setups ) {
145
- result = coreTest (setup , content );
140
+ result = runTest (setup , content );
146
141
// check amount of write items
147
142
assertNotNull (result , String .format ("Issue with processing in '%s'" , setup .name ));
148
143
assertEquals (0 , Long .parseLong (result .getAttribute (PutCQL .ATTRIBUTE_COUNT )));
@@ -155,7 +150,7 @@ public void testOnlyHeader() {
155
150
FlowFile result ;
156
151
157
152
for (TestSetup setup : setups ) {
158
- result = coreTest (setup , content );
153
+ result = runTest (setup , content );
159
154
// check amount of write items
160
155
assertNotNull (result , String .format ("Issue with processing in '%s'" , setup .name ));
161
156
assertEquals (0 , Long .parseLong (result .getAttribute (PutCQL .ATTRIBUTE_COUNT )));
@@ -168,7 +163,7 @@ public void testOnlyHeaderNoQuotas() {
168
163
FlowFile result ;
169
164
170
165
for (TestSetup setup : setups ) {
171
- result = coreTest (setup , content );
166
+ result = runTest (setup , content );
172
167
// check amount of write items
173
168
assertNotNull (result , String .format ("Issue with processing in '%s'" , setup .name ));
174
169
assertEquals (0 , Long .parseLong (result .getAttribute (PutCQL .ATTRIBUTE_COUNT )));
@@ -186,7 +181,7 @@ public void testBasicRepeat5() {
186
181
187
182
for (TestSetup setup : setups ) {
188
183
for (int i = 0 ; i < 5 ; i ++) {
189
- result = coreTest (setup , content );
184
+ result = runTest (setup , content );
190
185
// check amount of write items
191
186
assertNotNull (result , String .format ("Issue with processing in '%s'" , setup .name ));
192
187
assertEquals (4 , Long .parseLong (result .getAttribute (PutCQL .ATTRIBUTE_COUNT )));
@@ -204,7 +199,7 @@ public void testNoQuotas2() {
204
199
FlowFile result ;
205
200
206
201
for (TestSetup setup : setups ) {
207
- result = coreTest (setup , content );
202
+ result = runTest (setup , content );
208
203
// check amount of write items
209
204
assertNotNull (result , String .format ("Issue with processing in '%s'" , setup .name ));
210
205
assertEquals (4 , Long .parseLong (result .getAttribute (PutCQL .ATTRIBUTE_COUNT )));
0 commit comments