Search in sources :

Example 6 with GlobalEmailConfigEntity

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);
}
Also used : GlobalEmailConfigEntity(com.blackducksoftware.integration.hub.alert.channel.email.repository.global.GlobalEmailConfigEntity) MockEmailGlobalRestModel(com.blackducksoftware.integration.hub.alert.channel.email.mock.MockEmailGlobalRestModel) MockEmailGlobalEntity(com.blackducksoftware.integration.hub.alert.channel.email.mock.MockEmailGlobalEntity) GlobalEmailConfigRestModel(com.blackducksoftware.integration.hub.alert.channel.email.controller.global.GlobalEmailConfigRestModel) Test(org.junit.Test)

Example 7 with GlobalEmailConfigEntity

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);
}
Also used : GlobalEmailConfigEntity(com.blackducksoftware.integration.hub.alert.channel.email.repository.global.GlobalEmailConfigEntity) MockEmailGlobalRestModel(com.blackducksoftware.integration.hub.alert.channel.email.mock.MockEmailGlobalRestModel) MockEmailGlobalEntity(com.blackducksoftware.integration.hub.alert.channel.email.mock.MockEmailGlobalEntity) GlobalEmailConfigRestModel(com.blackducksoftware.integration.hub.alert.channel.email.controller.global.GlobalEmailConfigRestModel) Test(org.junit.Test)

Aggregations

GlobalEmailConfigEntity (com.blackducksoftware.integration.hub.alert.channel.email.repository.global.GlobalEmailConfigEntity)7 Test (org.junit.Test)6 MockEmailGlobalEntity (com.blackducksoftware.integration.hub.alert.channel.email.mock.MockEmailGlobalEntity)4 GlobalEmailConfigRestModel (com.blackducksoftware.integration.hub.alert.channel.email.controller.global.GlobalEmailConfigRestModel)3 MockEmailGlobalRestModel (com.blackducksoftware.integration.hub.alert.channel.email.mock.MockEmailGlobalRestModel)3 TestGlobalProperties (com.blackducksoftware.integration.hub.alert.TestGlobalProperties)1 AuditEntryRepositoryWrapper (com.blackducksoftware.integration.hub.alert.audit.repository.AuditEntryRepositoryWrapper)1 ChannelTest (com.blackducksoftware.integration.hub.alert.channel.ChannelTest)1 EmailGroupChannel (com.blackducksoftware.integration.hub.alert.channel.email.EmailGroupChannel)1 MockEmailEntity (com.blackducksoftware.integration.hub.alert.channel.email.mock.MockEmailEntity)1 GlobalEmailRepositoryWrapper (com.blackducksoftware.integration.hub.alert.channel.email.repository.global.GlobalEmailRepositoryWrapper)1 GlobalHubConfigEntity (com.blackducksoftware.integration.hub.alert.datasource.entity.global.GlobalHubConfigEntity)1 GlobalHubRepositoryWrapper (com.blackducksoftware.integration.hub.alert.datasource.entity.repository.global.GlobalHubRepositoryWrapper)1 ProjectData (com.blackducksoftware.integration.hub.alert.digest.model.ProjectData)1 ExternalConnectionTest (com.blackducksoftware.integration.test.annotation.ExternalConnectionTest)1 Category (org.junit.experimental.categories.Category)1