ConfigurationManagerImpl implements ConfigurationManager { @Override public <T> T getParameter(final ConfigurationParameter<T> parameter) { return configurationDao.getParameter(parameter); } @Inject  ConfigurationManagerImpl(ConfigurationDao configurationDao); @Override List<ConfigurationNode> getNodes(final RootNode rootNode); @Override ConfigurationNode getNode(final RootNode rootNode, final String nodeId); @Override Optional<ConfigurationNode> findNode(final RootNode rootNode, final String excludedNodeId, final String label, final String path); @Override boolean addNode(final RootNode rootNode, final ConfigurationNode node); @Override Optional<ConfigurationNode> editNode(final RootNode rootNode, final String nodeId, final String label, final String path); @Override void save(); @Override ConfigurationNode removeNode(final String nodeId, final RootNode rootNode); @Override T getParameter(final ConfigurationParameter<T> parameter); @Override void setParameter(final ConfigurationParameter<T> parameter, final T value);  }
@Test public void testGetParameter() { ConfigurationDao configurationDao = createMock(ConfigurationDao.class); Integer port = 8085; expect(configurationDao.getParameter(eq(ConfigurationParameter.HTTP_SERVER_PORT))).andReturn(port); replay(configurationDao); ConfigurationManager configurationManager = new ConfigurationManagerImpl(configurationDao); Integer result = configurationManager.getParameter(ConfigurationParameter.HTTP_SERVER_PORT); verify(configurationDao); assertEquals(result, port); }