Skip to content

Commit a759bf3

Browse files
otaviojavadearrudam
authored andcommitted
feat: enhance code with method reference
Signed-off-by: Otavio Santana <[email protected]>
1 parent 0085225 commit a759bf3

File tree

3 files changed

+15
-27
lines changed

3 files changed

+15
-27
lines changed

jnosql-dynamodb/src/test/java/org/eclipse/jnosql/databases/dynamodb/communication/DefaultDynamoDBDatabaseManagerFactoryTest.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,7 @@ void tearDown() {
4646
@Test
4747
void shouldCreateDocumentManager() {
4848
var documentManager = databaseManagerFactory.apply("anydatabase");
49-
assertSoftly(softly -> {
50-
softly.assertThat(documentManager).isNotNull();
51-
});
49+
assertSoftly(softly -> softly.assertThat(documentManager).isNotNull());
5250
}
5351

5452
}

jnosql-dynamodb/src/test/java/org/eclipse/jnosql/databases/dynamodb/communication/DefaultDynamoDBDatabaseManagerTest.java

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -431,22 +431,16 @@ void shouldExecutePartiQL() {
431431

432432
if (manager instanceof DynamoDBDatabaseManager partiManager) {
433433

434-
assertSoftly(softly -> {
435-
softly.assertThat(partiManager.partiQL("SELECT * FROM " + entity1.name()))
436-
.as("the returned count number of items from a given DocumentQuery is incorrect")
437-
.hasSize(3);
438-
439-
});
440-
441-
assertSoftly(softly -> {
442-
softly.assertThat(partiManager.partiQL("""
443-
SELECT * FROM %s WHERE %s = ?
444-
""".formatted(entity1.name(), ID),
445-
entity1.find(ID).orElseThrow().get()))
446-
.as("the returned count number of items from a given DocumentQuery is incorrect")
447-
.hasSize(1);
434+
assertSoftly(softly -> softly.assertThat(partiManager.partiQL("SELECT * FROM " + entity1.name()))
435+
.as("the returned count number of items from a given DocumentQuery is incorrect")
436+
.hasSize(3));
448437

449-
});
438+
assertSoftly(softly -> softly.assertThat(partiManager.partiQL("""
439+
SELECT * FROM %s WHERE %s = ?
440+
""".formatted(entity1.name(), ID),
441+
entity1.find(ID).orElseThrow().get()))
442+
.as("the returned count number of items from a given DocumentQuery is incorrect")
443+
.hasSize(1));
450444
}
451445
}
452446
}

jnosql-mongodb/src/test/java/org/eclipse/jnosql/databases/mongodb/integration/RepositoryIntegrationTest.java

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -170,14 +170,10 @@ public void testQueryWithNot() {
170170

171171
var abcdfo = characters.getABCDFO();
172172

173-
assertSoftly(softly -> {
174-
175-
softly.assertThat(abcdfo)
176-
.as("should return a non null reference")
177-
.isNotNull()
178-
.as("Should return the characters 'A', 'B', 'C', 'D', 'F', and 'O'")
179-
.contains('A', 'B', 'C', 'D', 'F', 'O');
180-
181-
});
173+
assertSoftly(softly -> softly.assertThat(abcdfo)
174+
.as("should return a non null reference")
175+
.isNotNull()
176+
.as("Should return the characters 'A', 'B', 'C', 'D', 'F', and 'O'")
177+
.contains('A', 'B', 'C', 'D', 'F', 'O'));
182178
}
183179
}

0 commit comments

Comments
 (0)