* Expectation: passes
*/
@Test
public void t50_cc_cachedFlag() throws Exception {
// 1: load data to cache (cid=700)
SCMessage request = new SCMessage();
request.setCacheId("700");
request.setData("cacheFor1Hour_managedData");
request.setMessageInfo(TestConstants.cacheCmd);
sessionService1.execute(request);
// 2: start cache guardian - publish 3 Appendix
SCSubscribeMessage subMsg = new SCSubscribeMessage();
subMsg.setMask(TestConstants.mask);
subMsg.setSessionInfo(TestConstants.publish3AppendixMsgCmd);
subMsg.setData("700");
guardianClient.startCacheGuardian(TestConstants.cacheGuardian1, subMsg, cacheGuardianCbk);
// 3: verify callback retrieval - 3 appendix within 10sec
cacheGuardianCbk.waitForAppendMessage(3, 10);
// 4: read data from cache and verify
SCMessage response = sessionService1.execute(request);
this.checkAppendices(response, 3);
Assert.assertTrue("cached flag wrong value", response.isCached());
SCManagedMessage managedMessage = (SCManagedMessage) response;
Assert.assertTrue("cached flag wrong value", managedMessage.getAppendixes().get(0).isCached());
Assert.assertTrue("cached flag wrong value", managedMessage.getAppendixes().get(1).isCached());
Assert.assertTrue("cached flag wrong value", managedMessage.getAppendixes().get(2).isCached());
}