From 08c90ec4ef207c61dc767275eeb3908df4342941 Mon Sep 17 00:00:00 2001 From: Daniel Pelaez Date: Sat, 18 May 2024 18:46:39 -0500 Subject: [PATCH] Adding zip packaging and read only profile --- src/assembly/bin.xml | 27 ------------------- .../linkedin/ReadOnlyNoPublishTest.java | 19 +++++++++++++ .../OAuth2CredentialsController.java | 2 ++ 3 files changed, 21 insertions(+), 27 deletions(-) delete mode 100644 src/assembly/bin.xml create mode 100644 src/itest/java/com/coderstower/socialmediapubisher/application/linkedin/ReadOnlyNoPublishTest.java diff --git a/src/assembly/bin.xml b/src/assembly/bin.xml deleted file mode 100644 index 1e08505..0000000 --- a/src/assembly/bin.xml +++ /dev/null @@ -1,27 +0,0 @@ - - lambda-package - - zip - - false - - - - ${project.build.directory}${file.separator}lib - lib - - tomcat-embed* - - - - - ${project.build.directory}${file.separator}classes - - ** - - ${file.separator} - - - \ No newline at end of file diff --git a/src/itest/java/com/coderstower/socialmediapubisher/application/linkedin/ReadOnlyNoPublishTest.java b/src/itest/java/com/coderstower/socialmediapubisher/application/linkedin/ReadOnlyNoPublishTest.java new file mode 100644 index 0000000..d5e7991 --- /dev/null +++ b/src/itest/java/com/coderstower/socialmediapubisher/application/linkedin/ReadOnlyNoPublishTest.java @@ -0,0 +1,19 @@ +package com.coderstower.socialmediapubisher.application.linkedin; + +import com.coderstower.socialmediapubisher.extesion.ITestExtension; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.ActiveProfiles; + + +@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) +@ActiveProfiles("read-only") +@ExtendWith(ITestExtension.class) +public class ReadOnlyNoPublishTest { + + @Test + public void testContext() { + + } +} diff --git a/src/main/java/com/coderstower/socialmediapubisher/application/controller/OAuth2CredentialsController.java b/src/main/java/com/coderstower/socialmediapubisher/application/controller/OAuth2CredentialsController.java index a5ea9c1..880247f 100644 --- a/src/main/java/com/coderstower/socialmediapubisher/application/controller/OAuth2CredentialsController.java +++ b/src/main/java/com/coderstower/socialmediapubisher/application/controller/OAuth2CredentialsController.java @@ -3,6 +3,7 @@ import com.coderstower.socialmediapubisher.domain.security.OAuth2CredentialsManager; import lombok.extern.slf4j.Slf4j; +import org.springframework.context.annotation.Profile; import org.springframework.http.ResponseEntity; import org.springframework.security.oauth2.client.OAuth2AuthorizedClient; import org.springframework.security.oauth2.client.annotation.RegisteredOAuth2AuthorizedClient; @@ -13,6 +14,7 @@ @RestController @Slf4j +@Profile("linkedin") public class OAuth2CredentialsController { private final OAuth2CredentialsManager oAuth2CredentialsManager;