Skip to content

Commit f3b51a4

Browse files
committed
test: include test scenario to contact repository
Signed-off-by: Otavio Santana <[email protected]>
1 parent b8a7a51 commit f3b51a4

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

jnosql-oracle-nosql/src/test/java/org/eclipse/jnosql/databases/oracle/integration/OracleNoSQLTemplateIntegrationTest.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ class OracleNoSQLTemplateIntegrationTest {
5757
@Inject
5858
private OracleNoSQLTemplate template;
5959

60+
@Inject
61+
private ContactRepository contactRepository;
62+
6063
static {
6164
System.setProperty(OracleNoSQLConfigurations.HOST.get(), Database.INSTANCE.host());
6265
System.setProperty(MappingConfigurations.DOCUMENT_DATABASE.get(), "library");
@@ -154,6 +157,21 @@ void shouldFindByType(ContactType type){
154157
});
155158

156159
}
160+
161+
@ParameterizedTest
162+
@org.junit.jupiter.params.provider.EnumSource(ContactType.class)
163+
void shouldFindByTypeUsingRepository(ContactType type){
164+
var contact = new Contact(randomUUID().toString(), "Otavio Santana", type);
165+
contactRepository.save(contact);
166+
167+
List<Contact> entities = contactRepository.findByType(type);
168+
169+
SoftAssertions.assertSoftly(softly -> {
170+
softly.assertThat(entities).isNotNull();
171+
softly.assertThat(entities).allMatch(e -> e.type().equals(type));
172+
});
173+
174+
}
157175

158176

159177

0 commit comments

Comments
 (0)