Skip to content

Commit 364fa66

Browse files
make sure things are skipped for real
1 parent 10ba08d commit 364fa66

File tree

2 files changed

+17
-14
lines changed

2 files changed

+17
-14
lines changed

spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/aot/MongoRepositoryContributor.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,10 @@ protected void customizeConstructor(AotRepositoryConstructorBuilder constructorB
101101
MongoQueryMethod queryMethod = new MongoQueryMethod(method, getRepositoryInformation(), getProjectionFactory(),
102102
mappingContext);
103103

104+
if (backoff(queryMethod)) {
105+
return null;
106+
}
107+
104108
if (queryMethod.hasAnnotatedAggregation()) {
105109
AggregationInteraction aggregation = new AggregationInteraction(queryMethod.getAnnotatedAggregation());
106110
return aggregationMethodContributor(queryMethod, aggregation);
@@ -127,9 +131,7 @@ protected void customizeConstructor(AotRepositoryConstructorBuilder constructorB
127131
}
128132
}
129133

130-
if (backoff(queryMethod)) {
131-
return null;
132-
}
134+
133135

134136
if (query.isDelete()) {
135137
return deleteMethodContributor(queryMethod, query);

spring-data-mongodb/src/test/java/org/springframework/data/mongodb/repository/aot/MongoRepositoryContributorTests.java

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
import org.bson.Document;
3232
import org.junit.jupiter.api.BeforeAll;
3333
import org.junit.jupiter.api.BeforeEach;
34-
import org.junit.jupiter.api.Disabled;
3534
import org.junit.jupiter.api.Test;
3635
import org.junit.jupiter.api.extension.ExtendWith;
3736
import org.springframework.beans.factory.annotation.Autowired;
@@ -50,7 +49,6 @@
5049
import org.springframework.data.geo.Box;
5150
import org.springframework.data.geo.Circle;
5251
import org.springframework.data.geo.Distance;
53-
import org.springframework.data.geo.GeoPage;
5452
import org.springframework.data.geo.GeoResult;
5553
import org.springframework.data.geo.GeoResults;
5654
import org.springframework.data.geo.Metrics;
@@ -695,18 +693,21 @@ void testNearWithRange() {
695693
}
696694

697695
@Test
698-
@Disabled("too complicated")
699696
void testNearReturningGeoPage() {
700697

701-
// TODO: still need to create the count and extract the total elements
702-
GeoPage<User> page1 = fragment.findByLocationCoordinatesNear(new Point(-73.99, 40.73),
703-
Distance.of(2000, Metrics.KILOMETERS), PageRequest.of(0, 1));
704-
705-
assertThat(page1.hasNext()).isTrue();
698+
assertThatExceptionOfType(NoSuchMethodException.class)
699+
.isThrownBy(() -> fragment.findByLocationCoordinatesNear(new Point(-73.99, 40.73),
700+
Distance.of(2000, Metrics.KILOMETERS), PageRequest.of(0, 1)));
706701

707-
GeoPage<User> page2 = fragment.findByLocationCoordinatesNear(new Point(-73.99, 40.73),
708-
Distance.of(2000, Metrics.KILOMETERS), page1.nextPageable());
709-
assertThat(page2.hasNext()).isFalse();
702+
// TODO: still need to create the count and extract the total elements
703+
// GeoPage<User> page1 = fragment.findByLocationCoordinatesNear(new Point(-73.99, 40.73),
704+
// Distance.of(2000, Metrics.KILOMETERS), PageRequest.of(0, 1));
705+
//
706+
// assertThat(page1.hasNext()).isTrue();
707+
//
708+
// GeoPage<User> page2 = fragment.findByLocationCoordinatesNear(new Point(-73.99, 40.73),
709+
// Distance.of(2000, Metrics.KILOMETERS), page1.nextPageable());
710+
// assertThat(page2.hasNext()).isFalse();
710711
}
711712

712713
/**

0 commit comments

Comments
 (0)