Skip to content

Commit

Permalink
add ttl test
Browse files Browse the repository at this point in the history
  • Loading branch information
otaviojava committed Mar 27, 2018
1 parent 79e319f commit 29b7ec3
Showing 1 changed file with 10 additions and 2 deletions.
Expand Up @@ -26,6 +26,7 @@
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;

import java.time.Duration;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
Expand Down Expand Up @@ -64,10 +65,17 @@ public void shouldInsert() {
assertEquals(entity, documentEntity);
}

@Test
public void shouldInsertTTL() {
assertThrows(UnsupportedOperationException.class, () ->{
entityManager.insert(getEntity(), Duration.ofSeconds(1L));
});
}

@Test
public void shouldReturnAll() {
DocumentEntity entity = getEntity();
DocumentEntity documentEntity = entityManager.insert(entity);
entityManager.insert(entity);
DocumentQuery query = select().from(COLLECTION_NAME).build();
List<DocumentEntity> result = entityManager.select(query);
assertFalse(result.isEmpty());
Expand All @@ -76,7 +84,7 @@ public void shouldReturnAll() {
@Test
public void shouldUpdateSave() {
DocumentEntity entity = getEntity();
DocumentEntity documentEntity = entityManager.insert(entity);
entityManager.insert(entity);
Document newField = Documents.of("newField", "10");
entity.add(newField);
DocumentEntity updated = entityManager.update(entity);
Expand Down

0 comments on commit 29b7ec3

Please sign in to comment.