Skip to content

Commit 66f1cbd

Browse files
committed
Move code from spring-boot-actuator to spring-boot-session
1 parent 570052b commit 66f1cbd

File tree

13 files changed

+32
-27
lines changed

13 files changed

+32
-27
lines changed

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/session/SessionsEndpointAutoConfiguration.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@
1818

1919
import org.springframework.beans.factory.ObjectProvider;
2020
import org.springframework.boot.actuate.autoconfigure.endpoint.condition.ConditionalOnAvailableEndpoint;
21-
import org.springframework.boot.actuate.session.ReactiveSessionsEndpoint;
22-
import org.springframework.boot.actuate.session.SessionsEndpoint;
2321
import org.springframework.boot.autoconfigure.AutoConfiguration;
2422
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
2523
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
2624
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
2725
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
2826
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
2927
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication.Type;
28+
import org.springframework.boot.session.actuate.endpoint.ReactiveSessionsEndpoint;
29+
import org.springframework.boot.session.actuate.endpoint.SessionsEndpoint;
3030
import org.springframework.context.annotation.Bean;
3131
import org.springframework.context.annotation.Configuration;
3232
import org.springframework.session.FindByIndexNameSessionRepository;
@@ -42,7 +42,7 @@
4242
* @since 2.0.0
4343
*/
4444
@AutoConfiguration(afterName = "org.springframework.boot.session.autoconfigure.SessionAutoConfiguration")
45-
@ConditionalOnClass(Session.class)
45+
@ConditionalOnClass({ Session.class, SessionsEndpoint.class })
4646
@ConditionalOnAvailableEndpoint(SessionsEndpoint.class)
4747
public class SessionsEndpointAutoConfiguration {
4848

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/session/SessionsEndpointAutoConfigurationTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2024 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -19,9 +19,9 @@
1919
import org.junit.jupiter.api.Nested;
2020
import org.junit.jupiter.api.Test;
2121

22-
import org.springframework.boot.actuate.session.ReactiveSessionsEndpoint;
23-
import org.springframework.boot.actuate.session.SessionsEndpoint;
2422
import org.springframework.boot.autoconfigure.AutoConfigurations;
23+
import org.springframework.boot.session.actuate.endpoint.ReactiveSessionsEndpoint;
24+
import org.springframework.boot.session.actuate.endpoint.SessionsEndpoint;
2525
import org.springframework.boot.test.context.runner.ReactiveWebApplicationContextRunner;
2626
import org.springframework.boot.test.context.runner.WebApplicationContextRunner;
2727
import org.springframework.context.annotation.Bean;

spring-boot-project/spring-boot-actuator-docs/src/test/java/org/springframework/boot/actuate/docs/session/SessionsEndpointDocumentationTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
import org.springframework.boot.actuate.context.ShutdownEndpoint;
2828
import org.springframework.boot.actuate.docs.MockMvcEndpointDocumentationTests;
29-
import org.springframework.boot.actuate.session.SessionsEndpoint;
29+
import org.springframework.boot.session.actuate.endpoint.SessionsEndpoint;
3030
import org.springframework.context.annotation.Bean;
3131
import org.springframework.context.annotation.Configuration;
3232
import org.springframework.http.HttpStatus;

spring-boot-project/spring-boot-actuator/build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ dependencies {
5555
optional("org.springframework.data:spring-data-rest-webmvc")
5656
optional("org.springframework.security:spring-security-core")
5757
optional("org.springframework.security:spring-security-web")
58-
optional("org.springframework.session:spring-session-core")
5958

6059
testFixturesImplementation(project(":spring-boot-project:spring-boot-autoconfigure"))
6160
testFixturesImplementation(project(":spring-boot-project:spring-boot-http-converter"))

spring-boot-project/spring-boot-session/build.gradle

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ dependencies {
1515

1616
implementation(project(":spring-boot-project:spring-boot-web-server"))
1717

18+
optional(project(":spring-boot-project:spring-boot-actuator"))
1819
optional(project(":spring-boot-project:spring-boot-autoconfigure"))
20+
optional("io.projectreactor:reactor-core")
1921
optional("jakarta.servlet:jakarta.servlet-api")
2022
optional("org.springframework.security:spring-security-web")
2123

@@ -29,7 +31,11 @@ dependencies {
2931
testImplementation(project(":spring-boot-project:spring-boot-tomcat"))
3032
testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
3133
testImplementation(project(":spring-boot-project:spring-boot-webflux"))
34+
testImplementation(testFixtures(project(":spring-boot-project:spring-boot-actuator")))
3235
testImplementation(testFixtures(project(":spring-boot-project:spring-boot-web-server")))
36+
testImplementation("net.minidev:json-smart")
37+
testImplementation("io.projectreactor:reactor-test")
3338

3439
testRuntimeOnly("ch.qos.logback:logback-classic")
40+
testRuntimeOnly("com.fasterxml.jackson.datatype:jackson-datatype-jsr310")
3541
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.actuate.session;
17+
package org.springframework.boot.session.actuate.endpoint;
1818

1919
import reactor.core.publisher.Mono;
2020

2121
import org.springframework.boot.actuate.endpoint.annotation.DeleteOperation;
2222
import org.springframework.boot.actuate.endpoint.annotation.Endpoint;
2323
import org.springframework.boot.actuate.endpoint.annotation.ReadOperation;
2424
import org.springframework.boot.actuate.endpoint.annotation.Selector;
25-
import org.springframework.boot.actuate.session.SessionsDescriptor.SessionDescriptor;
25+
import org.springframework.boot.session.actuate.endpoint.SessionsDescriptor.SessionDescriptor;
2626
import org.springframework.session.ReactiveFindByIndexNameSessionRepository;
2727
import org.springframework.session.ReactiveSessionRepository;
2828
import org.springframework.session.Session;
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2024 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.actuate.session;
17+
package org.springframework.boot.session.actuate.endpoint;
1818

1919
import java.time.Instant;
2020
import java.util.List;
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.actuate.session;
17+
package org.springframework.boot.session.actuate.endpoint;
1818

1919
import java.util.Map;
2020

2121
import org.springframework.boot.actuate.endpoint.annotation.DeleteOperation;
2222
import org.springframework.boot.actuate.endpoint.annotation.Endpoint;
2323
import org.springframework.boot.actuate.endpoint.annotation.ReadOperation;
2424
import org.springframework.boot.actuate.endpoint.annotation.Selector;
25-
import org.springframework.boot.actuate.session.SessionsDescriptor.SessionDescriptor;
25+
import org.springframework.boot.session.actuate.endpoint.SessionsDescriptor.SessionDescriptor;
2626
import org.springframework.session.FindByIndexNameSessionRepository;
2727
import org.springframework.session.Session;
2828
import org.springframework.session.SessionRepository;
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2019 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -15,6 +15,6 @@
1515
*/
1616

1717
/**
18-
* Actuator support for Spring Session.
18+
* Actuator endpoint for Spring Session.
1919
*/
20-
package org.springframework.boot.actuate.session;
20+
package org.springframework.boot.session.actuate.endpoint;
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2024 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.actuate.session;
17+
package org.springframework.boot.session.actuate.endpoint;
1818

1919
import java.time.Duration;
2020
import java.util.Collections;
@@ -24,7 +24,7 @@
2424
import reactor.core.publisher.Mono;
2525
import reactor.test.StepVerifier;
2626

27-
import org.springframework.boot.actuate.session.SessionsDescriptor.SessionDescriptor;
27+
import org.springframework.boot.session.actuate.endpoint.SessionsDescriptor.SessionDescriptor;
2828
import org.springframework.session.MapSession;
2929
import org.springframework.session.ReactiveFindByIndexNameSessionRepository;
3030
import org.springframework.session.ReactiveSessionRepository;
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2024 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.actuate.session;
17+
package org.springframework.boot.session.actuate.endpoint;
1818

1919
import java.util.Collections;
2020

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2024 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -14,14 +14,14 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.actuate.session;
17+
package org.springframework.boot.session.actuate.endpoint;
1818

1919
import java.util.Collections;
2020
import java.util.List;
2121

2222
import org.junit.jupiter.api.Test;
2323

24-
import org.springframework.boot.actuate.session.SessionsDescriptor.SessionDescriptor;
24+
import org.springframework.boot.session.actuate.endpoint.SessionsDescriptor.SessionDescriptor;
2525
import org.springframework.session.FindByIndexNameSessionRepository;
2626
import org.springframework.session.MapSession;
2727
import org.springframework.session.Session;
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2024 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.actuate.session;
17+
package org.springframework.boot.session.actuate.endpoint;
1818

1919
import java.util.Collections;
2020

0 commit comments

Comments
 (0)