@@ -63,22 +63,20 @@ void noFieldName_NullValue_Skip() {
63
63
assertEquals (originalRecord , result );
64
64
}
65
65
66
- @ ParameterizedTest
67
- @ ValueSource (strings = {"md5" , "sha1" , "sha256" })
68
- void nullSchema (final String hashFunction ) {
66
+ @ Test
67
+ void nullSchema () {
69
68
final SinkRecord originalRecord = record (null , null );
70
69
final Throwable e = assertThrows (DataException .class ,
71
- () -> transformation (FIELD , true , hashFunction ).apply (originalRecord ));
70
+ () -> transformation (FIELD , true , DEFAULT_HASH_FUNCTION ).apply (originalRecord ));
72
71
assertEquals (dataPlace () + " schema can't be null: " + originalRecord , e .getMessage ());
73
72
}
74
73
75
- @ ParameterizedTest
76
- @ ValueSource (strings = {"md5" , "sha1" , "sha256" })
77
- void noFieldName_UnsupportedType (final String hashFunction ) {
74
+ @ Test
75
+ void noFieldName_UnsupportedType () {
78
76
final Schema schema = SchemaBuilder .struct ().build ();
79
77
final SinkRecord originalRecord = record (schema , new Struct (schema ));
80
78
final Throwable e = assertThrows (DataException .class ,
81
- () -> transformation (null , true , hashFunction ).apply (originalRecord ));
79
+ () -> transformation (null , true , DEFAULT_HASH_FUNCTION ).apply (originalRecord ));
82
80
assertEquals (dataPlace ()
83
81
+ " schema type must be STRING if field name is not specified: "
84
82
+ originalRecord ,
@@ -153,41 +151,38 @@ void fieldName_MissingValue_Skip() {
153
151
assertEquals (originalRecord , result );
154
152
}
155
153
156
- @ ParameterizedTest
157
- @ ValueSource (strings = {"md5" , "sha1" , "sha256" })
158
- void fieldName_NonStruct (final String hashFunction ) {
154
+ @ Test
155
+ void fieldName_NonStruct () {
159
156
final SinkRecord originalRecord = record (SchemaBuilder .INT8_SCHEMA , "some" );
160
157
final Throwable e = assertThrows (DataException .class ,
161
- () -> transformation (FIELD , true , hashFunction ).apply (originalRecord ));
158
+ () -> transformation (FIELD , true , DEFAULT_HASH_FUNCTION ).apply (originalRecord ));
162
159
assertEquals (dataPlace () + " schema type must be STRUCT if field name is specified: "
163
160
+ originalRecord ,
164
161
e .getMessage ());
165
162
}
166
163
167
- @ ParameterizedTest
168
- @ ValueSource (strings = {"md5" , "sha1" , "sha256" })
169
- void fieldName_NullStruct (final String hashFunction ) {
164
+ @ Test
165
+ void fieldName_NullStruct () {
170
166
final Schema schema = SchemaBuilder .struct ()
171
167
.field (FIELD , SchemaBuilder .STRING_SCHEMA )
172
168
.schema ();
173
169
final SinkRecord originalRecord = record (schema , null );
174
170
final Throwable e = assertThrows (DataException .class ,
175
- () -> transformation (FIELD , true , hashFunction ).apply (originalRecord ));
171
+ () -> transformation (FIELD , true , DEFAULT_HASH_FUNCTION ).apply (originalRecord ));
176
172
assertEquals (dataPlace () + " can't be null if field name is specified: " + originalRecord ,
177
173
e .getMessage ());
178
174
}
179
175
180
- @ ParameterizedTest
181
- @ ValueSource (strings = {"md5" , "sha1" , "sha256" })
182
- void fieldName_UnsupportedTypeInField (final String hashFunction ) {
176
+ @ Test
177
+ void fieldName_UnsupportedTypeInField () {
183
178
final Schema innerSchema = SchemaBuilder .struct ().build ();
184
179
final Schema schema = SchemaBuilder .struct ()
185
180
.field (FIELD , innerSchema )
186
181
.schema ();
187
182
final SinkRecord originalRecord = record (
188
183
schema , new Struct (schema ).put (FIELD , new Struct (innerSchema )));
189
184
final Throwable e = assertThrows (DataException .class ,
190
- () -> transformation (FIELD , true , hashFunction ).apply (originalRecord ));
185
+ () -> transformation (FIELD , true , DEFAULT_HASH_FUNCTION ).apply (originalRecord ));
191
186
assertEquals (FIELD + " schema type in " + dataPlace () + " must be STRING: "
192
187
+ originalRecord ,
193
188
e .getMessage ());
0 commit comments