private void isChannelForFirstMessageInStoreOK(StorableId msgId, Date storedOn) throws KapuaException {
KapuaId tmpAccId = ((Account) stepData.get("LastAccount")).getId();
String tmpClId = ((Device) stepData.get("LastDevice")).getClientId();
AndPredicate andPredicate = new AndPredicateImpl();
andPredicate.getPredicates().add(new TermPredicateImpl(ChannelInfoField.CLIENT_ID, tmpClId));
ChannelInfoQuery channelInfoQuery = DatastoreQueryFactory.createBaseChannelInfoQuery(tmpAccId, 100);
channelInfoQuery.setPredicate(andPredicate);
channelInfoQuery.addFetchAttributes(ChannelInfoField.TIMESTAMP.field());
ChannelInfoListResult channelInfoList = channelInfoRegistryService.query(channelInfoQuery);
assertNotNull("Cannot find the channel info registry!", channelInfoList);
assertNotEquals("Cannot find the channel info registry!", channelInfoList.getSize(), 0);
assertNotNull("Cannot find the channel info registry!", channelInfoList.getFirstItem());
assertEquals("Wrong channel info message id!", channelInfoList.getFirstItem().getFirstMessageId(), msgId);
assertEquals("Wrong channel info message on!", channelInfoList.getFirstItem().getFirstMessageOn(), storedOn);
}