Skip to content

Commit

Permalink
refactoring bytes contents
Browse files Browse the repository at this point in the history
  • Loading branch information
otaviojava committed May 28, 2020
1 parent ea2c756 commit 5c29051
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Expand Up @@ -405,7 +405,7 @@ public void shouldConvertEntityToDocumentWithArray() {

Download download = converter.toEntity(entity);
Assertions.assertEquals(1L, download.getId());
Assertions.assertEquals(contents, download.getContents());
Assertions.assertArrayEquals(contents, download.getContents());
}

@Test
Expand All @@ -420,7 +420,8 @@ public void shouldConvertDocumentToEntityWithArray() {


Assertions.assertEquals(1L, entity.find("_id").get().get());
Assertions.assertEquals(contents, entity.find("contents").get().get());
final byte[] bytes = entity.find("contents").map(v -> v.get(byte[].class)).orElse(new byte[0]);
Assertions.assertArrayEquals(contents, bytes);
}

private Object getValue(Optional<Column> column) {
Expand Down
Expand Up @@ -424,7 +424,7 @@ public void shouldConvertDocumentToEntityWithArray() {


Assertions.assertEquals(1L, entity.find("_id").get().get());
final byte[] bytes = entity.find("contents").get().get(byte[].class);
final byte[] bytes = entity.find("contents").map(v -> v.get(byte[].class)).orElse(new byte[0]);
Assertions.assertArrayEquals(contents, bytes);
}

Expand Down

0 comments on commit 5c29051

Please sign in to comment.