@Test public void checkEarlierRecordsToTimestamps() throws Exception { thrown.expect(CodedException.class); thrown.expectMessage("Records to timestamp is earlier than records" + " from timestamp"); OperationalDataRequestHandler.checkTimestamps(10, 5, 10); }
static void checkTimestamps(long recordsFrom, long recordsTo, long recordsAvailableBefore) { if (recordsFrom < 0) { throw new CodedException(X_INVALID_REQUEST, "Records from timestamp is a negative number") .withPrefix(CLIENT_X); } if (recordsTo < 0) { throw new CodedException(X_INVALID_REQUEST, "Records to timestamp is a negative number") .withPrefix(CLIENT_X); } if (recordsTo < recordsFrom) { throw new CodedException(X_INVALID_REQUEST, "Records to timestamp is earlier than records from" + " timestamp").withPrefix(CLIENT_X); } if (recordsFrom >= recordsAvailableBefore) { throw new CodedException(X_INVALID_REQUEST, "Records not available from " + recordsFrom + " yet") .withPrefix(CLIENT_X); } }
OperationalDataRequestHandler extends QueryRequestHandler { static void checkTimestamps(long recordsFrom, long recordsTo, long recordsAvailableBefore) { if (recordsFrom < 0) { throw new CodedException(X_INVALID_REQUEST, "Records from timestamp is a negative number") .withPrefix(CLIENT_X); } if (recordsTo < 0) { throw new CodedException(X_INVALID_REQUEST, "Records to timestamp is a negative number") .withPrefix(CLIENT_X); } if (recordsTo < recordsFrom) { throw new CodedException(X_INVALID_REQUEST, "Records to timestamp is earlier than records from" + " timestamp").withPrefix(CLIENT_X); } if (recordsFrom >= recordsAvailableBefore) { throw new CodedException(X_INVALID_REQUEST, "Records not available from " + recordsFrom + " yet") .withPrefix(CLIENT_X); } } }
OperationalDataRequestHandler extends QueryRequestHandler { static void checkTimestamps(long recordsFrom, long recordsTo, long recordsAvailableBefore) { if (recordsFrom < 0) { throw new CodedException(X_INVALID_REQUEST, "Records from timestamp is a negative number") .withPrefix(CLIENT_X); } if (recordsTo < 0) { throw new CodedException(X_INVALID_REQUEST, "Records to timestamp is a negative number") .withPrefix(CLIENT_X); } if (recordsTo < recordsFrom) { throw new CodedException(X_INVALID_REQUEST, "Records to timestamp is earlier than records from" + " timestamp").withPrefix(CLIENT_X); } if (recordsFrom >= recordsAvailableBefore) { throw new CodedException(X_INVALID_REQUEST, "Records not available from " + recordsFrom + " yet") .withPrefix(CLIENT_X); } }  }
OperationalDataRequestHandler extends QueryRequestHandler { static void checkTimestamps(long recordsFrom, long recordsTo, long recordsAvailableBefore) { if (recordsFrom < 0) { throw new CodedException(X_INVALID_REQUEST, "Records from timestamp is a negative number") .withPrefix(CLIENT_X); } if (recordsTo < 0) { throw new CodedException(X_INVALID_REQUEST, "Records to timestamp is a negative number") .withPrefix(CLIENT_X); } if (recordsTo < recordsFrom) { throw new CodedException(X_INVALID_REQUEST, "Records to timestamp is earlier than records from" + " timestamp").withPrefix(CLIENT_X); } if (recordsFrom >= recordsAvailableBefore) { throw new CodedException(X_INVALID_REQUEST, "Records not available from " + recordsFrom + " yet") .withPrefix(CLIENT_X); } }  @Override void handle(SoapMessageImpl requestSoap, OutputStream out,
            Consumer<String> contentTypeCallback); }
OperationalDataRequestHandler extends QueryRequestHandler { static void checkTimestamps(long recordsFrom, long recordsTo, long recordsAvailableBefore) { if (recordsFrom < 0) { throw new CodedException(X_INVALID_REQUEST, "Records from timestamp is a negative number") .withPrefix(CLIENT_X); } if (recordsTo < 0) { throw new CodedException(X_INVALID_REQUEST, "Records to timestamp is a negative number") .withPrefix(CLIENT_X); } if (recordsTo < recordsFrom) { throw new CodedException(X_INVALID_REQUEST, "Records to timestamp is earlier than records from" + " timestamp").withPrefix(CLIENT_X); } if (recordsFrom >= recordsAvailableBefore) { throw new CodedException(X_INVALID_REQUEST, "Records not available from " + recordsFrom + " yet") .withPrefix(CLIENT_X); } }  @Override void handle(SoapMessageImpl requestSoap, OutputStream out,
            Consumer<String> contentTypeCallback);  }