From 064169dea52b0441b5fe4360f5c6e56da6b0b2a6 Mon Sep 17 00:00:00 2001 From: Fiete Ostkamp Date: Fri, 21 Jul 2023 13:42:27 +0000 Subject: Remove vavr part 2 Issue-ID: PORTALNG-24 Signed-off-by: Fiete Ostkamp Change-Id: Ib4e0252610601fadd869ecee1326580aa717ab13 --- .../test/java/org/onap/portal/prefs/BaseIntegrationTest.java | 12 ++---------- app/src/test/java/org/onap/portal/prefs/TokenGenerator.java | 6 +++--- 2 files changed, 5 insertions(+), 13 deletions(-) (limited to 'app/src/test/java/org') 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 roles = List.empty(); + @Builder.Default private final List roles = Collections.emptyList(); public String issuer() { return String.format("http://localhost:%d/auth/realms/%s", port, realm); -- cgit 1.2.3-korg