Skip to content

Commit d7e2096

Browse files
committed
Merge branch '3.3.x' into 3.4.x
Closes gh-45996
2 parents 0f4e7ba + a6ac444 commit d7e2096

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/audit/AuditEventsEndpointDocumentationTests.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
package org.springframework.boot.actuate.autoconfigure.audit;
1818

19-
import java.time.OffsetDateTime;
19+
import java.time.Instant;
2020
import java.time.format.DateTimeFormatter;
2121
import java.util.Collections;
2222
import java.util.List;
@@ -67,10 +67,10 @@ void allAuditEvents() {
6767

6868
@Test
6969
void filteredAuditEvents() {
70-
OffsetDateTime now = OffsetDateTime.now();
71-
String queryTimestamp = DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(now);
72-
given(this.repository.find("alice", now.toInstant(), "logout"))
73-
.willReturn(List.of(new AuditEvent("alice", "logout", Collections.emptyMap())));
70+
String queryTimestamp = "2017-11-07T09:37Z";
71+
Instant instant = Instant.from(DateTimeFormatter.ISO_OFFSET_DATE_TIME.parse(queryTimestamp));
72+
given(this.repository.find("alice", instant, "logout"))
73+
.willReturn(List.of(new AuditEvent(instant.plusSeconds(73), "alice", "logout", Collections.emptyMap())));
7474
assertThat(this.mvc.get()
7575
.uri("/actuator/auditevents")
7676
.param("principal", "alice")
@@ -85,7 +85,7 @@ void filteredAuditEvents() {
8585
.description("Restricts the events to those with the given principal. Optional."),
8686
parameterWithName("type")
8787
.description("Restricts the events to those with the given type. Optional."))));
88-
then(this.repository).should().find("alice", now.toInstant(), "logout");
88+
then(this.repository).should().find("alice", instant, "logout");
8989
}
9090

9191
@Configuration(proxyBeanMethods = false)

0 commit comments

Comments
 (0)