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();
}
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();
}
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);
}
Aggregations