ConfigurationEntryRestController extends HerdBaseController { @RequestMapping(value = CONFIGURATION_ENTRIES_URI_PREFIX, method = RequestMethod.GET) @Secured(SecurityFunctions.FN_CONFIGURATION_ENTRIES_ALL_GET) public ConfigurationEntryKeys getConfigurationEntries() { return configurationEntryService.getConfigurationEntries(); }  @RequestMapping(value = CONFIGURATION_ENTRIES_URI_PREFIX + "/{configurationEntryKey}", method = RequestMethod.GET) @Secured(SecurityFunctions.FN_CONFIGURATION_ENTRIES_GET) ConfigurationEntry getConfigurationEntry(@PathVariable("configurationEntryKey") String configurationEntryKey); @RequestMapping(value = CONFIGURATION_ENTRIES_URI_PREFIX, method = RequestMethod.GET) @Secured(SecurityFunctions.FN_CONFIGURATION_ENTRIES_ALL_GET) ConfigurationEntryKeys getConfigurationEntries(); static final String CONFIGURATION_ENTRIES_URI_PREFIX; }
@Test public void testGetConfigurationEntries() { String configurationEntryKey1 = "KEY1"; String configurationEntryKey2 = "KEY2"; String configurationEntryKey3 = "KEY3"; ConfigurationEntryKeys configurationEntryKeys = new ConfigurationEntryKeys(Arrays.asList(configurationEntryKey1, configurationEntryKey2, configurationEntryKey3)); when(configurationEntryService.getConfigurationEntries()).thenReturn(configurationEntryKeys); ConfigurationEntryKeys response = configurationEntryRestController.getConfigurationEntries(); verify(configurationEntryService).getConfigurationEntries(); assertEquals("Response not equal to expected configuration entry keys response.", configurationEntryKeys, response); }