@Test public void testGetCodenvyPropertiesShouldReturnErrorResponse() throws Exception { doThrow(new IOException("error")).when(configManager).loadInstalledCodenvyConfig(); Response response = service.getCodenvyProperties(); assertEquals(response.getStatus(), Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()); }
@Test public void testGetCodenvyPropertiesShouldReturnOkResponse() throws Exception { Config testConfig = new Config(ImmutableMap.of("a", "b", "password", "c")); doReturn(testConfig).when(configManager).loadInstalledCodenvyConfig(); Response response = service.getCodenvyProperties(); assertEquals(response.getStatus(), Response.Status.OK.getStatusCode()); assertEquals(response.getEntity().toString(), "{a=b, password=*****}"); }