SequenceManager implements SequenceDescriptorHolder { public Map<String, WilmaSequence> getSequences(final String sequenceDescriptorName) { SequenceDescriptor descriptor = descriptors.get(sequenceDescriptorName); Map<String, WilmaSequence> result = Collections.emptyMap(); if (descriptor != null) { result = descriptor.getSequences(); } return result; }  void handleRequest(final WilmaHttpRequest request); void cleanUpDescriptors(); void addSequenceDescriptor(final String descriptorKey, final SequenceDescriptor descriptor); void removeSequenceDescriptors(final String groupName); void setStatusOfDescriptors(final String groupName, final boolean newStatus); void dropAllSequences(); void tryToSaveResponseIntoSequence(final WilmaHttpResponse response); Map<String, WilmaSequence> getSequences(final String sequenceDescriptorName); @Override void addAllSequenceDescriptors(final StubDescriptor stubDescriptor); Map<String, SequenceDescriptor> getDescriptors();  }
@Test public void testGetSequencesShouldReturnWithEmptyMap() { Map<String, SequenceDescriptor> descriptors = new ConcurrentHashMap<>(); descriptors.put("TestTeam-fistDescriptor-TestHandler", sequenceDescriptor); Whitebox.setInternalState(underTest, "descriptors", descriptors); Map<String, WilmaSequence> actual = underTest.getSequences("TestTeam"); Assert.assertEquals(actual, Collections.EMPTY_MAP); }
@Test public void testGetSequencesShouldReturnWithACollection() { Map<String, WilmaSequence> sequences = new ConcurrentHashMap<>(); sequences.put("TestKey1", sequence); Map<String, SequenceDescriptor> descriptors = new ConcurrentHashMap<>(); descriptors.put("TestTeam-fistDescriptor-TestHandler", sequenceDescriptor); Whitebox.setInternalState(underTest, "descriptors", descriptors); given(sequenceDescriptor.getSequences()).willReturn(sequences); Map<String, WilmaSequence> actual = underTest.getSequences("TestTeam-fistDescriptor-TestHandler"); Assert.assertEquals(actual, sequences); }