Skip to content

Commit 29467ef

Browse files
committed
Polishing.
Simplify tests. See #2884 Original pull request: #2891
1 parent 1534c87 commit 29467ef

File tree

3 files changed

+158
-160
lines changed

3 files changed

+158
-160
lines changed

spring-data-jpa/src/test/java/org/springframework/data/jpa/repository/query/HqlParserQueryEnhancerUnitTests.java

+3-16
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,21 @@
1717

1818
import static org.assertj.core.api.Assumptions.*;
1919

20-
import org.junit.jupiter.api.Disabled;
2120
import org.junit.jupiter.params.ParameterizedTest;
2221
import org.junit.jupiter.params.provider.MethodSource;
2322

2423
/**
2524
* TCK Tests for {@link HqlQueryParser} mixed into {@link JpaQueryEnhancer}.
2625
*
2726
* @author Greg Turnquist
28-
* @since 3.1
2927
*/
3028
public class HqlParserQueryEnhancerUnitTests extends QueryEnhancerTckTests {
3129

32-
public static final String HQL_PARSER_DOES_NOT_SUPPORT_NATIVE_QUERIES = "HqlParser does not support native queries";
33-
3430
@Override
3531
QueryEnhancer createQueryEnhancer(DeclaredQuery query) {
32+
33+
assumeThat(query.isNativeQuery()).isFalse();
34+
3635
return JpaQueryEnhancer.forHql(query);
3736
}
3837

@@ -50,16 +49,4 @@ void shouldDeriveJpqlCountQuery(String query, String expected) {
5049
super.shouldDeriveJpqlCountQuery(query, expected);
5150
}
5251

53-
@Disabled(HQL_PARSER_DOES_NOT_SUPPORT_NATIVE_QUERIES)
54-
@Override
55-
void findProjectionClauseWithIncludedFrom() {}
56-
57-
@Disabled(HQL_PARSER_DOES_NOT_SUPPORT_NATIVE_QUERIES)
58-
@Override
59-
void shouldDeriveNativeCountQuery(String query, String expected) {}
60-
61-
@Disabled(HQL_PARSER_DOES_NOT_SUPPORT_NATIVE_QUERIES)
62-
@Override
63-
void shouldDeriveNativeCountQueryWithVariable(String query, String expected) {}
64-
6552
}

spring-data-jpa/src/test/java/org/springframework/data/jpa/repository/query/JpqlParserQueryEnhancerUnitTests.java

+5-17
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,22 @@
1717

1818
import static org.assertj.core.api.Assumptions.*;
1919

20-
import org.junit.jupiter.api.Disabled;
2120
import org.junit.jupiter.params.ParameterizedTest;
2221
import org.junit.jupiter.params.provider.MethodSource;
2322

2423
/**
2524
* TCK Tests for {@link JpqlQueryParser} mixed into {@link JpaQueryEnhancer}.
2625
*
2726
* @author Greg Turnquist
28-
* @since 3.1
2927
*/
3028
public class JpqlParserQueryEnhancerUnitTests extends QueryEnhancerTckTests {
3129

32-
public static final String JPQL_PARSER_DOES_NOT_SUPPORT_NATIVE_QUERIES = "JpqlParser does not support native queries";
33-
3430
@Override
35-
QueryEnhancer createQueryEnhancer(DeclaredQuery declaredQuery) {
36-
return JpaQueryEnhancer.forJpql(declaredQuery);
31+
QueryEnhancer createQueryEnhancer(DeclaredQuery query) {
32+
33+
assumeThat(query.isNativeQuery()).isFalse();
34+
35+
return JpaQueryEnhancer.forJpql(query);
3736
}
3837

3938
@Override
@@ -53,15 +52,4 @@ void shouldDeriveJpqlCountQuery(String query, String expected) {
5352
super.shouldDeriveJpqlCountQuery(query, expected);
5453
}
5554

56-
@Disabled(JPQL_PARSER_DOES_NOT_SUPPORT_NATIVE_QUERIES)
57-
@Override
58-
void findProjectionClauseWithIncludedFrom() {}
59-
60-
@Disabled(JPQL_PARSER_DOES_NOT_SUPPORT_NATIVE_QUERIES)
61-
@Override
62-
void shouldDeriveNativeCountQuery(String query, String expected) {}
63-
64-
@Disabled(JPQL_PARSER_DOES_NOT_SUPPORT_NATIVE_QUERIES)
65-
@Override
66-
void shouldDeriveNativeCountQueryWithVariable(String query, String expected) {}
6755
}

0 commit comments

Comments
 (0)