Skip to content

Commit 1eac46f

Browse files
committed
Simplify methods in mongodb
Signed-off-by: Otavio Santana <[email protected]>
1 parent 59a6ed6 commit 1eac46f

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

mongodb-driver/src/main/java/org/eclipse/jnosql/communication/mongodb/document/MongoDBDocumentCollectionManagerFactory.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,7 @@ public void close() {
4242

4343
@Override
4444
public String toString() {
45-
final StringBuilder sb = new StringBuilder("MongoDBDocumentCollectionManagerFactory{");
46-
sb.append("mongoClient=").append(mongoClient);
47-
sb.append('}');
48-
return sb.toString();
45+
return "MongoDBDocumentCollectionManagerFactory{" + "mongoClient=" + mongoClient +
46+
'}';
4947
}
5048
}

mongodb-driver/src/main/java/org/eclipse/jnosql/communication/mongodb/document/MongoDBUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ private MongoDBUtils() {
4343

4444
static Document getDocument(DocumentEntity entity) {
4545
Document document = new Document();
46-
entity.getDocuments().stream().forEach(d -> document.append(d.getName(), convert(d.getValue())));
46+
entity.getDocuments().forEach(d -> document.append(d.getName(), convert(d.getValue())));
4747
return document;
4848
}
4949

mongodb-driver/src/test/java/org/eclipse/jnosql/communication/mongodb/document/MongoDBDocumentCollectionManagerTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public void shouldRemoveEntity() {
9494
.build();
9595

9696
entityManager.delete(deleteQuery);
97-
assertTrue(entityManager.select(query).collect(Collectors.toList()).isEmpty());
97+
assertTrue(entityManager.select(query).count() == 0);
9898
}
9999

100100
@Test

0 commit comments

Comments
 (0)