mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-03-30 11:58:59 +00:00
Remove javax.annotation Usage
Closes gh-9415
This commit is contained in:
parent
3d6c5bf04a
commit
ccfbff4954
ldap/src/integration-test/java/org/springframework/security/ldap
@ -16,8 +16,7 @@
|
||||
|
||||
package org.springframework.security.ldap;
|
||||
|
||||
import javax.annotation.PreDestroy;
|
||||
|
||||
import org.springframework.beans.factory.DisposableBean;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.ldap.core.ContextSource;
|
||||
@ -27,7 +26,7 @@ import org.springframework.security.ldap.server.ApacheDSContainer;
|
||||
* @author Eddú Meléndez
|
||||
*/
|
||||
@Configuration
|
||||
public class ApacheDsContainerConfig {
|
||||
public class ApacheDsContainerConfig implements DisposableBean {
|
||||
|
||||
private ApacheDSContainer container;
|
||||
|
||||
@ -44,8 +43,8 @@ public class ApacheDsContainerConfig {
|
||||
"ldap://127.0.0.1:" + ldapContainer.getLocalPort() + "/dc=springframework,dc=org");
|
||||
}
|
||||
|
||||
@PreDestroy
|
||||
void shutdown() {
|
||||
@Override
|
||||
public void destroy() throws Exception {
|
||||
this.container.stop();
|
||||
}
|
||||
|
||||
|
@ -16,11 +16,10 @@
|
||||
|
||||
package org.springframework.security.ldap.server;
|
||||
|
||||
import javax.annotation.PreDestroy;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Test;
|
||||
|
||||
import org.springframework.beans.factory.DisposableBean;
|
||||
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
@ -92,7 +91,7 @@ public class UnboundIdContainerLdifTests {
|
||||
}
|
||||
|
||||
@Configuration
|
||||
static class CustomLdifConfig {
|
||||
static class CustomLdifConfig implements DisposableBean {
|
||||
|
||||
private UnboundIdContainer container = new UnboundIdContainer("dc=springframework,dc=org",
|
||||
"classpath:test-server.ldif");
|
||||
@ -109,15 +108,15 @@ public class UnboundIdContainerLdifTests {
|
||||
"ldap://127.0.0.1:" + container.getPort() + "/dc=springframework,dc=org");
|
||||
}
|
||||
|
||||
@PreDestroy
|
||||
void shutdown() {
|
||||
@Override
|
||||
public void destroy() throws Exception {
|
||||
this.container.stop();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Configuration
|
||||
static class WildcardLdifConfig {
|
||||
static class WildcardLdifConfig implements DisposableBean {
|
||||
|
||||
private UnboundIdContainer container = new UnboundIdContainer("dc=springframework,dc=org",
|
||||
"classpath*:test-server.ldif");
|
||||
@ -134,15 +133,15 @@ public class UnboundIdContainerLdifTests {
|
||||
"ldap://127.0.0.1:" + container.getPort() + "/dc=springframework,dc=org");
|
||||
}
|
||||
|
||||
@PreDestroy
|
||||
void shutdown() {
|
||||
@Override
|
||||
public void destroy() throws Exception {
|
||||
this.container.stop();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Configuration
|
||||
static class MalformedLdifConfig {
|
||||
static class MalformedLdifConfig implements DisposableBean {
|
||||
|
||||
private UnboundIdContainer container = new UnboundIdContainer("dc=springframework,dc=org",
|
||||
"classpath:test-server-malformed.txt");
|
||||
@ -153,15 +152,15 @@ public class UnboundIdContainerLdifTests {
|
||||
return this.container;
|
||||
}
|
||||
|
||||
@PreDestroy
|
||||
void shutdown() {
|
||||
@Override
|
||||
public void destroy() throws Exception {
|
||||
this.container.stop();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Configuration
|
||||
static class MissingLdifConfig {
|
||||
static class MissingLdifConfig implements DisposableBean {
|
||||
|
||||
private UnboundIdContainer container = new UnboundIdContainer("dc=springframework,dc=org",
|
||||
"classpath:does-not-exist.ldif");
|
||||
@ -172,15 +171,15 @@ public class UnboundIdContainerLdifTests {
|
||||
return this.container;
|
||||
}
|
||||
|
||||
@PreDestroy
|
||||
void shutdown() {
|
||||
@Override
|
||||
public void destroy() throws Exception {
|
||||
this.container.stop();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Configuration
|
||||
static class WildcardNoLdifConfig {
|
||||
static class WildcardNoLdifConfig implements DisposableBean {
|
||||
|
||||
private UnboundIdContainer container = new UnboundIdContainer("dc=springframework,dc=org",
|
||||
"classpath*:*.test.ldif");
|
||||
@ -191,8 +190,8 @@ public class UnboundIdContainerLdifTests {
|
||||
return this.container;
|
||||
}
|
||||
|
||||
@PreDestroy
|
||||
void shutdown() {
|
||||
@Override
|
||||
public void destroy() throws Exception {
|
||||
this.container.stop();
|
||||
}
|
||||
|
||||
|
@ -16,12 +16,11 @@
|
||||
|
||||
package org.springframework.security.ldap.userdetails;
|
||||
|
||||
import javax.annotation.PreDestroy;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import org.springframework.beans.factory.DisposableBean;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
@ -81,7 +80,7 @@ public class LdapUserDetailsManagerModifyPasswordTests {
|
||||
}
|
||||
|
||||
@Configuration
|
||||
static class UnboundIdContainerConfiguration {
|
||||
static class UnboundIdContainerConfiguration implements DisposableBean {
|
||||
|
||||
private UnboundIdContainer container = new UnboundIdContainer("dc=springframework,dc=org",
|
||||
"classpath:test-server.ldif");
|
||||
@ -98,8 +97,8 @@ public class LdapUserDetailsManagerModifyPasswordTests {
|
||||
"ldap://127.0.0.1:" + container.getPort() + "/dc=springframework,dc=org");
|
||||
}
|
||||
|
||||
@PreDestroy
|
||||
void shutdown() {
|
||||
@Override
|
||||
public void destroy() throws Exception {
|
||||
this.container.stop();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user