Skip to content

Commit

Permalink
test: create converter scenario
Browse files Browse the repository at this point in the history
Signed-off-by: Otavio Santana <otaviopolianasantana@gmail.com>
  • Loading branch information
otaviojava committed Jun 13, 2024
1 parent 1c2a673 commit 5e18a1b
Showing 1 changed file with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -910,6 +910,21 @@ void shouldExecuteMatchParameter(){
});
}

@Test
void shouldExecuteMatchParameterId(){
personRepository.find(10L);
var captor = ArgumentCaptor.forClass(SelectQuery.class);
verify(template).select(captor.capture());
SelectQuery query = captor.getValue();
SoftAssertions.assertSoftly(softly -> {
softly.assertThat(query.name()).isEqualTo("Person");
var condition = query.condition().orElseThrow();
softly.assertThat(condition.condition()).isEqualTo(Condition.EQUALS);
softly.assertThat(condition.element()).isEqualTo(Element.of("_id", 10L));
softly.assertThat(query.sorts()).hasSize(1).contains(Sort.asc("_id"));
});
}

@Test
void shouldExecuteMatchParameter2(){
personRepository.find2("Ada");
Expand Down Expand Up @@ -1051,6 +1066,11 @@ default Map<Boolean, List<Person>> partcionate(String name) {
@OrderBy("age")
List<Person> findByException();

@OrderBy("id")
@Find
List<Person> find(@By("id") Long id);


@Find
List<Person> find(@By("name") String name);

Expand Down

0 comments on commit 5e18a1b

Please sign in to comment.