@Test public void testDropShouldRemoveTheSelectedStubConfiguration() { Map<String, StubDescriptor> expected = normalStubDescriptors; expected.remove(GROUPNAME_FIRST); underTest = new DropCommand(GROUPNAME_FIRST, request, urlAccessLogMessageAssembler); Map<String, StubDescriptor> result = underTest.modify(normalStubDescriptors); Assert.assertEquals(result, expected); }
@Override public Map<String, StubDescriptor> modify(final Map<String, StubDescriptor> stubDescriptors) { Map<String, StubDescriptor> updated = new LinkedHashMap<>(stubDescriptors); StubDescriptor removed = updated.remove(groupName); if (removed != null) { logger.info(urlAccessLogMessageAssembler.assembleMessage(request, groupName + "'s stub configuration has been deleted.")); } return updated; }
DropCommand implements StubDescriptorModificationCommand { @Override public Map<String, StubDescriptor> modify(final Map<String, StubDescriptor> stubDescriptors) { Map<String, StubDescriptor> updated = new LinkedHashMap<>(stubDescriptors); StubDescriptor removed = updated.remove(groupName); if (removed != null) { logger.info(urlAccessLogMessageAssembler.assembleMessage(request, groupName + "'s stub configuration has been deleted.")); } return updated; } }
DropCommand implements StubDescriptorModificationCommand { @Override public Map<String, StubDescriptor> modify(final Map<String, StubDescriptor> stubDescriptors) { Map<String, StubDescriptor> updated = new LinkedHashMap<>(stubDescriptors); StubDescriptor removed = updated.remove(groupName); if (removed != null) { logger.info(urlAccessLogMessageAssembler.assembleMessage(request, groupName + "'s stub configuration has been deleted.")); } return updated; } DropCommand(final String groupName, final HttpServletRequest request, final UrlAccessLogMessageAssembler urlAccessLogMessageAssembler); }
DropCommand implements StubDescriptorModificationCommand { @Override public Map<String, StubDescriptor> modify(final Map<String, StubDescriptor> stubDescriptors) { Map<String, StubDescriptor> updated = new LinkedHashMap<>(stubDescriptors); StubDescriptor removed = updated.remove(groupName); if (removed != null) { logger.info(urlAccessLogMessageAssembler.assembleMessage(request, groupName + "'s stub configuration has been deleted.")); } return updated; } DropCommand(final String groupName, final HttpServletRequest request, final UrlAccessLogMessageAssembler urlAccessLogMessageAssembler); @Override Map<String, StubDescriptor> modify(final Map<String, StubDescriptor> stubDescriptors); String getGroupName(); HttpServletRequest getRequest(); }
DropCommand implements StubDescriptorModificationCommand { @Override public Map<String, StubDescriptor> modify(final Map<String, StubDescriptor> stubDescriptors) { Map<String, StubDescriptor> updated = new LinkedHashMap<>(stubDescriptors); StubDescriptor removed = updated.remove(groupName); if (removed != null) { logger.info(urlAccessLogMessageAssembler.assembleMessage(request, groupName + "'s stub configuration has been deleted.")); } return updated; } DropCommand(final String groupName, final HttpServletRequest request, final UrlAccessLogMessageAssembler urlAccessLogMessageAssembler); @Override Map<String, StubDescriptor> modify(final Map<String, StubDescriptor> stubDescriptors); String getGroupName(); HttpServletRequest getRequest();  }