use of com.axibase.tsd.api.method.checks.MessageQuerySizeCheck in project atsd-api-test by axibase.
the class MessageInsertTest method testTimeRangeMaxTimeSaved.
@Issue("2957")
@Test
public void testTimeRangeMaxTimeSaved() {
Message message = new Message("e-time-range-msg-3");
message.setMessage("msg-time-range-msg-3");
message.setDate(MAX_STORABLE_DATE);
MessageQuery messageQuery = new MessageQuery();
messageQuery.setEntity(message.getEntity());
messageQuery.setStartDate(MIN_QUERYABLE_DATE);
messageQuery.setEndDate(MAX_QUERYABLE_DATE);
insertMessageCheck(message, new MessageQuerySizeCheck(messageQuery, 1));
List<Message> storedMessageList = queryMessageResponse(messageQuery).readEntity(ResponseAsList.ofMessages());
Message msgResponse = storedMessageList.get(0);
assertEquals("Max storable date failed to save", message.getDate(), msgResponse.getDate());
assertEquals("Incorrect stored message", message.getMessage(), msgResponse.getMessage());
}
use of com.axibase.tsd.api.method.checks.MessageQuerySizeCheck in project atsd-api-test by axibase.
the class MessageInsertTest method testISOTimezoneZ.
@Issue("2850")
@Test
public void testISOTimezoneZ() {
String entityName = "message-insert-test-isoz";
Message message = new Message(entityName);
message.setMessage("hello");
message.setDate("2018-05-21T00:00:00Z");
String date = "2018-05-21T00:00:00.000Z";
MessageQuery messageQuery = new MessageQuery();
messageQuery.setEntity(entityName);
messageQuery.setStartDate(date);
messageQuery.setInterval(new Period(1, TimeUnit.MILLISECOND));
MessageMethod.insertMessageCheck(message, new MessageQuerySizeCheck(messageQuery, 1));
List<Message> storedMessageList = queryMessageResponse(messageQuery).readEntity(ResponseAsList.ofMessages());
Message storedMessage = storedMessageList.get(0);
assertEquals("Incorrect message entity", message.getEntity(), storedMessage.getEntity());
assertEquals("Incorrect message text", message.getMessage(), storedMessage.getMessage());
assertEquals("Incorrect message date", date, storedMessage.getDate());
}
Aggregations