diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/audit/AuditEventRepository.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/audit/AuditEventRepository.java index b79ed16ea7..e1f8592f40 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/audit/AuditEventRepository.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/audit/AuditEventRepository.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2017 the original author or authors. + * Copyright 2012-2018 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -33,24 +33,6 @@ public interface AuditEventRepository { */ void add(AuditEvent event); - /** - * Find audit events since the time provided. - * @param after timestamp of earliest result required (or {@code null} if - * unrestricted) - * @return audit events - * @since 1.4.0 - */ - List find(Date after); - - /** - * Find audit events relating to the specified principal since the time provided. - * @param principal the principal name to search for (or {@code null} if unrestricted) - * @param after timestamp of earliest result required (or {@code null} if - * unrestricted) - * @return audit events relating to the principal - */ - List find(String principal, Date after); - /** * Find audit events of specified type relating to the specified principal since the * time provided. diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/audit/InMemoryAuditEventRepository.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/audit/InMemoryAuditEventRepository.java index c2fa51a89e..914cf85616 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/audit/InMemoryAuditEventRepository.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/audit/InMemoryAuditEventRepository.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2017 the original author or authors. + * Copyright 2012-2018 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -69,16 +69,6 @@ public class InMemoryAuditEventRepository implements AuditEventRepository { } } - @Override - public List find(Date after) { - return find(null, after, null); - } - - @Override - public List find(String principal, Date after) { - return find(principal, after, null); - } - @Override public List find(String principal, Date after, String type) { LinkedList events = new LinkedList<>(); diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/audit/InMemoryAuditEventRepositoryTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/audit/InMemoryAuditEventRepositoryTests.java index b21f8e3522..93365ed929 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/audit/InMemoryAuditEventRepositoryTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/audit/InMemoryAuditEventRepositoryTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2017 the original author or authors. + * Copyright 2012-2018 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -45,7 +45,7 @@ public class InMemoryAuditEventRepositoryTests { InMemoryAuditEventRepository repository = new InMemoryAuditEventRepository(); repository.add(new AuditEvent("dave", "a")); repository.add(new AuditEvent("dave", "b")); - List events = repository.find("dave", null); + List events = repository.find("dave", null, null); assertThat(events.size()).isEqualTo(2); assertThat(events.get(0).getType()).isEqualTo("a"); assertThat(events.get(1).getType()).isEqualTo("b"); @@ -57,7 +57,7 @@ public class InMemoryAuditEventRepositoryTests { repository.add(new AuditEvent("dave", "a")); repository.add(new AuditEvent("dave", "b")); repository.add(new AuditEvent("dave", "c")); - List events = repository.find("dave", null); + List events = repository.find("dave", null, null); assertThat(events.size()).isEqualTo(2); assertThat(events.get(0).getType()).isEqualTo("b"); assertThat(events.get(1).getType()).isEqualTo("c"); @@ -78,7 +78,7 @@ public class InMemoryAuditEventRepositoryTests { repository.add(new AuditEvent("phil", "b")); repository.add(new AuditEvent("dave", "c")); repository.add(new AuditEvent("phil", "d")); - List events = repository.find("dave", null); + List events = repository.find("dave", null, null); assertThat(events.size()).isEqualTo(2); assertThat(events.get(0).getType()).isEqualTo("a"); assertThat(events.get(1).getType()).isEqualTo("c"); @@ -113,11 +113,11 @@ public class InMemoryAuditEventRepositoryTests { calendar.add(Calendar.DAY_OF_YEAR, 1); repository.add(new AuditEvent(calendar.getTime(), "phil", "d", data)); calendar.add(Calendar.DAY_OF_YEAR, 1); - List events = repository.find(after); + List events = repository.find(null, after, null); assertThat(events.size()).isEqualTo(2); assertThat(events.get(0).getType()).isEqualTo("c"); assertThat(events.get(1).getType()).isEqualTo("d"); - events = repository.find("dave", after); + events = repository.find("dave", after, null); assertThat(events.size()).isEqualTo(1); assertThat(events.get(0).getType()).isEqualTo("c"); }