@Test
public void testCheckRequestShouldAppendRequestToAnExistingSequence() {

    //GIVEN
    String sequenceKeyFirst = "testKey1";
    Map<String, WilmaSequence> sequences = new ConcurrentHashMap<>();
    sequences.put(sequenceKeyFirst, sequenceFirst);
    given(sequenceEvaluator.evaluate(request, sequenceDescriptor)).willReturn(true);
    given(sequenceDescriptor.getSequences()).willReturn(sequences);
    given(handler.getExistingSequence(request, sequences, null)).willReturn(sequenceKeyFirst);
    given(sequenceDescriptor.getSequence(sequenceKeyFirst)).willReturn(sequenceFirst);
    given(request.getWilmaMessageId()).willReturn("TestLoggerId");
    given(sequenceIdUtil.createSequenceId(sequenceKeyFirst, sequenceDescriptor)).willReturn("newID");
    given(request.getSequenceId()).willReturn(null);
    given(headerUtil.createSequenceHeader(null, "newID")).willReturn("newID");
    //WHEN
    underTest.checkRequest(request, sequenceDescriptor);
    //THEN
    verify(sequenceFirst).setTimeout(Mockito.any(Timestamp.class));
    verify(sequenceFirst).addPair(Mockito.eq("TestLoggerId"), Mockito.any(RequestResponsePair.class));
    verify(request).addSequenceId("newID");
}