From ccdb57fa3932785811faf9dd42d5998e4f1ea14b Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Thu, 8 Dec 2022 10:37:23 +0300 Subject: Spring beans should not be public --- .../com/juick/config/DataSourceAutoConfiguration.java | 7 ++++--- src/test/java/com/juick/config/SwaggerConfiguration.java | 16 ++++++++-------- .../java/com/juick/config/TestActivityConfiguration.java | 3 ++- 3 files changed, 14 insertions(+), 12 deletions(-) (limited to 'src/test/java/com') diff --git a/src/test/java/com/juick/config/DataSourceAutoConfiguration.java b/src/test/java/com/juick/config/DataSourceAutoConfiguration.java index b30de7fc..1b88d577 100644 --- a/src/test/java/com/juick/config/DataSourceAutoConfiguration.java +++ b/src/test/java/com/juick/config/DataSourceAutoConfiguration.java @@ -33,12 +33,13 @@ import javax.sql.DataSource; public class DataSourceAutoConfiguration { @Bean - public MariaDB4jSpringService mariaDB4j() { + MariaDB4jSpringService mariaDB4j() { return new MariaDB4jSpringService(); } + @Bean @DependsOn("mariaDB4j") - public DataSource dataSource(DataSourceProperties dataSourceProperties) { + DataSource dataSource(DataSourceProperties dataSourceProperties) { return DataSourceBuilder.create() .driverClassName(dataSourceProperties.getDriverClassName()) .url(dataSourceProperties.getUrl()) @@ -46,4 +47,4 @@ public class DataSourceAutoConfiguration { .password(dataSourceProperties.getPassword()) .build(); } -} \ No newline at end of file +} diff --git a/src/test/java/com/juick/config/SwaggerConfiguration.java b/src/test/java/com/juick/config/SwaggerConfiguration.java index d3eb7185..6eab47cd 100644 --- a/src/test/java/com/juick/config/SwaggerConfiguration.java +++ b/src/test/java/com/juick/config/SwaggerConfiguration.java @@ -26,15 +26,15 @@ import org.springframework.context.annotation.Configuration; @Configuration public class SwaggerConfiguration { @Bean - public OpenAPI api() { + OpenAPI api() { return new OpenAPI() .info(new Info() - .title("Juick API") - .version("2.0") - .description("Juick Rest API Documentation") - .termsOfService("https://juick.com/help/tos") - .license(new License() - .name("AGPLv3") - .url("https://www.gnu.org/licenses/agpl-3.0.html"))); + .title("Juick API") + .version("2.0") + .description("Juick Rest API Documentation") + .termsOfService("https://juick.com/help/tos") + .license(new License() + .name("AGPLv3") + .url("https://www.gnu.org/licenses/agpl-3.0.html"))); } } diff --git a/src/test/java/com/juick/config/TestActivityConfiguration.java b/src/test/java/com/juick/config/TestActivityConfiguration.java index d77b2d52..3dc72e34 100644 --- a/src/test/java/com/juick/config/TestActivityConfiguration.java +++ b/src/test/java/com/juick/config/TestActivityConfiguration.java @@ -27,8 +27,9 @@ import org.springframework.core.io.Resource; public class TestActivityConfiguration { @Value("classpath:test.p12") Resource keystoreFile; + @Bean - public KeystoreManager testKeystoreManager() { + KeystoreManager testKeystoreManager() { return new KeystoreManager(keystoreFile, "secret"); } } -- cgit v1.2.3