### Question:
RawConfigManagement extends ConfigManagementSupport { public Configuration executeLoad(int resourceId) throws PluginContainerException { ResourceConfigurationFacet facet = loadResouceConfiguratonFacet(resourceId); Set<RawConfiguration> rawConfigs = facet.loadRawConfigurations(); if (rawConfigs == null) { return null; } Configuration config = new Configuration(); for (RawConfiguration rawConfig : rawConfigs) { config.addRawConfiguration(rawConfig); } if (config.getNotes() == null) { ResourceType resourceType = componentService.getResourceType(resourceId); config.setNotes("Resource config for " + resourceType.getName() + " Resource w/ id " + resourceId); } return config; }  Configuration executeLoad(int resourceId); void executeUpdate(int resourceId, Configuration configuration);  }### Answer:
@Test public void rawConfigsShouldGetLoaded() throws Exception { Set<RawConfiguration> rawConfigs = toSet( createRawConfiguration("/tmp/foo.txt"), createRawConfiguration("/tmp/bar.txt") ); addDefaultExpectationsForLoad(rawConfigs); Configuration loadedConfig = rawConfigMgmt.executeLoad(resourceId); assertRawsLoaded(rawConfigs, loadedConfig); }
@Test public void theConfigNotesShouldGetSet() throws Exception { final Configuration config = new Configuration(); config.setNotes(null); addDefaultExpectationsForLoad(EMPTY_SET); Configuration loadedConfig = rawConfigMgmt.executeLoad(resourceId); assertNotesSetToDefault(loadedConfig); }
@Test public void nullShouldBeReturnedWhenRawIsNull() throws Exception { Set<RawConfiguration> rawConfigs = null; addDefaultExpectationsForLoad(rawConfigs); Configuration loadedConfig = rawConfigMgmt.executeLoad(resourceId); assertNull(loadedConfig, "Expected null to be returned when facet returns null for raw."); }