作者:心忆泪痕 | 来源:互联网 | 2023-10-11 18:08
本文整理了Java中com.epam.wilma.domain.http.WilmaHttpRequest.getSequenceId()方法的一些代码示例,展示了
本文整理了Java中com.epam.wilma.domain.http.WilmaHttpRequest.getSequenceId()
方法的一些代码示例,展示了WilmaHttpRequest.getSequenceId()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WilmaHttpRequest.getSequenceId()
方法的具体详情如下:
包路径:com.epam.wilma.domain.http.WilmaHttpRequest
类名称:WilmaHttpRequest
方法名:getSequenceId
WilmaHttpRequest.getSequenceId介绍
暂无
代码示例
代码示例来源:origin: epam/Wilma
private void appendSequenceKeyToHeader(final String sequenceId, final WilmaHttpRequest request) {
String oldSource = request.getSequenceId();
String newHeaderValue = headerUtil.createSequenceHeader(oldSource, sequenceId);
request.addSequenceId(newHeaderValue);
}
}
代码示例来源:origin: epam/Wilma
@Test
public void testCheckRequestShouldAppendRequestToAnExistingSequence() {
//GIVEN
String sequenceKeyFirst = "testKey1";
Map 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");
}
代码示例来源:origin: epam/Wilma
@BeforeMethod
public void setup() {
MockitoAnnotations.initMocks(this);
given(dateProvider.getCurrentTimeInMillis()).willReturn(1000L);
given(requestCloner.cloneRequest(request)).willReturn(clonedRequest);
given(request.getSequenceId()).willReturn(null);
given(sequenceDescriptor.getGroupName()).willReturn(SEQUENCE_DESCRIPTOR_GROUPNAME);
given(sequenceDescriptor.getName()).willReturn(SEQUENCE_DESCRIPTOR_NAME);
given(sequenceDescriptorKeyUtil.createDescriptorKey(SEQUENCE_DESCRIPTOR_GROUPNAME, SEQUENCE_DESCRIPTOR_NAME)).willReturn(
SEQUENCE_DESCRIPTOR_GROUPNAME + SequenceConstants.DESCRIPTOR_KEY_PART_SEPARATOR.getConstant() + SEQUENCE_DESCRIPTOR_NAME);
given(sequenceDescriptor.getHandler()).willReturn(handler);
}
代码示例来源:origin: epam/Wilma
@Test
public void testCheckRequestShouldCreateANewSequence() {
//GIVEN
String sequenceKeyFirst = "testKey1";
String sequenceKeySecOnd= "testKey2";
Map sequences = new ConcurrentHashMap<>();
sequences.put(sequenceKeyFirst, sequenceFirst);
given(sequenceEvaluator.evaluate(request, sequenceDescriptor)).willReturn(true);
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(sequenceSecond.getSequenceKey()).willReturn(sequenceKeySecond);
given(sequenceIdUtil.createSequenceId(sequenceKeySecond, sequenceDescriptor)).willReturn("newID");
given(request.getSequenceId()).willReturn(null);
given(headerUtil.createSequenceHeader(null, "newID")).willReturn("newID");
//WHEN
underTest.checkRequest(request, sequenceDescriptor);
//THEN
verify(sequenceDescriptor).putIntoSequences(sequenceSecond);
verify(request).addSequenceId("newID");
}
代码示例来源:origin: epam/Wilma
@Test
public void testCheckRequestWhenTheMethodShouldConcatANewSequenceKeyToAnExistingHeader() {
//GIVEN
String sequenceKeyFirst = "testKey1";
String sequenceKeySecOnd= "testKey2";
Map 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");
}
}