use of org.elasticsearch.index.AlreadyExpiredException in project elasticsearch by elastic.
the class ExceptionSerializationTests method testAlreadyExpiredException.
public void testAlreadyExpiredException() throws IOException {
AlreadyExpiredException alreadyExpiredException = serialize(new AlreadyExpiredException("index", "type", "id", 1, 2, 3));
assertEquals("index", alreadyExpiredException.getIndex().getName());
assertEquals("type", alreadyExpiredException.type());
assertEquals("id", alreadyExpiredException.id());
assertEquals(2, alreadyExpiredException.ttl());
assertEquals(1, alreadyExpiredException.timestamp());
assertEquals(3, alreadyExpiredException.now());
alreadyExpiredException = serialize(new AlreadyExpiredException(null, null, null, -1, -2, -3));
assertNull(alreadyExpiredException.getIndex());
assertNull(alreadyExpiredException.type());
assertNull(alreadyExpiredException.id());
assertEquals(-2, alreadyExpiredException.ttl());
assertEquals(-1, alreadyExpiredException.timestamp());
assertEquals(-3, alreadyExpiredException.now());
}
Aggregations