@@ -66,12 +66,14 @@ public void setup() {
66
66
MockitoAnnotations .openMocks (this );
67
67
68
68
when (propertyHelper .getString (KnownProperties .EXTRACT_JSON_ORIGIN_COLUMN_NAME )).thenReturn (standardOriginName );
69
- when (propertyHelper .getString (KnownProperties .EXTRACT_JSON_TARGET_COLUMN_NAME )).thenReturn (standardTargetName );
69
+ when (propertyHelper .getString (KnownProperties .EXTRACT_JSON_TARGET_COLUMN_MAPPING )).thenReturn (standardTargetName );
70
70
71
+ when (originTable .getKeyspaceTable ()).thenReturn ("ORIGIN_TABLE" );
71
72
when (originTable .isOrigin ()).thenReturn (true );
72
73
when (originTable .extendColumns (Collections .singletonList (standardOriginName ))).
73
74
thenReturn (Collections .singletonList (CqlData .getBindClass (standardOriginTypes .get (1 ))));
74
75
76
+ when (targetTable .getKeyspaceTable ()).thenReturn ("TARGET_TABLE" );
75
77
when (targetTable .isOrigin ()).thenReturn (false );
76
78
when (targetTable .extendColumns (Collections .singletonList (standardTargetName ))).
77
79
thenReturn (Collections .singletonList (CqlData .getBindClass (standardTargetTypes .get (1 ))));
@@ -114,7 +116,7 @@ public void loadPropertiesOriginError() {
114
116
115
117
@ Test
116
118
public void loadPropertiesTargetError () {
117
- when (propertyHelper .getString (KnownProperties .EXTRACT_JSON_TARGET_COLUMN_NAME )).thenReturn (null );
119
+ when (propertyHelper .getString (KnownProperties .EXTRACT_JSON_TARGET_COLUMN_MAPPING )).thenReturn (null );
118
120
assertFalse (feature .loadProperties (propertyHelper ), "Target column name is not set" );
119
121
}
120
122
@@ -143,7 +145,7 @@ public void extractNull() throws JsonMappingException, JsonProcessingException{
143
145
@ Test
144
146
public void disabledFeature () {
145
147
when (propertyHelper .getString (KnownProperties .EXTRACT_JSON_ORIGIN_COLUMN_NAME )).thenReturn ("" );
146
- when (propertyHelper .getString (KnownProperties .EXTRACT_JSON_TARGET_COLUMN_NAME )).thenReturn ("" );
148
+ when (propertyHelper .getString (KnownProperties .EXTRACT_JSON_TARGET_COLUMN_MAPPING )).thenReturn ("" );
147
149
148
150
assertAll (
149
151
() -> assertTrue (feature .loadProperties (propertyHelper ), "loadProperties" ),
@@ -155,20 +157,20 @@ public void disabledFeature() {
155
157
() -> assertEquals (-1 , feature .getOriginColumnIndex (), "origin index" )
156
158
);
157
159
158
- when (propertyHelper .getString (KnownProperties .EXTRACT_JSON_TARGET_COLUMN_NAME )).thenReturn (null );
160
+ when (propertyHelper .getString (KnownProperties .EXTRACT_JSON_TARGET_COLUMN_MAPPING )).thenReturn (null );
159
161
assertEquals ("" , feature .getTargetColumnName (), "target name" );
160
162
}
161
163
162
164
@ Test
163
165
public void initializeAndValidateExceptionOriginNull () {
164
166
IllegalArgumentException thrown = assertThrows (IllegalArgumentException .class , () -> feature .initializeAndValidate (null , targetTable ));
165
- assertTrue (thrown .getMessage ().contains ("originTable and/or targetTable is null" ));
167
+ assertTrue (thrown .getMessage ().contains ("Origin table and/or Target table is null" ));
166
168
}
167
169
168
170
@ Test
169
171
public void initializeAndValidateExceptionTargetNull () {
170
172
IllegalArgumentException thrown = assertThrows (IllegalArgumentException .class , () -> feature .initializeAndValidate (originTable , null ));
171
- assertTrue (thrown .getMessage ().contains ("originTable and/or targetTable is null" ));
173
+ assertTrue (thrown .getMessage ().contains ("Origin table and/or Target table is null" ));
172
174
}
173
175
174
176
@ Test
@@ -182,7 +184,7 @@ public void initializeAndValidateExceptionOriginColumn() {
182
184
183
185
@ Test
184
186
public void initializeAndValidateExceptionTargetColumn () {
185
- when (propertyHelper .getString (KnownProperties .EXTRACT_JSON_TARGET_COLUMN_NAME )).thenReturn ("incorrect_column" );
187
+ when (propertyHelper .getString (KnownProperties .EXTRACT_JSON_TARGET_COLUMN_MAPPING )).thenReturn ("incorrect_column" );
186
188
187
189
feature .loadProperties (propertyHelper );
188
190
@@ -194,15 +196,15 @@ public void initializeAndValidateExceptionOriginIncorrect() {
194
196
when (originTable .isOrigin ()).thenReturn (false );
195
197
196
198
IllegalArgumentException thrown = assertThrows (IllegalArgumentException .class , () -> feature .initializeAndValidate (originTable , targetTable ));
197
- assertTrue (thrown .getMessage ().contains ("Origin table is not an origin table" ));
199
+ assertTrue (thrown .getMessage ().contains ("ORIGIN_TABLE is not an origin table" ));
198
200
}
199
201
200
202
@ Test
201
203
public void initializeAndValidateExceptionTargetIncorrect () {
202
204
when (targetTable .isOrigin ()).thenReturn (true );
203
205
204
206
IllegalArgumentException thrown = assertThrows (IllegalArgumentException .class , () -> feature .initializeAndValidate (originTable , targetTable ));
205
- assertTrue (thrown .getMessage ().contains ("Target table is not a target table" ));
207
+ assertTrue (thrown .getMessage ().contains ("TARGET_TABLE is not a target table" ));
206
208
}
207
209
208
210
@ Test
0 commit comments