DataTypeUtils { void overwriteJavaTypes() { Properties properties = getConfigProperties(); final Enumeration<?> propertyNames = properties.propertyNames(); while (propertyNames.hasMoreElements()) { String key = (String) propertyNames.nextElement(); String value = properties.getProperty(key); logger.info(key + ":" + value); if (key.startsWith(PREFIX_KISSMDA_PROPERTIES_CONST)) { logger.info("KissMDA datatypes."); String keyDataType = key.replace(PREFIX_KISSMDA_PROPERTIES_CONST, ""); logger.info("Key: " + keyDataType + " - " + "Value: " + value); javaTypes.put(keyDataType, value); } } }  Map<String, Code> getPrimitiveTypeCodes(); Map<String, String> getJavaTypes(); boolean isPrimitiveType(String typeName); boolean isJavaType(String typeName); boolean isArrayType(String typeName); boolean isParameterizedType(String typeName);  }
@Test public void testOverwriteJavaTypes() throws Exception { when(context.getPropertyFile()).thenReturn( "src/test/resources/application.properties"); Map<String, String> javaTypes = dataTypeUtils.getJavaTypes(); boolean found = false; for (String value : javaTypes.values()) { if (value.equals("java.time.LocalDate")) { assertTrue("Overwritten is ok.", true); found = true; logger.log(Level.SEVERE,"java.util.Date overwritten with java.time.LocalDate!"); } if (value.equals("de.lofi.Test")) { found = true; assertTrue("Overwritten is ok.", true); logger.log(Level.SEVERE,"java.time.LocalDateTime overwritten with de.lofi.Test!"); } if (value.equals("java.util.Date")) { logger.log(Level.SEVERE, "java.util.Date found!"); assertTrue(false); } if (value.equals("java.time.LocalDateTime")) { logger.log(Level.SEVERE, "java.time.LocalDateTime found!"); assertTrue(false); } } if (!found) { assertTrue("Overwrite does not work!", false); } }