热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

com.epam.wilma.domain.http.WilmaHttpRequest.getSequenceId()方法的使用及代码示例

本文整理了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");
}
}

推荐阅读
author-avatar
心忆泪痕
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有