diff --git a/src/test/java/io/wwan13/wintersecurity/WinterSecurityApplicationTests.java b/src/test/java/io/wwan13/wintersecurity/WinterSecurityApplicationTests.java deleted file mode 100644 index 7b6ee1d..0000000 --- a/src/test/java/io/wwan13/wintersecurity/WinterSecurityApplicationTests.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2024 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -package io.wwan13.wintersecurity; - -import org.junit.jupiter.api.Test; - -class WinterSecurityApplicationTests extends ContextTest { - - @Test - void contextLoads() { - } -} diff --git a/src/test/java/io/wwan13/wintersecurity/context/allconfigures/AllConfiguresContextTest.java b/src/test/java/io/wwan13/wintersecurity/context/allconfigures/AllConfiguresContextTest.java deleted file mode 100644 index 8c40719..0000000 --- a/src/test/java/io/wwan13/wintersecurity/context/allconfigures/AllConfiguresContextTest.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2024 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.wwan13.wintersecurity.context.allconfigures; - -import io.wwan13.wintersecurity.ContextTest; -import org.junit.jupiter.api.Test; -import org.springframework.context.annotation.Import; - -@Import(AllConfiguresTestConfigure.class) -public class AllConfiguresContextTest extends ContextTest { - - @Test - void contextLoad() { - } -} diff --git a/src/test/java/io/wwan13/wintersecurity/context/allconfigures/AllConfiguresTestConfigure.java b/src/test/java/io/wwan13/wintersecurity/context/allconfigures/AllConfiguresTestConfigure.java deleted file mode 100644 index 2363cc3..0000000 --- a/src/test/java/io/wwan13/wintersecurity/context/allconfigures/AllConfiguresTestConfigure.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright 2024 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.wwan13.wintersecurity.context.allconfigures; - -import io.wwan13.wintersecurity.auth.authpattern.support.AuthPatternsRegistry; -import io.wwan13.wintersecurity.config.EnableJwtProvider; -import io.wwan13.wintersecurity.config.EnableSecureRequest; -import io.wwan13.wintersecurity.config.JwtProviderConfigurer; -import io.wwan13.wintersecurity.config.SecureRequestConfigurer; -import io.wwan13.wintersecurity.jwt.support.JwtPropertiesRegistry; -import io.wwan13.wintersecurity.resolve.RequestUserId; -import io.wwan13.wintersecurity.resolve.RequestUserRoles; -import io.wwan13.wintersecurity.resolve.support.TargetAnnotationsRegistry; -import io.wwan13.wintersecurity.secretkey.support.SecretKeyRegistry; -import org.springframework.boot.test.context.TestConfiguration; - -@TestConfiguration -@EnableJwtProvider -@EnableSecureRequest -public class AllConfiguresTestConfigure - implements JwtProviderConfigurer, SecureRequestConfigurer { - - @Override - public void configureJwt(JwtPropertiesRegistry registry) { - registry - .accessTokenValidity(100000000000L) - .refreshTokenValidity(100000000000L); - } - - @Override - public void configureSecretKey(SecretKeyRegistry registry) { - registry - .secretKey("asdfghjklqwertyuiopzxcvbnmasddfgwerasf"); - } - - @Override - public void registerAuthPatterns(AuthPatternsRegistry registry) { - registry - .uriPatterns("/api/test/**") - .allHttpMethods() - .permitAll() - - .elseRequestAuthenticated(); - } - - @Override - public void registerTargetAnnotations(TargetAnnotationsRegistry registry) { - registry - .addSubjectResolveAnnotation(RequestUserId.class) - .addRolesResolveAnnotation(RequestUserRoles.class); - } -} diff --git a/src/test/java/io/wwan13/wintersecurity/context/jwtprovider/JwtProviderContextTest.java b/src/test/java/io/wwan13/wintersecurity/context/jwtprovider/JwtProviderContextTest.java deleted file mode 100644 index a50d5be..0000000 --- a/src/test/java/io/wwan13/wintersecurity/context/jwtprovider/JwtProviderContextTest.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2024 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.wwan13.wintersecurity.context.jwtprovider; - -import io.wwan13.wintersecurity.ContextTest; -import org.junit.jupiter.api.Test; -import org.springframework.context.annotation.Import; - -@Import(JwtProviderTestConfig.class) -public class JwtProviderContextTest extends ContextTest { - - @Test - void contextLoad() { - } -} diff --git a/src/test/java/io/wwan13/wintersecurity/context/jwtprovider/JwtProviderTestConfig.java b/src/test/java/io/wwan13/wintersecurity/context/jwtprovider/JwtProviderTestConfig.java deleted file mode 100644 index a0e8358..0000000 --- a/src/test/java/io/wwan13/wintersecurity/context/jwtprovider/JwtProviderTestConfig.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2024 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.wwan13.wintersecurity.context.jwtprovider; - -import io.wwan13.wintersecurity.config.EnableJwtProvider; -import io.wwan13.wintersecurity.config.JwtProviderConfigurer; -import io.wwan13.wintersecurity.jwt.support.JwtPropertiesRegistry; -import io.wwan13.wintersecurity.secretkey.support.SecretKeyRegistry; -import org.springframework.boot.test.context.TestConfiguration; - -@TestConfiguration -@EnableJwtProvider -public class JwtProviderTestConfig implements JwtProviderConfigurer { - - @Override - public void configureJwt(JwtPropertiesRegistry registry) { - registry - .accessTokenValidity(100000000000L) - .refreshTokenValidity(100000000000L); - } - - @Override - public void configureSecretKey(SecretKeyRegistry registry) { - registry - .secretKey("asdfghjklqwertyuiopzxcvbnmasddfgwerasf"); - } -} diff --git a/src/test/java/io/wwan13/wintersecurity/context/securerequest/SecureRequestContextTest.java b/src/test/java/io/wwan13/wintersecurity/context/securerequest/SecureRequestContextTest.java deleted file mode 100644 index bc9d67c..0000000 --- a/src/test/java/io/wwan13/wintersecurity/context/securerequest/SecureRequestContextTest.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2024 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.wwan13.wintersecurity.context.securerequest; - -import io.wwan13.wintersecurity.ContextTest; -import org.junit.jupiter.api.Test; -import org.springframework.context.annotation.Import; - -@Import(SecureRequestTestConfig.class) -public class SecureRequestContextTest extends ContextTest { - - @Test - void contextLoad() { - } -} diff --git a/src/test/java/io/wwan13/wintersecurity/context/securerequest/SecureRequestTestConfig.java b/src/test/java/io/wwan13/wintersecurity/context/securerequest/SecureRequestTestConfig.java deleted file mode 100644 index 2f8d517..0000000 --- a/src/test/java/io/wwan13/wintersecurity/context/securerequest/SecureRequestTestConfig.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2024 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.wwan13.wintersecurity.context.securerequest; - -import io.wwan13.wintersecurity.auth.authpattern.support.AuthPatternsRegistry; -import io.wwan13.wintersecurity.config.EnableSecureRequest; -import io.wwan13.wintersecurity.config.SecureRequestConfigurer; -import io.wwan13.wintersecurity.resolve.RequestUserId; -import io.wwan13.wintersecurity.resolve.RequestUserRoles; -import io.wwan13.wintersecurity.resolve.support.TargetAnnotationsRegistry; -import io.wwan13.wintersecurity.secretkey.support.SecretKeyRegistry; -import org.springframework.boot.test.context.TestConfiguration; - -@TestConfiguration -@EnableSecureRequest -public class SecureRequestTestConfig implements SecureRequestConfigurer { - - @Override - public void configureSecretKey(SecretKeyRegistry registry) { - registry - .secretKey("asdfghjklqwertyuiopzxcvbnmasddfgwerasf"); - } - - @Override - public void registerAuthPatterns(AuthPatternsRegistry registry) { - registry - .uriPatterns("/api/test/**") - .allHttpMethods() - .permitAll() - - .elseRequestAuthenticated(); - } - - @Override - public void registerTargetAnnotations(TargetAnnotationsRegistry registry) { - registry - .addSubjectResolveAnnotation(RequestUserId.class) - .addRolesResolveAnnotation(RequestUserRoles.class); - } -}