Skip to content

Commit

Permalink
feat: update and enhance lambda jakarta data provier
Browse files Browse the repository at this point in the history
Signed-off-by: Otavio Santana <[email protected]>
  • Loading branch information
otaviojava committed Jan 1, 2025
1 parent cec7c01 commit 4d0a101
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,7 @@ void shouldKeepEntityFromParameter(String query) {
@ParameterizedTest(name = "Should parser the query {0}")
@ValueSource(strings = {"", " "})
void shouldReturnErrorWhenEntityIsMissing(String query) {
Assertions.assertThrows(IllegalArgumentException.class, () -> {
selectProvider.apply(query, null);
});
Assertions.assertThrows(IllegalArgumentException.class, () -> selectProvider.apply(query, null));
}


Expand Down Expand Up @@ -533,9 +531,7 @@ void shouldUseNotEqualsCombined(String query) {
@ParameterizedTest(name = "Should parser the query {0}")
@ValueSource(strings = "Select id Where isOdd = true and (id = :id or id < :exclusiveMax) Order by id Desc")
void shouldReturnErrorWhenUseParenthesis(String query) {
Assertions.assertThrows(UnsupportedOperationException.class, () -> {
selectProvider.apply(query, "entity");
});
Assertions.assertThrows(UnsupportedOperationException.class, () -> selectProvider.apply(query, "entity"));
}

@ParameterizedTest(name = "Should parser the query {0}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,7 @@ void shouldInvokeExecuteFind() throws Throwable {
void shouldInvokeThrowsMappingException() throws Throwable {
Method method = TestRepository.class.getMethod("customMethod");

assertThrows(UnsupportedOperationException.class, () -> {
proxy.invoke(proxy, method, new Object[]{});
});
assertThrows(UnsupportedOperationException.class, () -> proxy.invoke(proxy, method, new Object[]{}));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -472,9 +472,7 @@ void shouldCountFromEntityClass() {
var captor = ArgumentCaptor.forClass(SelectQuery.class);
verify(managerMock).count(captor.capture());
var query = captor.getValue();
SoftAssertions.assertSoftly(soft -> {
soft.assertThat(query.condition()).isEmpty();
});
SoftAssertions.assertSoftly(soft -> soft.assertThat(query.condition()).isEmpty());
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -626,9 +626,7 @@ public void shouldFindByNameOrderByName() {
CursoredPage<Person> page = personRepository.findByNameOrderByName("name",
PageRequest.afterCursor(PageRequest.Cursor.forKey("Ada"), 1, 10, false));

SoftAssertions.assertSoftly(s -> {
s.assertThat(page).isEqualTo(mock);
});
SoftAssertions.assertSoftly(s -> s.assertThat(page).isEqualTo(mock));
}

@Test
Expand Down

0 comments on commit 4d0a101

Please sign in to comment.