From 2a6ca9be6f009a6fb73357098763e31138abee67 Mon Sep 17 00:00:00 2001 From: Conor Heffron Date: Sun, 13 Oct 2024 05:50:05 +0100 Subject: [PATCH] #138 Refactor com.ironoc.portfolio -> net.ironoc.portfolio (#139) * #138 Refactor com.ironoc.portfolio -> net.ironoc.portfolio * #138 Update pom.xml --- pom.xml | 2 +- .../ironoc/portfolio/config/Properties.java | 20 ------------------- .../{com => net}/ironoc/portfolio/App.java | 2 +- .../portfolio/aws/AwsSecretManager.java | 4 ++-- .../ironoc/portfolio/aws/SecretManager.java | 2 +- .../ironoc/portfolio/client/Client.java | 2 +- .../ironoc/portfolio/client/GitClient.java | 10 +++++----- .../portfolio/config/IronocConfiguration.java | 4 ++-- .../ironoc/portfolio/config/Properties.java | 20 +++++++++++++++++++ .../portfolio/config/PropertyConfig.java | 2 +- .../portfolio/config/PropertyConfigI.java | 2 +- .../ironoc/portfolio/config/PropertyKey.java | 2 +- .../ironoc/portfolio/config/PropertyKeyI.java | 2 +- .../config/PushStateResourceResolver.java | 4 ++-- .../controller/GitProjectsController.java | 14 ++++++------- .../domain/RepositoryDetailDomain.java | 2 +- .../domain/RepositoryIssueDomain.java | 2 +- .../ironoc/portfolio/dto/OwnerDto.java | 2 +- .../portfolio/dto/RepositoryDetailDto.java | 2 +- .../portfolio/dto/RepositoryIssueDto.java | 2 +- .../ironoc/portfolio/job/GitDetailsJob.java | 6 +++--- .../portfolio/job/GitDetailsRunnable.java | 14 +++++++------ .../portfolio/logger/AbstractLogger.java | 2 +- .../ironoc/portfolio/logger/LoggerI.java | 2 +- .../ironoc/portfolio/service/GitDetails.java | 10 +++++----- .../portfolio/service/GitDetailsService.java | 20 +++++++++---------- .../portfolio/service/GitRepoCache.java | 7 ++++--- .../service/GitRepoCacheService.java | 13 ++++++++---- .../ironoc/portfolio/utils/UrlUtils.java | 4 ++-- src/main/resources/application.yml | 2 +- .../ironoc/portfolio/AppTest.java | 2 +- .../portfolio/aws/AwsSecretManagerTest.java | 2 +- .../portfolio/client/GitClientTest.java | 10 +++++----- .../config/IronocConfigurationTest.java | 2 +- .../portfolio/config/PropertyConfigTest.java | 2 +- .../portfolio/config/PropertyKeyTest.java | 14 ++++++------- .../config/PushStateResourceResolverTest.java | 2 +- .../config/TestIronocConfiguration.java | 4 ++-- .../GitProjectsControllerIntegrationTest.java | 10 +++++----- .../controller/GitProjectsControllerTest.java | 8 ++++---- .../portfolio/job/GitDetailsJobTest.java | 6 +++--- .../portfolio/job/GitDetailsRunnableTest.java | 6 +++--- .../service/GitDetailsServiceTest.java | 18 ++++++++--------- .../service/GitRepoCacheServiceTest.java | 8 +++++--- .../ironoc/portfolio/utils/UrlUtilsTest.java | 2 +- src/test/resources/application.yml | 4 ++-- 46 files changed, 146 insertions(+), 136 deletions(-) delete mode 100644 src/main/java/com/ironoc/portfolio/config/Properties.java rename src/main/java/{com => net}/ironoc/portfolio/App.java (89%) rename src/main/java/{com => net}/ironoc/portfolio/aws/AwsSecretManager.java (94%) rename src/main/java/{com => net}/ironoc/portfolio/aws/SecretManager.java (65%) rename src/main/java/{com => net}/ironoc/portfolio/client/Client.java (92%) rename src/main/java/{com => net}/ironoc/portfolio/client/GitClient.java (95%) rename src/main/java/{com => net}/ironoc/portfolio/config/IronocConfiguration.java (95%) create mode 100644 src/main/java/net/ironoc/portfolio/config/Properties.java rename src/main/java/{com => net}/ironoc/portfolio/config/PropertyConfig.java (97%) rename src/main/java/{com => net}/ironoc/portfolio/config/PropertyConfigI.java (87%) rename src/main/java/{com => net}/ironoc/portfolio/config/PropertyKey.java (95%) rename src/main/java/{com => net}/ironoc/portfolio/config/PropertyKeyI.java (87%) rename src/main/java/{com => net}/ironoc/portfolio/config/PushStateResourceResolver.java (96%) rename src/main/java/{com => net}/ironoc/portfolio/controller/GitProjectsController.java (94%) rename src/main/java/{com => net}/ironoc/portfolio/domain/RepositoryDetailDomain.java (97%) rename src/main/java/{com => net}/ironoc/portfolio/domain/RepositoryIssueDomain.java (95%) rename src/main/java/{com => net}/ironoc/portfolio/dto/OwnerDto.java (93%) rename src/main/java/{com => net}/ironoc/portfolio/dto/RepositoryDetailDto.java (97%) rename src/main/java/{com => net}/ironoc/portfolio/dto/RepositoryIssueDto.java (94%) rename src/main/java/{com => net}/ironoc/portfolio/job/GitDetailsJob.java (87%) rename src/main/java/{com => net}/ironoc/portfolio/job/GitDetailsRunnable.java (75%) rename src/main/java/{com => net}/ironoc/portfolio/logger/AbstractLogger.java (93%) rename src/main/java/{com => net}/ironoc/portfolio/logger/LoggerI.java (86%) rename src/main/java/{com => net}/ironoc/portfolio/service/GitDetails.java (67%) rename src/main/java/{com => net}/ironoc/portfolio/service/GitDetailsService.java (91%) rename src/main/java/{com => net}/ironoc/portfolio/service/GitRepoCache.java (62%) rename src/main/java/{com => net}/ironoc/portfolio/service/GitRepoCacheService.java (79%) rename src/main/java/{com => net}/ironoc/portfolio/utils/UrlUtils.java (82%) rename src/test/java/{com => net}/ironoc/portfolio/AppTest.java (95%) rename src/test/java/{com => net}/ironoc/portfolio/aws/AwsSecretManagerTest.java (95%) rename src/test/java/{com => net}/ironoc/portfolio/client/GitClientTest.java (98%) rename src/test/java/{com => net}/ironoc/portfolio/config/IronocConfigurationTest.java (99%) rename src/test/java/{com => net}/ironoc/portfolio/config/PropertyConfigTest.java (99%) rename src/test/java/{com => net}/ironoc/portfolio/config/PropertyKeyTest.java (78%) rename src/test/java/{com => net}/ironoc/portfolio/config/PushStateResourceResolverTest.java (99%) rename src/test/java/{com => net}/ironoc/portfolio/config/TestIronocConfiguration.java (88%) rename src/test/java/{com => net}/ironoc/portfolio/controller/GitProjectsControllerIntegrationTest.java (97%) rename src/test/java/{com => net}/ironoc/portfolio/controller/GitProjectsControllerTest.java (97%) rename src/test/java/{com => net}/ironoc/portfolio/job/GitDetailsJobTest.java (89%) rename src/test/java/{com => net}/ironoc/portfolio/job/GitDetailsRunnableTest.java (90%) rename src/test/java/{com => net}/ironoc/portfolio/service/GitDetailsServiceTest.java (97%) rename src/test/java/{com => net}/ironoc/portfolio/service/GitRepoCacheServiceTest.java (91%) rename src/test/java/{com => net}/ironoc/portfolio/utils/UrlUtilsTest.java (95%) diff --git a/pom.xml b/pom.xml index a0423c4..9f57673 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ conorheffron ironoc - 5.2.3 + 5.2.4 war diff --git a/src/main/java/com/ironoc/portfolio/config/Properties.java b/src/main/java/com/ironoc/portfolio/config/Properties.java deleted file mode 100644 index 2c11797..0000000 --- a/src/main/java/com/ironoc/portfolio/config/Properties.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.ironoc.portfolio.config; - -import lombok.Getter; - -@Getter -public enum Properties { - - GIT_API_ENDPOINT_REPOS("com.ironoc.portfolio.github.api.endpoint.repos"), - GIT_API_ENDPOINT_ISSUES("com.ironoc.portfolio.github.api.endpoint.issues"), - GIT_TIMEOUT_CONNECT ("com.ironoc.portfolio.github.timeout.connect"), - GIT_TIMEOUT_READ("com.ironoc.portfolio.github.timeout.read"), - GIT_INSTANCE_FOLLOW_REDIRECTS("com.ironoc.portfolio.github.instance-follow-redirects"), - GIT_FOLLOW_REDIRECTS("com.ironoc.portfolio.github.follow-redirects"); - - private String key; - - Properties(String key) { - this.key = key; - } -} diff --git a/src/main/java/com/ironoc/portfolio/App.java b/src/main/java/net/ironoc/portfolio/App.java similarity index 89% rename from src/main/java/com/ironoc/portfolio/App.java rename to src/main/java/net/ironoc/portfolio/App.java index a8d2455..92ad451 100644 --- a/src/main/java/com/ironoc/portfolio/App.java +++ b/src/main/java/net/ironoc/portfolio/App.java @@ -1,4 +1,4 @@ -package com.ironoc.portfolio; +package net.ironoc.portfolio; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; diff --git a/src/main/java/com/ironoc/portfolio/aws/AwsSecretManager.java b/src/main/java/net/ironoc/portfolio/aws/AwsSecretManager.java similarity index 94% rename from src/main/java/com/ironoc/portfolio/aws/AwsSecretManager.java rename to src/main/java/net/ironoc/portfolio/aws/AwsSecretManager.java index 65dbbed..a139c82 100644 --- a/src/main/java/com/ironoc/portfolio/aws/AwsSecretManager.java +++ b/src/main/java/net/ironoc/portfolio/aws/AwsSecretManager.java @@ -1,8 +1,8 @@ -package com.ironoc.portfolio.aws; +package net.ironoc.portfolio.aws; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; -import com.ironoc.portfolio.logger.AbstractLogger; +import net.ironoc.portfolio.logger.AbstractLogger; import org.springframework.stereotype.Component; import software.amazon.awssdk.regions.Region; import software.amazon.awssdk.services.secretsmanager.SecretsManagerClient; diff --git a/src/main/java/com/ironoc/portfolio/aws/SecretManager.java b/src/main/java/net/ironoc/portfolio/aws/SecretManager.java similarity index 65% rename from src/main/java/com/ironoc/portfolio/aws/SecretManager.java rename to src/main/java/net/ironoc/portfolio/aws/SecretManager.java index 41bdaf2..bc82349 100644 --- a/src/main/java/com/ironoc/portfolio/aws/SecretManager.java +++ b/src/main/java/net/ironoc/portfolio/aws/SecretManager.java @@ -1,4 +1,4 @@ -package com.ironoc.portfolio.aws; +package net.ironoc.portfolio.aws; public interface SecretManager { diff --git a/src/main/java/com/ironoc/portfolio/client/Client.java b/src/main/java/net/ironoc/portfolio/client/Client.java similarity index 92% rename from src/main/java/com/ironoc/portfolio/client/Client.java rename to src/main/java/net/ironoc/portfolio/client/Client.java index b1d21eb..a8fbc57 100644 --- a/src/main/java/com/ironoc/portfolio/client/Client.java +++ b/src/main/java/net/ironoc/portfolio/client/Client.java @@ -1,4 +1,4 @@ -package com.ironoc.portfolio.client; +package net.ironoc.portfolio.client; import javax.net.ssl.HttpsURLConnection; import java.io.IOException; diff --git a/src/main/java/com/ironoc/portfolio/client/GitClient.java b/src/main/java/net/ironoc/portfolio/client/GitClient.java similarity index 95% rename from src/main/java/com/ironoc/portfolio/client/GitClient.java rename to src/main/java/net/ironoc/portfolio/client/GitClient.java index 8fd230c..d7a816f 100644 --- a/src/main/java/com/ironoc/portfolio/client/GitClient.java +++ b/src/main/java/net/ironoc/portfolio/client/GitClient.java @@ -1,11 +1,11 @@ -package com.ironoc.portfolio.client; +package net.ironoc.portfolio.client; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.type.CollectionType; -import com.ironoc.portfolio.aws.SecretManager; -import com.ironoc.portfolio.config.PropertyConfigI; -import com.ironoc.portfolio.logger.AbstractLogger; -import com.ironoc.portfolio.utils.UrlUtils; +import net.ironoc.portfolio.aws.SecretManager; +import net.ironoc.portfolio.config.PropertyConfigI; +import net.ironoc.portfolio.logger.AbstractLogger; +import net.ironoc.portfolio.utils.UrlUtils; import lombok.extern.slf4j.Slf4j; import org.apache.commons.io.IOUtils; import org.apache.commons.lang3.StringUtils; diff --git a/src/main/java/com/ironoc/portfolio/config/IronocConfiguration.java b/src/main/java/net/ironoc/portfolio/config/IronocConfiguration.java similarity index 95% rename from src/main/java/com/ironoc/portfolio/config/IronocConfiguration.java rename to src/main/java/net/ironoc/portfolio/config/IronocConfiguration.java index e55b9bc..2948858 100644 --- a/src/main/java/com/ironoc/portfolio/config/IronocConfiguration.java +++ b/src/main/java/net/ironoc/portfolio/config/IronocConfiguration.java @@ -1,4 +1,4 @@ -package com.ironoc.portfolio.config; +package net.ironoc.portfolio.config; import com.fasterxml.jackson.databind.ObjectMapper; import org.springframework.boot.web.server.WebServerFactoryCustomizer; @@ -17,7 +17,7 @@ @Configuration @EnableAsync @EnableScheduling -@ComponentScan(basePackages = { "com.ironoc.portfolio" }) +@ComponentScan(basePackages = { "net.ironoc.portfolio" }) public class IronocConfiguration implements WebMvcConfigurer { @Override diff --git a/src/main/java/net/ironoc/portfolio/config/Properties.java b/src/main/java/net/ironoc/portfolio/config/Properties.java new file mode 100644 index 0000000..858c9b9 --- /dev/null +++ b/src/main/java/net/ironoc/portfolio/config/Properties.java @@ -0,0 +1,20 @@ +package net.ironoc.portfolio.config; + +import lombok.Getter; + +@Getter +public enum Properties { + + GIT_API_ENDPOINT_REPOS("net.ironoc.portfolio.github.api.endpoint.repos"), + GIT_API_ENDPOINT_ISSUES("net.ironoc.portfolio.github.api.endpoint.issues"), + GIT_TIMEOUT_CONNECT ("net.ironoc.portfolio.github.timeout.connect"), + GIT_TIMEOUT_READ("net.ironoc.portfolio.github.timeout.read"), + GIT_INSTANCE_FOLLOW_REDIRECTS("net.ironoc.portfolio.github.instance-follow-redirects"), + GIT_FOLLOW_REDIRECTS("net.ironoc.portfolio.github.follow-redirects"); + + private String key; + + Properties(String key) { + this.key = key; + } +} diff --git a/src/main/java/com/ironoc/portfolio/config/PropertyConfig.java b/src/main/java/net/ironoc/portfolio/config/PropertyConfig.java similarity index 97% rename from src/main/java/com/ironoc/portfolio/config/PropertyConfig.java rename to src/main/java/net/ironoc/portfolio/config/PropertyConfig.java index 4cd014d..1ed9c4f 100644 --- a/src/main/java/com/ironoc/portfolio/config/PropertyConfig.java +++ b/src/main/java/net/ironoc/portfolio/config/PropertyConfig.java @@ -1,4 +1,4 @@ -package com.ironoc.portfolio.config; +package net.ironoc.portfolio.config; import org.springframework.core.env.Environment; import org.springframework.stereotype.Component; diff --git a/src/main/java/com/ironoc/portfolio/config/PropertyConfigI.java b/src/main/java/net/ironoc/portfolio/config/PropertyConfigI.java similarity index 87% rename from src/main/java/com/ironoc/portfolio/config/PropertyConfigI.java rename to src/main/java/net/ironoc/portfolio/config/PropertyConfigI.java index e895ccc..2b66866 100644 --- a/src/main/java/com/ironoc/portfolio/config/PropertyConfigI.java +++ b/src/main/java/net/ironoc/portfolio/config/PropertyConfigI.java @@ -1,4 +1,4 @@ -package com.ironoc.portfolio.config; +package net.ironoc.portfolio.config; public interface PropertyConfigI { diff --git a/src/main/java/com/ironoc/portfolio/config/PropertyKey.java b/src/main/java/net/ironoc/portfolio/config/PropertyKey.java similarity index 95% rename from src/main/java/com/ironoc/portfolio/config/PropertyKey.java rename to src/main/java/net/ironoc/portfolio/config/PropertyKey.java index ab4a751..0007f40 100644 --- a/src/main/java/com/ironoc/portfolio/config/PropertyKey.java +++ b/src/main/java/net/ironoc/portfolio/config/PropertyKey.java @@ -1,4 +1,4 @@ -package com.ironoc.portfolio.config; +package net.ironoc.portfolio.config; import org.springframework.stereotype.Component; diff --git a/src/main/java/com/ironoc/portfolio/config/PropertyKeyI.java b/src/main/java/net/ironoc/portfolio/config/PropertyKeyI.java similarity index 87% rename from src/main/java/com/ironoc/portfolio/config/PropertyKeyI.java rename to src/main/java/net/ironoc/portfolio/config/PropertyKeyI.java index 1c1351d..def48bd 100644 --- a/src/main/java/com/ironoc/portfolio/config/PropertyKeyI.java +++ b/src/main/java/net/ironoc/portfolio/config/PropertyKeyI.java @@ -1,4 +1,4 @@ -package com.ironoc.portfolio.config; +package net.ironoc.portfolio.config; public interface PropertyKeyI { diff --git a/src/main/java/com/ironoc/portfolio/config/PushStateResourceResolver.java b/src/main/java/net/ironoc/portfolio/config/PushStateResourceResolver.java similarity index 96% rename from src/main/java/com/ironoc/portfolio/config/PushStateResourceResolver.java rename to src/main/java/net/ironoc/portfolio/config/PushStateResourceResolver.java index a1b43e9..37aa24a 100644 --- a/src/main/java/com/ironoc/portfolio/config/PushStateResourceResolver.java +++ b/src/main/java/net/ironoc/portfolio/config/PushStateResourceResolver.java @@ -1,6 +1,6 @@ -package com.ironoc.portfolio.config; +package net.ironoc.portfolio.config; -import com.ironoc.portfolio.logger.AbstractLogger; +import net.ironoc.portfolio.logger.AbstractLogger; import jakarta.servlet.http.HttpServletRequest; import org.springframework.core.io.ClassPathResource; import org.springframework.core.io.Resource; diff --git a/src/main/java/com/ironoc/portfolio/controller/GitProjectsController.java b/src/main/java/net/ironoc/portfolio/controller/GitProjectsController.java similarity index 94% rename from src/main/java/com/ironoc/portfolio/controller/GitProjectsController.java rename to src/main/java/net/ironoc/portfolio/controller/GitProjectsController.java index c7788b5..f85964f 100644 --- a/src/main/java/com/ironoc/portfolio/controller/GitProjectsController.java +++ b/src/main/java/net/ironoc/portfolio/controller/GitProjectsController.java @@ -1,11 +1,11 @@ -package com.ironoc.portfolio.controller; +package net.ironoc.portfolio.controller; -import com.ironoc.portfolio.domain.RepositoryDetailDomain; -import com.ironoc.portfolio.domain.RepositoryIssueDomain; -import com.ironoc.portfolio.dto.RepositoryDetailDto; -import com.ironoc.portfolio.dto.RepositoryIssueDto; -import com.ironoc.portfolio.logger.AbstractLogger; -import com.ironoc.portfolio.service.GitDetailsService; +import net.ironoc.portfolio.domain.RepositoryDetailDomain; +import net.ironoc.portfolio.domain.RepositoryIssueDomain; +import net.ironoc.portfolio.dto.RepositoryDetailDto; +import net.ironoc.portfolio.dto.RepositoryIssueDto; +import net.ironoc.portfolio.logger.AbstractLogger; +import net.ironoc.portfolio.service.GitDetailsService; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; diff --git a/src/main/java/com/ironoc/portfolio/domain/RepositoryDetailDomain.java b/src/main/java/net/ironoc/portfolio/domain/RepositoryDetailDomain.java similarity index 97% rename from src/main/java/com/ironoc/portfolio/domain/RepositoryDetailDomain.java rename to src/main/java/net/ironoc/portfolio/domain/RepositoryDetailDomain.java index e4d9539..142d33b 100644 --- a/src/main/java/com/ironoc/portfolio/domain/RepositoryDetailDomain.java +++ b/src/main/java/net/ironoc/portfolio/domain/RepositoryDetailDomain.java @@ -1,4 +1,4 @@ -package com.ironoc.portfolio.domain; +package net.ironoc.portfolio.domain; import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; diff --git a/src/main/java/com/ironoc/portfolio/domain/RepositoryIssueDomain.java b/src/main/java/net/ironoc/portfolio/domain/RepositoryIssueDomain.java similarity index 95% rename from src/main/java/com/ironoc/portfolio/domain/RepositoryIssueDomain.java rename to src/main/java/net/ironoc/portfolio/domain/RepositoryIssueDomain.java index b56095e..2ab9fcc 100644 --- a/src/main/java/com/ironoc/portfolio/domain/RepositoryIssueDomain.java +++ b/src/main/java/net/ironoc/portfolio/domain/RepositoryIssueDomain.java @@ -1,4 +1,4 @@ -package com.ironoc.portfolio.domain; +package net.ironoc.portfolio.domain; import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; diff --git a/src/main/java/com/ironoc/portfolio/dto/OwnerDto.java b/src/main/java/net/ironoc/portfolio/dto/OwnerDto.java similarity index 93% rename from src/main/java/com/ironoc/portfolio/dto/OwnerDto.java rename to src/main/java/net/ironoc/portfolio/dto/OwnerDto.java index 22f88bc..36c149a 100644 --- a/src/main/java/com/ironoc/portfolio/dto/OwnerDto.java +++ b/src/main/java/net/ironoc/portfolio/dto/OwnerDto.java @@ -1,4 +1,4 @@ -package com.ironoc.portfolio.dto; +package net.ironoc.portfolio.dto; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/src/main/java/com/ironoc/portfolio/dto/RepositoryDetailDto.java b/src/main/java/net/ironoc/portfolio/dto/RepositoryDetailDto.java similarity index 97% rename from src/main/java/com/ironoc/portfolio/dto/RepositoryDetailDto.java rename to src/main/java/net/ironoc/portfolio/dto/RepositoryDetailDto.java index 0e6ce1b..78a2232 100644 --- a/src/main/java/com/ironoc/portfolio/dto/RepositoryDetailDto.java +++ b/src/main/java/net/ironoc/portfolio/dto/RepositoryDetailDto.java @@ -1,4 +1,4 @@ -package com.ironoc.portfolio.dto; +package net.ironoc.portfolio.dto; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; diff --git a/src/main/java/com/ironoc/portfolio/dto/RepositoryIssueDto.java b/src/main/java/net/ironoc/portfolio/dto/RepositoryIssueDto.java similarity index 94% rename from src/main/java/com/ironoc/portfolio/dto/RepositoryIssueDto.java rename to src/main/java/net/ironoc/portfolio/dto/RepositoryIssueDto.java index 27c5f9e..4d88ac2 100644 --- a/src/main/java/com/ironoc/portfolio/dto/RepositoryIssueDto.java +++ b/src/main/java/net/ironoc/portfolio/dto/RepositoryIssueDto.java @@ -1,4 +1,4 @@ -package com.ironoc.portfolio.dto; +package net.ironoc.portfolio.dto; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; diff --git a/src/main/java/com/ironoc/portfolio/job/GitDetailsJob.java b/src/main/java/net/ironoc/portfolio/job/GitDetailsJob.java similarity index 87% rename from src/main/java/com/ironoc/portfolio/job/GitDetailsJob.java rename to src/main/java/net/ironoc/portfolio/job/GitDetailsJob.java index cfeb3e1..8163b42 100644 --- a/src/main/java/com/ironoc/portfolio/job/GitDetailsJob.java +++ b/src/main/java/net/ironoc/portfolio/job/GitDetailsJob.java @@ -1,7 +1,7 @@ -package com.ironoc.portfolio.job; +package net.ironoc.portfolio.job; -import com.ironoc.portfolio.service.GitRepoCache; -import com.ironoc.portfolio.service.GitDetails; +import net.ironoc.portfolio.service.GitRepoCache; +import net.ironoc.portfolio.service.GitDetails; import jakarta.annotation.PostConstruct; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.scheduling.annotation.Scheduled; diff --git a/src/main/java/com/ironoc/portfolio/job/GitDetailsRunnable.java b/src/main/java/net/ironoc/portfolio/job/GitDetailsRunnable.java similarity index 75% rename from src/main/java/com/ironoc/portfolio/job/GitDetailsRunnable.java rename to src/main/java/net/ironoc/portfolio/job/GitDetailsRunnable.java index 0115300..db41774 100644 --- a/src/main/java/com/ironoc/portfolio/job/GitDetailsRunnable.java +++ b/src/main/java/net/ironoc/portfolio/job/GitDetailsRunnable.java @@ -1,9 +1,9 @@ -package com.ironoc.portfolio.job; +package net.ironoc.portfolio.job; -import com.ironoc.portfolio.logger.AbstractLogger; -import com.ironoc.portfolio.service.GitRepoCache; -import com.ironoc.portfolio.dto.RepositoryDetailDto; -import com.ironoc.portfolio.service.GitDetails; +import net.ironoc.portfolio.logger.AbstractLogger; +import net.ironoc.portfolio.service.GitRepoCache; +import net.ironoc.portfolio.dto.RepositoryDetailDto; +import net.ironoc.portfolio.service.GitDetails; import jakarta.annotation.PreDestroy; import lombok.Getter; @@ -39,11 +39,13 @@ private Set populateUserIds() { @Override public void run() { info("GitDetailsRunnable running for userIds={}", getUserIds()); + gitRepoCache.clear(); for (String userId : userIds) { List dtos = gitDetails.getRepoDetails(userId); - info("-----Running GIT details job for userIds={}, repositoryDetailDtos={}", getUserIds(), dtos); + info("Running GIT details job for userIds={}, repositoryDetailDtos={}", getUserIds(), dtos); gitRepoCache.put(userId, gitDetails.mapRepositoriesToResponse(dtos)); } + info("GitDetailsRunnable completed for userIds={}", getUserIds()); } @PreDestroy diff --git a/src/main/java/com/ironoc/portfolio/logger/AbstractLogger.java b/src/main/java/net/ironoc/portfolio/logger/AbstractLogger.java similarity index 93% rename from src/main/java/com/ironoc/portfolio/logger/AbstractLogger.java rename to src/main/java/net/ironoc/portfolio/logger/AbstractLogger.java index 8e707c7..17193bd 100644 --- a/src/main/java/com/ironoc/portfolio/logger/AbstractLogger.java +++ b/src/main/java/net/ironoc/portfolio/logger/AbstractLogger.java @@ -1,4 +1,4 @@ -package com.ironoc.portfolio.logger; +package net.ironoc.portfolio.logger; import lombok.extern.slf4j.Slf4j; diff --git a/src/main/java/com/ironoc/portfolio/logger/LoggerI.java b/src/main/java/net/ironoc/portfolio/logger/LoggerI.java similarity index 86% rename from src/main/java/com/ironoc/portfolio/logger/LoggerI.java rename to src/main/java/net/ironoc/portfolio/logger/LoggerI.java index de9f632..262d5e1 100644 --- a/src/main/java/com/ironoc/portfolio/logger/LoggerI.java +++ b/src/main/java/net/ironoc/portfolio/logger/LoggerI.java @@ -1,4 +1,4 @@ -package com.ironoc.portfolio.logger; +package net.ironoc.portfolio.logger; public interface LoggerI { diff --git a/src/main/java/com/ironoc/portfolio/service/GitDetails.java b/src/main/java/net/ironoc/portfolio/service/GitDetails.java similarity index 67% rename from src/main/java/com/ironoc/portfolio/service/GitDetails.java rename to src/main/java/net/ironoc/portfolio/service/GitDetails.java index 8df6753..d1b37da 100644 --- a/src/main/java/com/ironoc/portfolio/service/GitDetails.java +++ b/src/main/java/net/ironoc/portfolio/service/GitDetails.java @@ -1,9 +1,9 @@ -package com.ironoc.portfolio.service; +package net.ironoc.portfolio.service; -import com.ironoc.portfolio.domain.RepositoryDetailDomain; -import com.ironoc.portfolio.domain.RepositoryIssueDomain; -import com.ironoc.portfolio.dto.RepositoryDetailDto; -import com.ironoc.portfolio.dto.RepositoryIssueDto; +import net.ironoc.portfolio.domain.RepositoryDetailDomain; +import net.ironoc.portfolio.domain.RepositoryIssueDomain; +import net.ironoc.portfolio.dto.RepositoryDetailDto; +import net.ironoc.portfolio.dto.RepositoryIssueDto; import java.util.List; diff --git a/src/main/java/com/ironoc/portfolio/service/GitDetailsService.java b/src/main/java/net/ironoc/portfolio/service/GitDetailsService.java similarity index 91% rename from src/main/java/com/ironoc/portfolio/service/GitDetailsService.java rename to src/main/java/net/ironoc/portfolio/service/GitDetailsService.java index bd5b8eb..bc88f41 100644 --- a/src/main/java/com/ironoc/portfolio/service/GitDetailsService.java +++ b/src/main/java/net/ironoc/portfolio/service/GitDetailsService.java @@ -1,15 +1,15 @@ -package com.ironoc.portfolio.service; +package net.ironoc.portfolio.service; -import com.ironoc.portfolio.client.Client; -import com.ironoc.portfolio.config.PropertyConfigI; -import com.ironoc.portfolio.domain.RepositoryDetailDomain; -import com.ironoc.portfolio.domain.RepositoryIssueDomain; -import com.ironoc.portfolio.dto.RepositoryDetailDto; -import com.ironoc.portfolio.dto.RepositoryIssueDto; -import com.ironoc.portfolio.job.GitDetailsRunnable; -import com.ironoc.portfolio.logger.AbstractLogger; -import com.ironoc.portfolio.utils.UrlUtils; +import net.ironoc.portfolio.client.Client; +import net.ironoc.portfolio.config.PropertyConfigI; +import net.ironoc.portfolio.domain.RepositoryDetailDomain; +import net.ironoc.portfolio.domain.RepositoryIssueDomain; +import net.ironoc.portfolio.dto.RepositoryDetailDto; +import net.ironoc.portfolio.dto.RepositoryIssueDto; +import net.ironoc.portfolio.job.GitDetailsRunnable; +import net.ironoc.portfolio.logger.AbstractLogger; +import net.ironoc.portfolio.utils.UrlUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpMethod; diff --git a/src/main/java/com/ironoc/portfolio/service/GitRepoCache.java b/src/main/java/net/ironoc/portfolio/service/GitRepoCache.java similarity index 62% rename from src/main/java/com/ironoc/portfolio/service/GitRepoCache.java rename to src/main/java/net/ironoc/portfolio/service/GitRepoCache.java index e8c3cf1..b150c14 100644 --- a/src/main/java/com/ironoc/portfolio/service/GitRepoCache.java +++ b/src/main/java/net/ironoc/portfolio/service/GitRepoCache.java @@ -1,7 +1,6 @@ -package com.ironoc.portfolio.service; +package net.ironoc.portfolio.service; -import com.ironoc.portfolio.domain.RepositoryDetailDomain; -import com.ironoc.portfolio.dto.RepositoryDetailDto; +import net.ironoc.portfolio.domain.RepositoryDetailDomain; import org.springframework.stereotype.Service; import java.util.List; @@ -12,4 +11,6 @@ public interface GitRepoCache { void put(String userId, List repositoryDetails); List get(String userId); + + void clear(); } diff --git a/src/main/java/com/ironoc/portfolio/service/GitRepoCacheService.java b/src/main/java/net/ironoc/portfolio/service/GitRepoCacheService.java similarity index 79% rename from src/main/java/com/ironoc/portfolio/service/GitRepoCacheService.java rename to src/main/java/net/ironoc/portfolio/service/GitRepoCacheService.java index ea3caaf..2f9dd7d 100644 --- a/src/main/java/com/ironoc/portfolio/service/GitRepoCacheService.java +++ b/src/main/java/net/ironoc/portfolio/service/GitRepoCacheService.java @@ -1,6 +1,6 @@ -package com.ironoc.portfolio.service; +package net.ironoc.portfolio.service; -import com.ironoc.portfolio.domain.RepositoryDetailDomain; +import net.ironoc.portfolio.domain.RepositoryDetailDomain; import jakarta.annotation.PreDestroy; import org.springframework.stereotype.Service; @@ -27,8 +27,13 @@ public List get(String userId) { return userGitDetails.get(userId); } - @PreDestroy - public void tearDown() { + @Override + public void clear() { this.userGitDetails.clear(); } + + @PreDestroy + private void tearDown() { + this.clear(); + } } diff --git a/src/main/java/com/ironoc/portfolio/utils/UrlUtils.java b/src/main/java/net/ironoc/portfolio/utils/UrlUtils.java similarity index 82% rename from src/main/java/com/ironoc/portfolio/utils/UrlUtils.java rename to src/main/java/net/ironoc/portfolio/utils/UrlUtils.java index a8c98e4..fd6ae0f 100644 --- a/src/main/java/com/ironoc/portfolio/utils/UrlUtils.java +++ b/src/main/java/net/ironoc/portfolio/utils/UrlUtils.java @@ -1,6 +1,6 @@ -package com.ironoc.portfolio.utils; +package net.ironoc.portfolio.utils; -import com.ironoc.portfolio.logger.AbstractLogger; +import net.ironoc.portfolio.logger.AbstractLogger; import org.springframework.stereotype.Component; import java.net.URL; diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 3ab6acd..7a6f1b1 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -1,4 +1,4 @@ -com: +net: ironoc: portfolio: github: diff --git a/src/test/java/com/ironoc/portfolio/AppTest.java b/src/test/java/net/ironoc/portfolio/AppTest.java similarity index 95% rename from src/test/java/com/ironoc/portfolio/AppTest.java rename to src/test/java/net/ironoc/portfolio/AppTest.java index 09a03cc..e6f7009 100644 --- a/src/test/java/com/ironoc/portfolio/AppTest.java +++ b/src/test/java/net/ironoc/portfolio/AppTest.java @@ -1,4 +1,4 @@ -package com.ironoc.portfolio; +package net.ironoc.portfolio; import org.junit.jupiter.api.Test; import org.mockito.MockedStatic; diff --git a/src/test/java/com/ironoc/portfolio/aws/AwsSecretManagerTest.java b/src/test/java/net/ironoc/portfolio/aws/AwsSecretManagerTest.java similarity index 95% rename from src/test/java/com/ironoc/portfolio/aws/AwsSecretManagerTest.java rename to src/test/java/net/ironoc/portfolio/aws/AwsSecretManagerTest.java index e8d84c6..e2e7938 100644 --- a/src/test/java/com/ironoc/portfolio/aws/AwsSecretManagerTest.java +++ b/src/test/java/net/ironoc/portfolio/aws/AwsSecretManagerTest.java @@ -1,4 +1,4 @@ -package com.ironoc.portfolio.aws; +package net.ironoc.portfolio.aws; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/src/test/java/com/ironoc/portfolio/client/GitClientTest.java b/src/test/java/net/ironoc/portfolio/client/GitClientTest.java similarity index 98% rename from src/test/java/com/ironoc/portfolio/client/GitClientTest.java rename to src/test/java/net/ironoc/portfolio/client/GitClientTest.java index 4a8a714..e74ec14 100644 --- a/src/test/java/com/ironoc/portfolio/client/GitClientTest.java +++ b/src/test/java/net/ironoc/portfolio/client/GitClientTest.java @@ -1,9 +1,9 @@ -package com.ironoc.portfolio.client; +package net.ironoc.portfolio.client; -import com.ironoc.portfolio.aws.SecretManager; -import com.ironoc.portfolio.config.PropertyConfigI; -import com.ironoc.portfolio.dto.RepositoryDetailDto; -import com.ironoc.portfolio.utils.UrlUtils; +import net.ironoc.portfolio.aws.SecretManager; +import net.ironoc.portfolio.config.PropertyConfigI; +import net.ironoc.portfolio.dto.RepositoryDetailDto; +import net.ironoc.portfolio.utils.UrlUtils; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.InjectMocks; diff --git a/src/test/java/com/ironoc/portfolio/config/IronocConfigurationTest.java b/src/test/java/net/ironoc/portfolio/config/IronocConfigurationTest.java similarity index 99% rename from src/test/java/com/ironoc/portfolio/config/IronocConfigurationTest.java rename to src/test/java/net/ironoc/portfolio/config/IronocConfigurationTest.java index d3bfc26..b849db4 100644 --- a/src/test/java/com/ironoc/portfolio/config/IronocConfigurationTest.java +++ b/src/test/java/net/ironoc/portfolio/config/IronocConfigurationTest.java @@ -1,4 +1,4 @@ -package com.ironoc.portfolio.config; +package net.ironoc.portfolio.config; import com.fasterxml.jackson.databind.ObjectMapper; import org.junit.jupiter.api.Test; diff --git a/src/test/java/com/ironoc/portfolio/config/PropertyConfigTest.java b/src/test/java/net/ironoc/portfolio/config/PropertyConfigTest.java similarity index 99% rename from src/test/java/com/ironoc/portfolio/config/PropertyConfigTest.java rename to src/test/java/net/ironoc/portfolio/config/PropertyConfigTest.java index 991d5c5..dfbea21 100644 --- a/src/test/java/com/ironoc/portfolio/config/PropertyConfigTest.java +++ b/src/test/java/net/ironoc/portfolio/config/PropertyConfigTest.java @@ -1,4 +1,4 @@ -package com.ironoc.portfolio.config; +package net.ironoc.portfolio.config; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/src/test/java/com/ironoc/portfolio/config/PropertyKeyTest.java b/src/test/java/net/ironoc/portfolio/config/PropertyKeyTest.java similarity index 78% rename from src/test/java/com/ironoc/portfolio/config/PropertyKeyTest.java rename to src/test/java/net/ironoc/portfolio/config/PropertyKeyTest.java index 3acbaf4..0a23561 100644 --- a/src/test/java/com/ironoc/portfolio/config/PropertyKeyTest.java +++ b/src/test/java/net/ironoc/portfolio/config/PropertyKeyTest.java @@ -1,4 +1,4 @@ -package com.ironoc.portfolio.config; +package net.ironoc.portfolio.config; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; @@ -20,7 +20,7 @@ public void test_getGitApiEndpointIssues_success() { String result = propertyKey.getGitApiEndpointIssues(); // then - assertThat(result, is("com.ironoc.portfolio.github.api.endpoint.issues")); + assertThat(result, is("net.ironoc.portfolio.github.api.endpoint.issues")); } @Test @@ -29,7 +29,7 @@ public void test_getGitApiEndpointRepos_success() { String result = propertyKey.getGitApiEndpointRepos(); // then - assertThat(result, is("com.ironoc.portfolio.github.api.endpoint.repos")); + assertThat(result, is("net.ironoc.portfolio.github.api.endpoint.repos")); } @Test @@ -38,7 +38,7 @@ public void test_getGitFollowRedirects_success() { String result = propertyKey.getGitFollowRedirects(); // then - assertThat(result, is("com.ironoc.portfolio.github.follow-redirects")); + assertThat(result, is("net.ironoc.portfolio.github.follow-redirects")); } @Test @@ -47,7 +47,7 @@ public void test_getGitTimeoutRead_success() { String result = propertyKey.getGitTimeoutRead(); // then - assertThat(result, is("com.ironoc.portfolio.github.timeout.read")); + assertThat(result, is("net.ironoc.portfolio.github.timeout.read")); } @Test @@ -56,7 +56,7 @@ public void test_getGitTimeoutConnect_success() { String result = propertyKey.getGitTimeoutConnect(); // then - assertThat(result, is("com.ironoc.portfolio.github.timeout.connect")); + assertThat(result, is("net.ironoc.portfolio.github.timeout.connect")); } @Test @@ -65,6 +65,6 @@ public void test_getGitInstanceFollowRedirects_success() { String result = propertyKey.getGitInstanceFollowRedirects(); // then - assertThat(result, is("com.ironoc.portfolio.github.instance-follow-redirects")); + assertThat(result, is("net.ironoc.portfolio.github.instance-follow-redirects")); } } diff --git a/src/test/java/com/ironoc/portfolio/config/PushStateResourceResolverTest.java b/src/test/java/net/ironoc/portfolio/config/PushStateResourceResolverTest.java similarity index 99% rename from src/test/java/com/ironoc/portfolio/config/PushStateResourceResolverTest.java rename to src/test/java/net/ironoc/portfolio/config/PushStateResourceResolverTest.java index c060382..37ca753 100644 --- a/src/test/java/com/ironoc/portfolio/config/PushStateResourceResolverTest.java +++ b/src/test/java/net/ironoc/portfolio/config/PushStateResourceResolverTest.java @@ -1,4 +1,4 @@ -package com.ironoc.portfolio.config; +package net.ironoc.portfolio.config; import jakarta.servlet.http.HttpServletRequest; import org.junit.jupiter.api.BeforeEach; diff --git a/src/test/java/com/ironoc/portfolio/config/TestIronocConfiguration.java b/src/test/java/net/ironoc/portfolio/config/TestIronocConfiguration.java similarity index 88% rename from src/test/java/com/ironoc/portfolio/config/TestIronocConfiguration.java rename to src/test/java/net/ironoc/portfolio/config/TestIronocConfiguration.java index 7d45894..09771e2 100644 --- a/src/test/java/com/ironoc/portfolio/config/TestIronocConfiguration.java +++ b/src/test/java/net/ironoc/portfolio/config/TestIronocConfiguration.java @@ -1,4 +1,4 @@ -package com.ironoc.portfolio.config; +package net.ironoc.portfolio.config; import org.springframework.beans.BeansException; import org.springframework.boot.test.context.TestConfiguration; @@ -8,7 +8,7 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; @TestConfiguration -@ComponentScan(basePackages = { "com.ironoc.portfolio" }) +@ComponentScan(basePackages = { "net.ironoc.portfolio" }) public class TestIronocConfiguration implements WebMvcConfigurer, ApplicationContextAware { private ApplicationContext applicationContext; diff --git a/src/test/java/com/ironoc/portfolio/controller/GitProjectsControllerIntegrationTest.java b/src/test/java/net/ironoc/portfolio/controller/GitProjectsControllerIntegrationTest.java similarity index 97% rename from src/test/java/com/ironoc/portfolio/controller/GitProjectsControllerIntegrationTest.java rename to src/test/java/net/ironoc/portfolio/controller/GitProjectsControllerIntegrationTest.java index 33fc8b9..91e045f 100644 --- a/src/test/java/com/ironoc/portfolio/controller/GitProjectsControllerIntegrationTest.java +++ b/src/test/java/net/ironoc/portfolio/controller/GitProjectsControllerIntegrationTest.java @@ -1,10 +1,10 @@ -package com.ironoc.portfolio.controller; +package net.ironoc.portfolio.controller; import com.fasterxml.jackson.databind.ObjectMapper; -import com.ironoc.portfolio.config.TestIronocConfiguration; -import com.ironoc.portfolio.dto.RepositoryDetailDto; -import com.ironoc.portfolio.dto.RepositoryIssueDto; -import com.ironoc.portfolio.service.GitDetailsService; +import net.ironoc.portfolio.config.TestIronocConfiguration; +import net.ironoc.portfolio.dto.RepositoryDetailDto; +import net.ironoc.portfolio.dto.RepositoryIssueDto; +import net.ironoc.portfolio.service.GitDetailsService; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInstance; diff --git a/src/test/java/com/ironoc/portfolio/controller/GitProjectsControllerTest.java b/src/test/java/net/ironoc/portfolio/controller/GitProjectsControllerTest.java similarity index 97% rename from src/test/java/com/ironoc/portfolio/controller/GitProjectsControllerTest.java rename to src/test/java/net/ironoc/portfolio/controller/GitProjectsControllerTest.java index 3810b42..a1a45fa 100644 --- a/src/test/java/com/ironoc/portfolio/controller/GitProjectsControllerTest.java +++ b/src/test/java/net/ironoc/portfolio/controller/GitProjectsControllerTest.java @@ -1,8 +1,8 @@ -package com.ironoc.portfolio.controller; +package net.ironoc.portfolio.controller; -import com.ironoc.portfolio.domain.RepositoryDetailDomain; -import com.ironoc.portfolio.domain.RepositoryIssueDomain; -import com.ironoc.portfolio.service.GitDetailsService; +import net.ironoc.portfolio.domain.RepositoryDetailDomain; +import net.ironoc.portfolio.domain.RepositoryIssueDomain; +import net.ironoc.portfolio.service.GitDetailsService; import jakarta.servlet.http.HttpServletRequest; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/src/test/java/com/ironoc/portfolio/job/GitDetailsJobTest.java b/src/test/java/net/ironoc/portfolio/job/GitDetailsJobTest.java similarity index 89% rename from src/test/java/com/ironoc/portfolio/job/GitDetailsJobTest.java rename to src/test/java/net/ironoc/portfolio/job/GitDetailsJobTest.java index b5f83e6..80c3f55 100644 --- a/src/test/java/com/ironoc/portfolio/job/GitDetailsJobTest.java +++ b/src/test/java/net/ironoc/portfolio/job/GitDetailsJobTest.java @@ -1,7 +1,7 @@ -package com.ironoc.portfolio.job; +package net.ironoc.portfolio.job; -import com.ironoc.portfolio.service.GitDetails; -import com.ironoc.portfolio.service.GitRepoCache; +import net.ironoc.portfolio.service.GitDetails; +import net.ironoc.portfolio.service.GitRepoCache; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.InjectMocks; diff --git a/src/test/java/com/ironoc/portfolio/job/GitDetailsRunnableTest.java b/src/test/java/net/ironoc/portfolio/job/GitDetailsRunnableTest.java similarity index 90% rename from src/test/java/com/ironoc/portfolio/job/GitDetailsRunnableTest.java rename to src/test/java/net/ironoc/portfolio/job/GitDetailsRunnableTest.java index 2cceae4..b7fedb2 100644 --- a/src/test/java/com/ironoc/portfolio/job/GitDetailsRunnableTest.java +++ b/src/test/java/net/ironoc/portfolio/job/GitDetailsRunnableTest.java @@ -1,7 +1,7 @@ -package com.ironoc.portfolio.job; +package net.ironoc.portfolio.job; -import com.ironoc.portfolio.service.GitDetails; -import com.ironoc.portfolio.service.GitRepoCache; +import net.ironoc.portfolio.service.GitDetails; +import net.ironoc.portfolio.service.GitRepoCache; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.InjectMocks; diff --git a/src/test/java/com/ironoc/portfolio/service/GitDetailsServiceTest.java b/src/test/java/net/ironoc/portfolio/service/GitDetailsServiceTest.java similarity index 97% rename from src/test/java/com/ironoc/portfolio/service/GitDetailsServiceTest.java rename to src/test/java/net/ironoc/portfolio/service/GitDetailsServiceTest.java index afe3cf2..beb0797 100644 --- a/src/test/java/com/ironoc/portfolio/service/GitDetailsServiceTest.java +++ b/src/test/java/net/ironoc/portfolio/service/GitDetailsServiceTest.java @@ -1,15 +1,15 @@ -package com.ironoc.portfolio.service; +package net.ironoc.portfolio.service; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.type.CollectionType; -import com.ironoc.portfolio.client.Client; -import com.ironoc.portfolio.config.PropertyConfigI; -import com.ironoc.portfolio.domain.RepositoryDetailDomain; -import com.ironoc.portfolio.domain.RepositoryIssueDomain; -import com.ironoc.portfolio.dto.RepositoryDetailDto; -import com.ironoc.portfolio.dto.RepositoryIssueDto; -import com.ironoc.portfolio.job.GitDetailsRunnable; -import com.ironoc.portfolio.utils.UrlUtils; +import net.ironoc.portfolio.client.Client; +import net.ironoc.portfolio.config.PropertyConfigI; +import net.ironoc.portfolio.domain.RepositoryDetailDomain; +import net.ironoc.portfolio.domain.RepositoryIssueDomain; +import net.ironoc.portfolio.dto.RepositoryDetailDto; +import net.ironoc.portfolio.dto.RepositoryIssueDto; +import net.ironoc.portfolio.job.GitDetailsRunnable; +import net.ironoc.portfolio.utils.UrlUtils; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.InjectMocks; diff --git a/src/test/java/com/ironoc/portfolio/service/GitRepoCacheServiceTest.java b/src/test/java/net/ironoc/portfolio/service/GitRepoCacheServiceTest.java similarity index 91% rename from src/test/java/com/ironoc/portfolio/service/GitRepoCacheServiceTest.java rename to src/test/java/net/ironoc/portfolio/service/GitRepoCacheServiceTest.java index 782961d..9dbddc2 100644 --- a/src/test/java/com/ironoc/portfolio/service/GitRepoCacheServiceTest.java +++ b/src/test/java/net/ironoc/portfolio/service/GitRepoCacheServiceTest.java @@ -1,7 +1,7 @@ -package com.ironoc.portfolio.service; +package net.ironoc.portfolio.service; import com.fasterxml.jackson.databind.ObjectMapper; -import com.ironoc.portfolio.domain.RepositoryDetailDomain; +import net.ironoc.portfolio.domain.RepositoryDetailDomain; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.InjectMocks; @@ -66,6 +66,8 @@ public void test_cache_success() throws IOException { assertThat(result2.getRepoUrl(), is("https://github.com/conorheffron/booking-sys")); jsonInputStream.close(); assertThat(results3, is(nullValue())); - gitRepoCacheService.tearDown(); + gitRepoCacheService.clear(); + assertThat(gitRepoCacheService.get("user1"), is(nullValue())); + assertThat(gitRepoCacheService.get("user-2"), is(nullValue())); } } diff --git a/src/test/java/com/ironoc/portfolio/utils/UrlUtilsTest.java b/src/test/java/net/ironoc/portfolio/utils/UrlUtilsTest.java similarity index 95% rename from src/test/java/com/ironoc/portfolio/utils/UrlUtilsTest.java rename to src/test/java/net/ironoc/portfolio/utils/UrlUtilsTest.java index f293b24..831b671 100644 --- a/src/test/java/com/ironoc/portfolio/utils/UrlUtilsTest.java +++ b/src/test/java/net/ironoc/portfolio/utils/UrlUtilsTest.java @@ -1,4 +1,4 @@ -package com.ironoc.portfolio.utils; +package net.ironoc.portfolio.utils; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/src/test/resources/application.yml b/src/test/resources/application.yml index c704067..5a55ee8 100644 --- a/src/test/resources/application.yml +++ b/src/test/resources/application.yml @@ -1,4 +1,4 @@ - spring: +spring: mvc: favicon: - enabled: false \ No newline at end of file + enabled: false