diff options
author | Fiete Ostkamp <Fiete.Ostkamp@telekom.de> | 2023-07-21 13:42:27 +0000 |
---|---|---|
committer | Fiete Ostkamp <Fiete.Ostkamp@telekom.de> | 2023-07-21 13:42:27 +0000 |
commit | 064169dea52b0441b5fe4360f5c6e56da6b0b2a6 (patch) | |
tree | 752dc085f5acecb1564dae71204a68fdd581fd54 /app/src/test/java | |
parent | 5a6ff88ab7f36c3753a14ab642acc585242d3e68 (diff) |
Remove vavr part 2
Issue-ID: PORTALNG-24
Signed-off-by: Fiete Ostkamp <Fiete.Ostkamp@telekom.de>
Change-Id: Ib4e0252610601fadd869ecee1326580aa717ab13
Diffstat (limited to 'app/src/test/java')
-rw-r--r-- | app/src/test/java/org/onap/portal/prefs/BaseIntegrationTest.java | 12 | ||||
-rw-r--r-- | app/src/test/java/org/onap/portal/prefs/TokenGenerator.java | 6 |
2 files changed, 5 insertions, 13 deletions
diff --git a/app/src/test/java/org/onap/portal/prefs/BaseIntegrationTest.java b/app/src/test/java/org/onap/portal/prefs/BaseIntegrationTest.java index 7852c41..104b683 100644 --- a/app/src/test/java/org/onap/portal/prefs/BaseIntegrationTest.java +++ b/app/src/test/java/org/onap/portal/prefs/BaseIntegrationTest.java @@ -30,16 +30,16 @@ import io.restassured.RestAssured; import io.restassured.filter.log.RequestLoggingFilter; import io.restassured.filter.log.ResponseLoggingFilter; import io.restassured.specification.RequestSpecification; -import io.vavr.collection.List; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.web.server.LocalServerPort; +import org.springframework.boot.test.web.server.LocalServerPort; import org.springframework.cloud.contract.wiremock.AutoConfigureWireMock; import org.springframework.http.MediaType; +import java.util.List; import java.util.UUID; /** Base class for all tests that has the common config including port, realm, logging and auth. */ @@ -47,14 +47,6 @@ import java.util.UUID; @AutoConfigureWireMock(port = 0) public abstract class BaseIntegrationTest { -// @TestConfiguration -// public static class Config { -// @Bean -// WireMockConfigurationCustomizer optionsCustomizer() { -// return options -> options.extensions(new ResponseTemplateTransformer(true)); -// } -// } - @LocalServerPort protected int port; @Value("${portal-prefs.realm}") protected String realm; diff --git a/app/src/test/java/org/onap/portal/prefs/TokenGenerator.java b/app/src/test/java/org/onap/portal/prefs/TokenGenerator.java index 6883064..fb3a522 100644 --- a/app/src/test/java/org/onap/portal/prefs/TokenGenerator.java +++ b/app/src/test/java/org/onap/portal/prefs/TokenGenerator.java @@ -24,7 +24,9 @@ package org.onap.portal.prefs; import java.time.Clock; import java.time.Duration; import java.time.Instant; +import java.util.Collections; import java.util.Date; +import java.util.List; import java.util.UUID; import com.nimbusds.jose.JOSEObjectType; @@ -42,7 +44,6 @@ import com.nimbusds.jwt.SignedJWT; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; -import io.vavr.collection.List; import lombok.Builder; import lombok.Getter; import lombok.NonNull; @@ -58,7 +59,6 @@ public class TokenGenerator { private final JWKSet jwkSet; private final JWSSigner signer; - @Autowired public TokenGenerator(Clock clock) { try { this.clock = clock; @@ -121,7 +121,7 @@ public class TokenGenerator { @NonNull @Builder.Default private final Duration expireIn = Duration.ofMinutes(5); - @Builder.Default private final List<String> roles = List.empty(); + @Builder.Default private final List<String> roles = Collections.emptyList(); public String issuer() { return String.format("http://localhost:%d/auth/realms/%s", port, realm); |