@Test public void applyNullDefaultToEntity() { JaxbEntity entity = new JaxbEntity(); entity.setClazz("Entity"); DefaultConfigurationHelper.INSTANCE.applyDefaults(entity, null); assertNull(entity.getTable()); assertEquals("Entity", entity.getClazz()); }
@Test public void applyDefaultToEntity() { Default defaults = new Default(); defaults.setPackageName("org.test"); defaults.setSchema("schema"); defaults.setMetadataComplete(true); JaxbEntity entity = new JaxbEntity(); entity.setClazz("Entity"); DefaultConfigurationHelper.INSTANCE.applyDefaults(entity, defaults); assertNotNull(entity.getTable()); assertNull(entity.getTable().getSchema()); assertNull(entity.getTable().getCatalog()); assertTrue(entity.isMetadataComplete()); assertEquals("org.test.Entity", entity.getClazz()); DefaultConfigurationHelper.INSTANCE.applyDefaults(entity.getTable(), defaults); assertEquals("schema", entity.getTable().getSchema()); assertNull(entity.getTable().getCatalog()); }