Search in sources :

Example 1 with MockHipChatGlobalEntity

use of com.blackducksoftware.integration.hub.alert.channel.hipchat.mock.MockHipChatGlobalEntity in project hub-alert by blackducksoftware.

the class GlobalHipChatRepositoryWrapperTest method encryptedEntity.

@Override
public GlobalHipChatConfigEntity encryptedEntity() throws EncryptionException {
    final MockHipChatGlobalEntity mockHipChatGlobalEntity = new MockHipChatGlobalEntity();
    mockHipChatGlobalEntity.setApiKey(PasswordEncrypter.encrypt(mockHipChatGlobalEntity.getApiKey()));
    return mockHipChatGlobalEntity.createGlobalEntity();
}
Also used : MockHipChatGlobalEntity(com.blackducksoftware.integration.hub.alert.channel.hipchat.mock.MockHipChatGlobalEntity)

Example 2 with MockHipChatGlobalEntity

use of com.blackducksoftware.integration.hub.alert.channel.hipchat.mock.MockHipChatGlobalEntity in project hub-alert by blackducksoftware.

the class GlobalHipChatRepositoryWrapperTest method getEntityToDecrypt.

@Override
public GlobalHipChatConfigEntity getEntityToDecrypt() throws EncryptionException {
    final MockHipChatGlobalEntity mockHipChatGlobalEntity = new MockHipChatGlobalEntity();
    final String encryptedPassword = PasswordEncrypter.encrypt(mockHipChatGlobalEntity.getApiKey());
    mockHipChatGlobalEntity.setApiKey(encryptedPassword);
    return mockHipChatGlobalEntity.createGlobalEntity();
}
Also used : MockHipChatGlobalEntity(com.blackducksoftware.integration.hub.alert.channel.hipchat.mock.MockHipChatGlobalEntity)

Example 3 with MockHipChatGlobalEntity

use of com.blackducksoftware.integration.hub.alert.channel.hipchat.mock.MockHipChatGlobalEntity 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

MockHipChatGlobalEntity (com.blackducksoftware.integration.hub.alert.channel.hipchat.mock.MockHipChatGlobalEntity)3 GlobalHipChatConfigRestModel (com.blackducksoftware.integration.hub.alert.channel.hipchat.controller.global.GlobalHipChatConfigRestModel)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