@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);
}
}
JUnit Test NOSQL
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章
JUnit Test WebService
yuantanglin
2018-08-27 17:27:21
24小時熱門文章
-
再談23種設計模式(3):行爲型模式(學習筆記)
-
Power Automate Desktop 安裝完,登錄後老是提示one driver 錯誤
-
微前端學習筆記(4):從微前端到微模塊之EMP與hel-micro方案探索
-
微前端學習筆記(1):微前端總體架構概述,從微服務發微
-
985 碩士程序員,空窗 4 個月沒有 Offer!
-
一文搞懂 Spring 循環依賴
-
賽博鬥地主——使用大語言模型扮演Agent智能體玩牌類遊戲。
-
VScode右鍵打開(添加到右鍵)
-
記一次 .NET某工控視覺自動化系統 卡死分析
-
WindowsServer--SQL Server搭建主從同步實現讀寫分離 - 事務性分發