3636import static org .assertj .core .api .Assertions .assertThat ;
3737import static org .assertj .core .api .Assertions .assertThatThrownBy ;
3838
39- /** Tests for {@link ConverterUtils }. */
40- public class ConverterUtilsTest {
39+ /** Tests for {@link PojoConverterUtils }. */
40+ public class PojoConverterUtilsTest {
4141
4242 private TestPojo createTestPojo () {
4343 return new TestPojo (
@@ -60,8 +60,8 @@ private TestPojo createTestPojo() {
6060
6161 @ Test
6262 public void testToRow () {
63- ConverterUtils <TestPojo > converter =
64- ConverterUtils .getConverter (TestPojo .class , createTestPojoRowType ());
63+ PojoConverterUtils <TestPojo > converter =
64+ PojoConverterUtils .getConverter (TestPojo .class , createTestPojoRowType ());
6565
6666 TestPojo pojo = createTestPojo ();
6767
@@ -93,8 +93,8 @@ public void testToRow() {
9393
9494 @ Test
9595 public void testFromRow () {
96- ConverterUtils <TestPojo > converter =
97- ConverterUtils .getConverter (TestPojo .class , createTestPojoRowType ());
96+ PojoConverterUtils <TestPojo > converter =
97+ PojoConverterUtils .getConverter (TestPojo .class , createTestPojoRowType ());
9898
9999 TestPojo originalPojo = createTestPojo ();
100100
@@ -108,8 +108,8 @@ public void testFromRow() {
108108
109109 @ Test
110110 public void testNullValues () {
111- ConverterUtils <TestPojo > converter =
112- ConverterUtils .getConverter (TestPojo .class , createTestPojoRowType ());
111+ PojoConverterUtils <TestPojo > converter =
112+ PojoConverterUtils .getConverter (TestPojo .class , createTestPojoRowType ());
113113
114114 assertThat (converter .toRow (null )).isNull ();
115115
@@ -140,11 +140,11 @@ public void testNullValues() {
140140
141141 @ Test
142142 public void testCaching () {
143- ConverterUtils <TestPojo > converter1 =
144- ConverterUtils .getConverter (TestPojo .class , createTestPojoRowType ());
143+ PojoConverterUtils <TestPojo > converter1 =
144+ PojoConverterUtils .getConverter (TestPojo .class , createTestPojoRowType ());
145145
146- ConverterUtils <TestPojo > converter2 =
147- ConverterUtils .getConverter (TestPojo .class , createTestPojoRowType ());
146+ PojoConverterUtils <TestPojo > converter2 =
147+ PojoConverterUtils .getConverter (TestPojo .class , createTestPojoRowType ());
148148
149149 // As caching is removed, subsequent calls should produce new instances
150150 assertThat (converter2 ).isNotSameAs (converter1 );
@@ -162,7 +162,7 @@ public void testPartialPojo() {
162162 .build ();
163163
164164 // Expect an IllegalArgumentException when creating a converter with a field not in the POJO
165- assertThatThrownBy (() -> ConverterUtils .getConverter (PartialTestPojo .class , rowType ))
165+ assertThatThrownBy (() -> PojoConverterUtils .getConverter (PartialTestPojo .class , rowType ))
166166 .isInstanceOf (IllegalArgumentException .class )
167167 .hasMessageContaining ("Field 'extraField' not found in POJO class" );
168168 }
@@ -177,7 +177,7 @@ public void testRowWithMissingFields() {
177177 .field ("stringField" , DataTypes .STRING ())
178178 .build ();
179179
180- ConverterUtils <TestPojo > converter = ConverterUtils .getConverter (TestPojo .class , rowType );
180+ PojoConverterUtils <TestPojo > converter = PojoConverterUtils .getConverter (TestPojo .class , rowType );
181181
182182 TestPojo pojo = createTestPojo ();
183183
@@ -214,8 +214,8 @@ public void testRowWithMissingFields() {
214214 public void testFieldAccessFailureThrows () {
215215 RowType rowType = RowType .builder ().field ("intField" , DataTypes .INT ()).build ();
216216
217- ConverterUtils <FinalFieldPojo > converter =
218- ConverterUtils .getConverter (FinalFieldPojo .class , rowType );
217+ PojoConverterUtils <FinalFieldPojo > converter =
218+ PojoConverterUtils .getConverter (FinalFieldPojo .class , rowType );
219219
220220 GenericRow row = new GenericRow (1 );
221221 row .setField (0 , 42 );
@@ -230,7 +230,7 @@ public void testFieldAccessFailureThrows() {
230230 public void testNoDefaultConstructorPojoThrows () {
231231 RowType rowType = RowType .builder ().field ("intField" , DataTypes .INT ()).build ();
232232 assertThatThrownBy (
233- () -> ConverterUtils .getConverter (NoDefaultConstructorPojo .class , rowType ))
233+ () -> PojoConverterUtils .getConverter (NoDefaultConstructorPojo .class , rowType ))
234234 .isInstanceOf (IllegalArgumentException .class )
235235 .hasMessageContaining ("must have a default constructor" );
236236 }
0 commit comments