SqlToPdxInstanceCreator { public SqlToPdxInstance create() { SqlToPdxInstance result = new SqlToPdxInstance(); PdxInstanceFactory templateFactory = createPdxInstanceFactory(); for (FieldMapping columnMapping : regionMapping.getFieldMappings()) { String columnName = columnMapping.getJdbcName(); String fieldName = columnMapping.getPdxName(); FieldType fieldType = FieldType.valueOf(columnMapping.getPdxType()); result.addMapping(columnName, fieldName, fieldType); writeField(templateFactory, columnMapping, fieldName, fieldType); } result.setPdxTemplate(templateFactory.create()); return result; } SqlToPdxInstanceCreator(InternalCache cache, RegionMapping regionMapping); SqlToPdxInstance create(); static void writeField(PdxInstanceFactory factory, FieldMapping columnMapping,
      String fieldName,
      FieldType fieldType);  }
@Test @Parameters(source = FieldType.class) public void readWritesFieldGivenPdxFieldType(FieldType fieldType) throws Exception { PdxInstanceFactory factory = setupPdxInstanceFactory(fieldType); when(columnMapping.getJdbcType()).thenReturn(JDBCType.NULL.name()); when(columnMapping.getPdxType()).thenReturn(fieldType.name()); createSqlToPdxInstance(); verifyPdxFactoryWrite(factory, fieldType); verify(factory).create(); }