### Question:
ConfigurationManager extends AgentService implements ContainerService, ConfigurationAgentService { public Configuration loadResourceConfiguration(int resourceId) throws PluginContainerException { ConfigManagement loadConfig = configMgmtFactory.getStrategy(resourceId); Configuration configuration; try { configuration = loadConfig.executeLoad(resourceId); } catch (Throwable t) { throw new PluginContainerException(createErrorMsg(resourceId, "An exception was thrown."), t); } if (configuration == null) { throw new PluginContainerException(createErrorMsg(resourceId, "returned a null Configuration.")); } return configuration; } ConfigurationManager(PluginContainerConfiguration configuration, ComponentService componentService,
        ConfigManagementFactory factory, AgentServiceStreamRemoter streamRemoter, InventoryManager inventoryManager); void shutdown(); void updateResourceConfiguration(ConfigurationUpdateRequest request); ConfigurationUpdateResponse executeUpdateResourceConfigurationImmediately(ConfigurationUpdateRequest request); Configuration merge(Configuration configuration, int resourceId, boolean fromStructured); Configuration loadResourceConfiguration(int resourceId); Configuration validate(Configuration configuration, int resourceId, boolean isStructured);  }### Answer:
@Test public void strategyShouldBeCalledToLoadConfig() throws Exception { final Configuration expectedConfig = new Configuration(); final ConfigManagement loadConfig = context.mock(ConfigManagement.class); context.checking(new Expectations() { { atLeast(1).of(configMgmtFactory).getStrategy(resourceId); will(returnValue(loadConfig)); atLeast(1).of(loadConfig).executeLoad(resourceId); will(returnValue(expectedConfig)); } }); Configuration actualConfig = configurationMgr.loadResourceConfiguration(resourceId); assertNotNull(actualConfig, "Expected a non-null " + Configuration.class.getSimpleName() + " to be returned."); }