use of com.blackducksoftware.integration.hub.alert.channel.email.repository.global.GlobalEmailConfigEntity in project hub-alert by blackducksoftware.
the class ObjectTransformerTest method testTransformListsOfModels.
@Test
public void testTransformListsOfModels() throws Exception {
final MockEmailGlobalRestModel restGlobalEmailMockUtil = new MockEmailGlobalRestModel();
final MockEmailGlobalEntity mockEmailGlobalEntity = new MockEmailGlobalEntity();
final ObjectTransformer objectTransformer = new ObjectTransformer();
final GlobalEmailConfigRestModel restModel = restGlobalEmailMockUtil.createGlobalRestModel();
final GlobalEmailConfigEntity configEntity = mockEmailGlobalEntity.createGlobalEntity();
List<GlobalEmailConfigEntity> transformedConfigEntities = objectTransformer.configRestModelsToDatabaseEntities(Arrays.asList(restModel), GlobalEmailConfigEntity.class);
List<GlobalEmailConfigRestModel> transformedConfigRestModels = objectTransformer.databaseEntitiesToConfigRestModels(Arrays.asList(configEntity), GlobalEmailConfigRestModel.class);
assertNotNull(transformedConfigEntities);
assertNotNull(transformedConfigRestModels);
assertTrue(transformedConfigEntities.size() == 1);
assertTrue(transformedConfigRestModels.size() == 1);
assertEquals(restModel, transformedConfigRestModels.get(0));
assertEquals(configEntity, transformedConfigEntities.get(0));
transformedConfigEntities = objectTransformer.configRestModelsToDatabaseEntities(null, GlobalEmailConfigEntity.class);
transformedConfigRestModels = objectTransformer.databaseEntitiesToConfigRestModels(null, GlobalEmailConfigRestModel.class);
}
use of com.blackducksoftware.integration.hub.alert.channel.email.repository.global.GlobalEmailConfigEntity in project hub-alert by blackducksoftware.
the class ObjectTransformerTest method testTransformEmailModels.
@Test
public void testTransformEmailModels() throws Exception {
final MockEmailGlobalRestModel restGlobalEmailMockUtil = new MockEmailGlobalRestModel();
final MockEmailGlobalEntity mockEmailGlobalEntity = new MockEmailGlobalEntity();
final ObjectTransformer objectTransformer = new ObjectTransformer();
final GlobalEmailConfigRestModel restModel = restGlobalEmailMockUtil.createGlobalRestModel();
final GlobalEmailConfigEntity configEntity = mockEmailGlobalEntity.createGlobalEntity();
final GlobalEmailConfigEntity transformedConfigEntity = objectTransformer.configRestModelToDatabaseEntity(restModel, GlobalEmailConfigEntity.class);
final GlobalEmailConfigRestModel transformedConfigRestModel = objectTransformer.databaseEntityToConfigRestModel(configEntity, GlobalEmailConfigRestModel.class);
assertEquals(restModel, transformedConfigRestModel);
assertEquals(configEntity, transformedConfigEntity);
}
Aggregations