Skip to content

Commit

Permalink
test: create method by query at ordinal
Browse files Browse the repository at this point in the history
Signed-off-by: Otavio Santana <[email protected]>
  • Loading branch information
otaviojava committed Sep 1, 2024
1 parent 5ac0745 commit 4681cb4
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

import jakarta.data.Direction;
import jakarta.data.Sort;
import org.assertj.core.api.SoftAssertions;
import org.eclipse.jnosql.communication.Condition;
import org.eclipse.jnosql.communication.query.BooleanQueryValue;
import org.eclipse.jnosql.communication.query.ConditionQueryValue;
Expand Down Expand Up @@ -573,8 +574,17 @@ void shouldReturnUnsupportedOperationExceptionQueryWithNegation(String query) {
String entity = "entity";
Assertions.assertThrows(UnsupportedOperationException.class, () -> queryProvider.apply(query, entity));
}
@ParameterizedTest(name = "Should parser the query {0}")
@ValueSource(strings = {"findByIdBetweenOrderByNumTypeOrdinalAsc"})
void shouldFindByIdBetweenOrderByNumTypeOrdinalAsc(String query){
String entity = "entity";
SelectQuery selectQuery = queryProvider.apply(query, entity);


SoftAssertions.assertSoftly(soft ->{
soft.assertThat(selectQuery).isNotNull();
soft.assertThat(selectQuery.entity()).isEqualTo(entity);
});
}

private void checkOrderBy(String query, Direction direction, Direction direction2) {
String entity = "entity";
Expand Down

0 comments on commit 4681cb4

Please sign in to comment.