use of org.codice.ddf.admin.application.rest.model.FeatureDetails in project ddf by codice.
the class ApplicationServiceBeanTest method testGetAllFeatures.
/**
* Tests the {@link ApplicationServiceBean#getAllFeatures()} method
*
* @throws Exception
*/
@Test
public void testGetAllFeatures() throws Exception {
ApplicationServiceBean serviceBean = newApplicationServiceBean();
List<FeatureDetails> testFeatureDetailsList = new ArrayList<>();
FeatureDetails testFeatureDetails1 = mock(FeatureDetails.class);
testFeatureDetailsList.add(testFeatureDetails1);
when(testFeatureDetails1.getName()).thenReturn(TEST_FEATURE_DETAILS);
when(testFeatureDetails1.getVersion()).thenReturn(TEST_VERSION);
when(testFeatureDetails1.getStatus()).thenReturn(TEST_FEATURE_STATUS);
when(testFeatureDetails1.getRepository()).thenReturn(TEST_REPO_NAME);
when(testAppService.getAllFeatures()).thenReturn(testFeatureDetailsList);
assertThat("Features returned should match testFeatureDetailsList features", (String) serviceBean.getAllFeatures().get(0).get("name"), is(testFeatureDetailsList.get(0).getName()));
verify(testAppService).getAllFeatures();
}
Aggregations