11package com .fasterxml .jackson .dataformat .avro .interop .annotations ;
22
33import java .io .IOException ;
4- import java .lang .reflect .Type ;
54import java .nio .ByteBuffer ;
65import java .util .*;
76
8- import org .apache .avro .Schema ;
97import org .apache .avro .SchemaBuilder ;
108import org .apache .avro .io .Decoder ;
119import org .apache .avro .io .Encoder ;
12- import org .apache .avro .reflect .*;
13- import org .junit .jupiter .api .BeforeEach ;
14- import org .junit .jupiter .api .Test ;
15- import org .junit .jupiter .params .ParameterizedTest ;
16- import org .junit .jupiter .params .provider .MethodSource ;
10+ import org .apache .avro .reflect .AvroEncode ;
11+ import org .apache .avro .reflect .CustomEncoding ;
12+ import org .apache .avro .reflect .Nullable ;
13+ import org .apache .avro .reflect .ReflectData ;
14+ import org .junit .Before ;
15+ import org .junit .Test ;
1716
1817import com .fasterxml .jackson .dataformat .avro .interop .ApacheAvroInteropUtil ;
1918import com .fasterxml .jackson .dataformat .avro .interop .InteropTestBase ;
20- import com .fasterxml .jackson .dataformat .avro .testsupport .BiFunction ;
21- import com .fasterxml .jackson .dataformat .avro .testsupport .Function ;
2219
2320import static org .assertj .core .api .Assertions .assertThat ;
2421
@@ -143,7 +140,7 @@ public UUID read(Object datum, Decoder decoder) throws IOException {
143140 protected Wrapper wrapper ;
144141 protected Wrapper result ;
145142
146- @ BeforeEach
143+ @ Before
147144 public void setup () throws IOException {
148145 wrapper = new Wrapper ();
149146 //
@@ -168,109 +165,47 @@ public void setup() throws IOException {
168165 cc .stringValue = "Nested Hello World!" ;
169166 cc .uuidValue = UUID .randomUUID ();
170167 wrapper .component .nestedRecordValue = cc ;
168+ //
169+ result = roundTrip (wrapper );
171170 }
172171
173- @ MethodSource ("getParameters" )
174- @ ParameterizedTest (name = "{3}" )
175- public void testByteValue (
176- Function <Type , Schema > schemaFunctor , BiFunction <Schema , Object , byte []> serializeFunctor ,
177- BiFunction <Schema , byte [], Object > deserializeFunctor , String combinationName )
178- throws IOException
179- {
180- useParameters (schemaFunctor , serializeFunctor , deserializeFunctor );
181-
182- result = roundTrip (wrapper );
172+ @ Test
173+ public void testByteValue () {
183174 assertThat (result .component .byteValue ).isEqualTo (wrapper .component .byteValue );
184175 }
185176
186- @ MethodSource ("getParameters" )
187- @ ParameterizedTest (name = "{3}" )
188- public void testShortValue (
189- Function <Type , Schema > schemaFunctor , BiFunction <Schema , Object , byte []> serializeFunctor ,
190- BiFunction <Schema , byte [], Object > deserializeFunctor , String combinationName )
191- throws IOException
192- {
193- useParameters (schemaFunctor , serializeFunctor , deserializeFunctor );
194- result = roundTrip (wrapper );
195-
177+ @ Test
178+ public void testShortValue () {
196179 assertThat (result .component .shortValue ).isEqualTo (wrapper .component .shortValue );
197180 }
198181
199- @ MethodSource ("getParameters" )
200- @ ParameterizedTest (name = "{3}" )
201- public void testStringValue (
202- Function <Type , Schema > schemaFunctor , BiFunction <Schema , Object , byte []> serializeFunctor ,
203- BiFunction <Schema , byte [], Object > deserializeFunctor , String combinationName )
204- throws IOException
205- {
206- useParameters (schemaFunctor , serializeFunctor , deserializeFunctor );
207- result = roundTrip (wrapper );
208-
182+ @ Test
183+ public void testStringValue () {
209184 assertThat (result .component .stringValue ).isEqualTo (wrapper .component .stringValue );
210185 }
211186
212- @ MethodSource ("getParameters" )
213- @ ParameterizedTest (name = "{3}" )
214- public void testDoubleValue (
215- Function <Type , Schema > schemaFunctor , BiFunction <Schema , Object , byte []> serializeFunctor ,
216- BiFunction <Schema , byte [], Object > deserializeFunctor , String combinationName )
217- throws IOException
218- {
219- useParameters (schemaFunctor , serializeFunctor , deserializeFunctor );
220- result = roundTrip (wrapper );
221-
187+ @ Test
188+ public void testDoubleValue () {
222189 assertThat (result .component .doubleValue ).isEqualTo (wrapper .component .doubleValue );
223190 }
224191
225- @ MethodSource ("getParameters" )
226- @ ParameterizedTest (name = "{3}" )
227- public void testLongValue (
228- Function <Type , Schema > schemaFunctor , BiFunction <Schema , Object , byte []> serializeFunctor ,
229- BiFunction <Schema , byte [], Object > deserializeFunctor , String combinationName )
230- throws IOException
231- {
232- useParameters (schemaFunctor , serializeFunctor , deserializeFunctor );
233- result = roundTrip (wrapper );
234-
192+ @ Test
193+ public void testLongValue () {
235194 assertThat (result .component .longValue ).isEqualTo (wrapper .component .longValue );
236195 }
237196
238- @ MethodSource ("getParameters" )
239- @ ParameterizedTest (name = "{3}" )
240- public void testIntegerValue (
241- Function <Type , Schema > schemaFunctor , BiFunction <Schema , Object , byte []> serializeFunctor ,
242- BiFunction <Schema , byte [], Object > deserializeFunctor , String combinationName )
243- throws IOException
244- {
245- useParameters (schemaFunctor , serializeFunctor , deserializeFunctor );
246- result = roundTrip (wrapper );
247-
197+ @ Test
198+ public void testIntegerValue () {
248199 assertThat (result .component .intValue ).isEqualTo (wrapper .component .intValue );
249200 }
250201
251- @ MethodSource ("getParameters" )
252- @ ParameterizedTest (name = "{3}" )
253- public void testNestedUuidValue (
254- Function <Type , Schema > schemaFunctor , BiFunction <Schema , Object , byte []> serializeFunctor ,
255- BiFunction <Schema , byte [], Object > deserializeFunctor , String combinationName )
256- throws IOException
257- {
258- useParameters (schemaFunctor , serializeFunctor , deserializeFunctor );
259- result = roundTrip (wrapper );
260-
202+ @ Test
203+ public void testNestedUuidValue () {
261204 assertThat (result .component .nestedRecordValue .uuidValue ).isEqualTo (wrapper .component .nestedRecordValue .uuidValue );
262205 }
263206
264- @ MethodSource ("getParameters" )
265- @ ParameterizedTest (name = "{3}" )
266- public void testUuidValue (
267- Function <Type , Schema > schemaFunctor , BiFunction <Schema , Object , byte []> serializeFunctor ,
268- BiFunction <Schema , byte [], Object > deserializeFunctor , String combinationName )
269- throws IOException
270- {
271- useParameters (schemaFunctor , serializeFunctor , deserializeFunctor );
272- result = roundTrip (wrapper );
273-
207+ @ Test
208+ public void testUuidValue () {
274209 assertThat (result .component .uuidValue ).isEqualTo (wrapper .component .uuidValue );
275210 }
276211}
0 commit comments