JUnit Test NOSQL
来源:互联网 发布:万得金融终端mac版 编辑:程序博客网 时间:2024/06/08 08:17
@Test
@UsingDataSet(locations = {
"/test_data/input_data/OrchestrationServiceImplTest_eventListenerTestForOFOEventOfSeries.json" }, loadStrategy = LoadStrategyEnum.CLEAN_INSERT)
@ShouldMatchDataSet(location = "/test_data/expected_data/OrchestrationServiceImplTest_eventListenerTestForOFOEventOfSeries.json")
@IgnorePropertyValue(properties = { "_id", "createdBy", "createdDate", "modifiedBy", "modifiedDate","offeringId","offeringType" })
public void eventListenerTestForOFOEventOfSeries() {
// setup input
EventMessage eventMessage = new EventMessage();
Map<String, Object> map = new HashMap<String, Object>();
map.put("entityGroup", "OFO");
map.put("entityName", "series");
map.put("entityId", "urn:esp:hbo:series:1c5d35d2e45e26238d4e0560b816a057");
map.put("service", "HBO");
map.put("offeringType", "series");
map.put("offeringId", "urn:esp:offering:program:abc123");
eventMessage.setHeaders(map);
String payload = "{"
+ " \"_id\": \"urn:woodmark:nls:seriesoffering:84B0461471264F9FB260ADC8747FD2E6\", "
+ " \"channelId\": \"urn:woodmark:blueprint:HBOGO\", "
+ " \"faaId\": \"urn:esp:hbo:series:1c5d35d2e45e26238d4e0560b816a057\", "
+ " \"startDate\": \"2004-07-18T00:00:000.000Z\", "
+ " \"endDate\": \"2004-08-18T00:00:000.000Z\", "
+ " \"offeringType\": \"SERIES\", "
+ " \"images\": [ "
+ " { "
+ " \"faaid\": \"image FAA id 1\", "
+ " \"did\": \"12345\", "
+ " \"role\": \"SubPhoto17\" "
+ " }, "
+ " { "
+ " \"faaid\": \"image FAA id 2\", "
+ " \"did\": \"23456\", "
+ " \"role\": \"SubPhoto15\" "
+ " }, "
+ " { "
+ " \"faaid\": \"image FAA id 3\", "
+ " \"did\": \"34567\", "
+ " \"role\": \"SubPhoto3\" "
+ " } "
+ " ], "
+ " \"status\": \"PUBLISHED\", "
+ " \"lastPublishedDate\": \"2004-08-18T00:00:000.000Z\", "
+ " \"namespace\": \"hbous\", "
+ " \"namespaceId\": \"SERS123\", "
+ " \"schedulerOfferingId\": \"SERS2763-PMRS1D100031\" "
+ " } ";
eventMessage.setPayload(null);
Map<String, Object> orcaEvent = CommonUtils.convertPojoToMap(eventMessage);
if (logger.isDebugEnabled()) {
logger.debug("The orcaEvent is [" + orcaEvent + "]");
}
try {
String result = orchestrationService.eventListener(orcaEvent);
List<DeliveryRecord> list = mongoTemplate.findAll(DeliveryRecord.class);
Assert.assertEquals(Constants.OUTPUT_SUCESS, result);
} catch (Exception e) {
e.printStackTrace();
Assert.assertNull("Got exception", e);
}
}
@UsingDataSet(locations = {
"/test_data/input_data/OrchestrationServiceImplTest_eventListenerTestForOFOEventOfSeries.json" }, loadStrategy = LoadStrategyEnum.CLEAN_INSERT)
@ShouldMatchDataSet(location = "/test_data/expected_data/OrchestrationServiceImplTest_eventListenerTestForOFOEventOfSeries.json")
@IgnorePropertyValue(properties = { "_id", "createdBy", "createdDate", "modifiedBy", "modifiedDate","offeringId","offeringType" })
public void eventListenerTestForOFOEventOfSeries() {
// setup input
EventMessage eventMessage = new EventMessage();
Map<String, Object> map = new HashMap<String, Object>();
map.put("entityGroup", "OFO");
map.put("entityName", "series");
map.put("entityId", "urn:esp:hbo:series:1c5d35d2e45e26238d4e0560b816a057");
map.put("service", "HBO");
map.put("offeringType", "series");
map.put("offeringId", "urn:esp:offering:program:abc123");
eventMessage.setHeaders(map);
String payload = "{"
+ " \"_id\": \"urn:woodmark:nls:seriesoffering:84B0461471264F9FB260ADC8747FD2E6\", "
+ " \"channelId\": \"urn:woodmark:blueprint:HBOGO\", "
+ " \"faaId\": \"urn:esp:hbo:series:1c5d35d2e45e26238d4e0560b816a057\", "
+ " \"startDate\": \"2004-07-18T00:00:000.000Z\", "
+ " \"endDate\": \"2004-08-18T00:00:000.000Z\", "
+ " \"offeringType\": \"SERIES\", "
+ " \"images\": [ "
+ " { "
+ " \"faaid\": \"image FAA id 1\", "
+ " \"did\": \"12345\", "
+ " \"role\": \"SubPhoto17\" "
+ " }, "
+ " { "
+ " \"faaid\": \"image FAA id 2\", "
+ " \"did\": \"23456\", "
+ " \"role\": \"SubPhoto15\" "
+ " }, "
+ " { "
+ " \"faaid\": \"image FAA id 3\", "
+ " \"did\": \"34567\", "
+ " \"role\": \"SubPhoto3\" "
+ " } "
+ " ], "
+ " \"status\": \"PUBLISHED\", "
+ " \"lastPublishedDate\": \"2004-08-18T00:00:000.000Z\", "
+ " \"namespace\": \"hbous\", "
+ " \"namespaceId\": \"SERS123\", "
+ " \"schedulerOfferingId\": \"SERS2763-PMRS1D100031\" "
+ " } ";
eventMessage.setPayload(null);
Map<String, Object> orcaEvent = CommonUtils.convertPojoToMap(eventMessage);
if (logger.isDebugEnabled()) {
logger.debug("The orcaEvent is [" + orcaEvent + "]");
}
try {
String result = orchestrationService.eventListener(orcaEvent);
List<DeliveryRecord> list = mongoTemplate.findAll(DeliveryRecord.class);
Assert.assertEquals(Constants.OUTPUT_SUCESS, result);
} catch (Exception e) {
e.printStackTrace();
Assert.assertNull("Got exception", e);
}
}
0 0
- JUnit Test NOSQL
- junit test
- junit test
- junit-test
- junit @Test
- Junit 4 test suit
- android junit test问题
- Junit test EJB3
- JUnit test with Memcached
- android junit test问题
- junit test application代码
- android junit test
- Android JUnit Test
- Junit Test problem
- JUnit test suite 结构
- JUnit多线程Test
- JUnit Test WebService
- Android Junit Test Process
- 1028. List Sorting (25)
- 批处理添加右键菜单项
- Growth iOS 1.0版 发布——社区功能:更好的学习气氛
- NodeJS Express 视图查找逻辑
- POJ 2641 Billiard(计算几何)
- JUnit Test NOSQL
- hdu1513Palindrome【最长公共子序列&滚动数组】
- 快速幂的学习
- Light OJ 1140 How Many Zeroes? (数位DP)
- 反向输入字符串--经典递归
- hdu1503Advanced Fruits【最长公共子序列】
- 第一天,First Blood
- 处理把BOOL值存入NSMutableDictionary,从NSMutableDictionary中取出BOOL值
- hdu4268 Alice and Bob(贪心)