### Question:
CloudAppConfigurationService { public Optional<CloudAppConfiguration> load(final String appName) { return Optional.fromNullable(CloudAppConfigurationGsonFactory.fromJson(regCenter.get(CloudAppConfigurationNode.getRootNodePath(appName)))); }  void add(final CloudAppConfiguration appConfig); void update(final CloudAppConfiguration appConfig); Optional<CloudAppConfiguration> load(final String appName); Collection<CloudAppConfiguration> loadAll(); void remove(final String appName);  }### Answer:
@Test public void assertLoadWithoutConfig() { Optional<CloudAppConfiguration> actual = configService.load("test_app"); Assert.assertFalse(actual.isPresent()); }
@Test public void assertLoadWithConfig() { Mockito.when(regCenter.get("/config/app/test_app")).thenReturn(CloudAppJsonConstants.getAppJson("test_app")); Optional<CloudAppConfiguration> actual = configService.load("test_app"); Assert.assertTrue(actual.isPresent()); Assert.assertThat(actual.get().getAppName(), Is.is("test_app")); }