Skip to content

Commit c700e9d

Browse files
committed
Polishing.
Reformat code. See #4167. Original pull request: #4168.
1 parent fcd6187 commit c700e9d

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ReactiveMongoTemplate.java

+5-3
Original file line numberDiff line numberDiff line change
@@ -2221,10 +2221,12 @@ public <T> Flux<ChangeStreamEvent<T>> changeStream(@Nullable String database, @N
22212221
publisher = filter.isEmpty() ? db.watch(Document.class) : db.watch(filter, Document.class);
22222222
}
22232223

2224-
if(options.isResumeAfter()) {
2225-
publisher = options.getResumeToken().map(BsonValue::asDocument).map(publisher::resumeAfter).orElse(publisher);
2224+
if (options.isResumeAfter()) {
2225+
publisher = options.getResumeToken().map(BsonValue::asDocument).map(publisher::resumeAfter)
2226+
.orElse(publisher);
22262227
} else if (options.isStartAfter()) {
2227-
publisher = options.getResumeToken().map(BsonValue::asDocument).map(publisher::startAfter).orElse(publisher);
2228+
publisher = options.getResumeToken().map(BsonValue::asDocument).map(publisher::startAfter)
2229+
.orElse(publisher);
22282230
}
22292231
publisher = options.getCollation().map(Collation::toMongoCollation).map(publisher::collation)
22302232
.orElse(publisher);

spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/ReactiveMongoTemplateUnitTests.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -1500,7 +1500,9 @@ void changeStreamOptionStartAftershouldApplied() {
15001500
when(changeStreamPublisher.fullDocument(any())).thenReturn(changeStreamPublisher);
15011501

15021502
BsonDocument token = new BsonDocument("token", new BsonString("id"));
1503-
template.changeStream("database", "collection", ChangeStreamOptions.builder().startAfter(token).build(), Object.class).subscribe();
1503+
template
1504+
.changeStream("database", "collection", ChangeStreamOptions.builder().startAfter(token).build(), Object.class)
1505+
.subscribe();
15041506

15051507
verify(changeStreamPublisher).startAfter(eq(token));
15061508
}
@@ -1530,6 +1532,7 @@ class Wrapper {
15301532

15311533
AutogenerateableId foo;
15321534
}
1535+
15331536
static class PersonExtended extends Person {
15341537

15351538
String lastname;

0 commit comments

Comments
 (0)