use of com.blackducksoftware.integration.hub.alert.mock.ProjectMockUtils in project hub-alert by blackducksoftware.
the class ConfiguredProjectsRepositoryWrapperTest method testFindByProjectName.
@Test
public void testFindByProjectName() throws IOException {
final ProjectMockUtils projectMockUtils = new ProjectMockUtils();
final ConfiguredProjectsRepository repository = Mockito.mock(ConfiguredProjectsRepository.class);
Mockito.when(repository.findByProjectName(Mockito.anyString())).thenReturn(projectMockUtils.getProjectOneEntity());
final ConfiguredProjectsRepositoryWrapper configuredProjectsRepositoryWrapper = new ConfiguredProjectsRepositoryWrapper(repository) {
@Override
public ConfiguredProjectEntity decryptSensitiveData(final ConfiguredProjectEntity entity) throws EncryptionException {
throw new EncryptionException();
}
};
final ConfiguredProjectEntity actual = configuredProjectsRepositoryWrapper.findByProjectName("any");
assertNull(actual);
assertTrue(outputLogger.isLineContainingText("Error finding common distribution config"));
}
Aggregations