@Test
public void testCheckRequestWhenTheMethodShouldConcatANewSequenceKeyToAnExistingHeader() {

    //GIVEN
    String sequenceKeyFirst = "testKey1";
    String sequenceKeySecond = "testKey2";
    Map<String, WilmaSequence> sequences = new ConcurrentHashMap<>();
    sequences.put(sequenceKeyFirst, sequenceFirst);
    given(sequenceEvaluator.evaluate(request, sequenceDescriptor)).willReturn(true);
    given(sequenceDescriptor.getHandler()).willReturn(handler);
    given(handler.getExistingSequence(request, sequences, null)).willReturn(null);
    given(handler.generateNewSequenceKey(request, null)).willReturn(sequenceKeySecond);
    given(sequenceDescriptor.getDefaultTimeout()).willReturn(1000L);
    given(sequenceFactory.createNewSequence(sequenceKeySecond, request, 1000L)).willReturn(sequenceSecond);
    given(sequenceIdUtil.createSequenceId(sequenceKeySecond, sequenceDescriptor)).willReturn("newID");
    given(request.getSequenceId()).willReturn(sequenceKeyFirst);
    given(headerUtil.createSequenceHeader(sequenceKeyFirst, "newID")).willReturn("TwoKey");
    //WHEN
    underTest.checkRequest(request, sequenceDescriptor);
    //THEN
    verify(sequenceDescriptor).putIntoSequences(sequenceSecond);
    verify(request).addSequenceId("TwoKey");
}