Search in sources :

Example 1 with GlobalHipChatConfigRestModel

use of com.blackducksoftware.integration.hub.alert.channel.hipchat.controller.global.GlobalHipChatConfigRestModel in project hub-alert by blackducksoftware.

the class ObjectTransformerTest method testTransformHipchatModels.

@Test
public void testTransformHipchatModels() throws Exception {
    final MockHipChatGlobalEntity mockHipChatGlobalEntity = new MockHipChatGlobalEntity();
    final MockHipChatGlobalRestModel hipChatMockUtils = new MockHipChatGlobalRestModel();
    final ObjectTransformer objectTransformer = new ObjectTransformer();
    final GlobalHipChatConfigRestModel restModel = hipChatMockUtils.createGlobalRestModel();
    final GlobalHipChatConfigEntity configEntity = mockHipChatGlobalEntity.createGlobalEntity();
    final GlobalHipChatConfigEntity transformedConfigEntity = objectTransformer.configRestModelToDatabaseEntity(restModel, GlobalHipChatConfigEntity.class);
    final GlobalHipChatConfigRestModel transformedConfigRestModel = objectTransformer.databaseEntityToConfigRestModel(configEntity, GlobalHipChatConfigRestModel.class);
    assertEquals(restModel, transformedConfigRestModel);
    assertEquals(configEntity, transformedConfigEntity);
}
Also used : GlobalHipChatConfigRestModel(com.blackducksoftware.integration.hub.alert.channel.hipchat.controller.global.GlobalHipChatConfigRestModel) GlobalHipChatConfigEntity(com.blackducksoftware.integration.hub.alert.channel.hipchat.repository.global.GlobalHipChatConfigEntity) MockHipChatGlobalRestModel(com.blackducksoftware.integration.hub.alert.channel.hipchat.mock.MockHipChatGlobalRestModel) MockHipChatGlobalEntity(com.blackducksoftware.integration.hub.alert.channel.hipchat.mock.MockHipChatGlobalEntity) Test(org.junit.Test)

Aggregations

GlobalHipChatConfigRestModel (com.blackducksoftware.integration.hub.alert.channel.hipchat.controller.global.GlobalHipChatConfigRestModel)1 MockHipChatGlobalEntity (com.blackducksoftware.integration.hub.alert.channel.hipchat.mock.MockHipChatGlobalEntity)1 MockHipChatGlobalRestModel (com.blackducksoftware.integration.hub.alert.channel.hipchat.mock.MockHipChatGlobalRestModel)1 GlobalHipChatConfigEntity (com.blackducksoftware.integration.hub.alert.channel.hipchat.repository.global.GlobalHipChatConfigEntity)1 Test (org.junit.Test)1