@Then("^Client \"(.+)\" last message in the list \"(.+)\" is on \"(.+)\"$") public void checkLastPublishDateForClient(String clientId, String lstKey, String date) throws Exception { ClientInfoListResult cliList = (ClientInfoListResult) stepData.get(lstKey); Date tmpCaptured = KapuaDateUtils.parseDate(date); for (ClientInfo tmpInfo : cliList.getItems()) { if (tmpInfo.getClientId().equals(clientId)) { assertEquals(tmpInfo.getLastMessageOn(), tmpCaptured); return; } } fail(String.format("No client info item matches the client id [%s]", clientId)); }