@Test public void testModifyShouldAddSequenceDescriptorsToSequenceDescriptorHolder() { underTest = new NewStubDescriptorCommand(inputStream, stubConfigurationJsonBuilder, sequenceDescriptorHolder); underTest.modify(normalStubDescriptors); verify(sequenceDescriptorHolder).addAllSequenceDescriptors(stubDescriptor); }
@Override public Map<String, StubDescriptor> modify(final Map<String, StubDescriptor> stubDescriptors) { Map<String, StubDescriptor> updated = new LinkedHashMap<>(stubDescriptors); StubDescriptor stubDescriptor = stubConfigurationJsonBuilder.buildStubDescriptor(inputStream); StubDescriptorAttributes attributes = stubDescriptor.getAttributes(); String groupName = attributes.getGroupName(); sequenceDescriptorHolder.addAllSequenceDescriptors(stubDescriptor); updated.put(groupName, stubDescriptor); if (!attributes.isValid()) { updated.remove(groupName); } return updated; }
NewStubDescriptorCommand implements StubDescriptorModificationCommand { @Override public Map<String, StubDescriptor> modify(final Map<String, StubDescriptor> stubDescriptors) { Map<String, StubDescriptor> updated = new LinkedHashMap<>(stubDescriptors); StubDescriptor stubDescriptor = stubConfigurationJsonBuilder.buildStubDescriptor(inputStream); StubDescriptorAttributes attributes = stubDescriptor.getAttributes(); String groupName = attributes.getGroupName(); sequenceDescriptorHolder.addAllSequenceDescriptors(stubDescriptor); updated.put(groupName, stubDescriptor); if (!attributes.isValid()) { updated.remove(groupName); } return updated; } }
NewStubDescriptorCommand implements StubDescriptorModificationCommand { @Override public Map<String, StubDescriptor> modify(final Map<String, StubDescriptor> stubDescriptors) { Map<String, StubDescriptor> updated = new LinkedHashMap<>(stubDescriptors); StubDescriptor stubDescriptor = stubConfigurationJsonBuilder.buildStubDescriptor(inputStream); StubDescriptorAttributes attributes = stubDescriptor.getAttributes(); String groupName = attributes.getGroupName(); sequenceDescriptorHolder.addAllSequenceDescriptors(stubDescriptor); updated.put(groupName, stubDescriptor); if (!attributes.isValid()) { updated.remove(groupName); } return updated; } NewStubDescriptorCommand(final InputStream inputStream, final StubDescriptorJsonFactory stubConfigurationJsonBuilder,
                                    final SequenceDescriptorHolder sequenceDescriptorHolder); }
NewStubDescriptorCommand implements StubDescriptorModificationCommand { @Override public Map<String, StubDescriptor> modify(final Map<String, StubDescriptor> stubDescriptors) { Map<String, StubDescriptor> updated = new LinkedHashMap<>(stubDescriptors); StubDescriptor stubDescriptor = stubConfigurationJsonBuilder.buildStubDescriptor(inputStream); StubDescriptorAttributes attributes = stubDescriptor.getAttributes(); String groupName = attributes.getGroupName(); sequenceDescriptorHolder.addAllSequenceDescriptors(stubDescriptor); updated.put(groupName, stubDescriptor); if (!attributes.isValid()) { updated.remove(groupName); } return updated; } NewStubDescriptorCommand(final InputStream inputStream, final StubDescriptorJsonFactory stubConfigurationJsonBuilder,
                                    final SequenceDescriptorHolder sequenceDescriptorHolder); @Override Map<String, StubDescriptor> modify(final Map<String, StubDescriptor> stubDescriptors); }
NewStubDescriptorCommand implements StubDescriptorModificationCommand { @Override public Map<String, StubDescriptor> modify(final Map<String, StubDescriptor> stubDescriptors) { Map<String, StubDescriptor> updated = new LinkedHashMap<>(stubDescriptors); StubDescriptor stubDescriptor = stubConfigurationJsonBuilder.buildStubDescriptor(inputStream); StubDescriptorAttributes attributes = stubDescriptor.getAttributes(); String groupName = attributes.getGroupName(); sequenceDescriptorHolder.addAllSequenceDescriptors(stubDescriptor); updated.put(groupName, stubDescriptor); if (!attributes.isValid()) { updated.remove(groupName); } return updated; } NewStubDescriptorCommand(final InputStream inputStream, final StubDescriptorJsonFactory stubConfigurationJsonBuilder,
                                    final SequenceDescriptorHolder sequenceDescriptorHolder); @Override Map<String, StubDescriptor> modify(final Map<String, StubDescriptor> stubDescriptors);  }