From 9868f1749ac413b5b7df287d35983bf24ce517ea Mon Sep 17 00:00:00 2001 From: "Benjamin, Max" Date: Mon, 18 May 2020 16:37:51 -0400 Subject: Prepare for java 11 final changes for java11 groovy compatibility removed unnecessary dependencies and cleaned up poms added missing jaxws-api dependency to pom.xml java8 profile is now active by default in parent pom update beans to have RemoteResource annotation always use the compiler plugin from parent pom Update external task timeout to longer value to hold lock update remote resource annotation to match catalog db client add remote resource annotation to bean for bowman completely remove bowman from requests db client Issue-ID: SO-2059 Signed-off-by: Benjamin, Max (mb388a) Change-Id: If6f0df36e8077ccd703abce9f64290daed63955b --- .../so/db/request/client/RequestDbClientTest.java | 26 +++++++++++----------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'mso-api-handlers/mso-requests-db/src/test/java/org') diff --git a/mso-api-handlers/mso-requests-db/src/test/java/org/onap/so/db/request/client/RequestDbClientTest.java b/mso-api-handlers/mso-requests-db/src/test/java/org/onap/so/db/request/client/RequestDbClientTest.java index 0ad8d1458e..32886bf62e 100644 --- a/mso-api-handlers/mso-requests-db/src/test/java/org/onap/so/db/request/client/RequestDbClientTest.java +++ b/mso-api-handlers/mso-requests-db/src/test/java/org/onap/so/db/request/client/RequestDbClientTest.java @@ -1,11 +1,14 @@ package org.onap.so.db.request.client; +import static org.junit.Assert.assertTrue; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.ArgumentMatchers.isA; import static org.mockito.Mockito.times; +import static org.mockito.Mockito.when; import java.net.URI; +import java.util.ArrayList; +import java.util.List; import javax.ws.rs.core.UriBuilder; -import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.InjectMocks; @@ -13,21 +16,14 @@ import org.mockito.Mock; import org.mockito.Mockito; import org.mockito.Spy; import org.mockito.junit.MockitoJUnitRunner; -import org.onap.logging.filter.spring.SpringClientPayloadFilter; import org.onap.so.db.request.beans.InfraActiveRequests; import org.onap.so.db.request.beans.RequestProcessingData; -import org.onap.so.logging.jaxrs.filter.SOSpringClientFilter; -import org.springframework.beans.factory.annotation.Value; +import org.springframework.core.ParameterizedTypeReference; import org.springframework.http.HttpEntity; -import org.springframework.http.HttpHeaders; import org.springframework.http.HttpMethod; +import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; -import org.springframework.http.client.BufferingClientHttpRequestFactory; -import org.springframework.http.client.ClientHttpRequestFactory; -import org.springframework.http.client.HttpComponentsClientHttpRequestFactory; import org.springframework.web.client.RestTemplate; -import uk.co.blackpepper.bowman.ClientFactory; -import uk.co.blackpepper.bowman.Configuration; @RunWith(MockitoJUnitRunner.class) @@ -61,12 +57,16 @@ public class RequestDbClientTest { @Test public void testGetRequestProcessingDataBySoRequestIdAndIsInternalData() { Mockito.doReturn("host").when(requestsDbClient).getEndpoint(); - requestsDbClient.getExternalRequestProcessingDataBySoRequestId("12345"); URI uri = URI.create(UriBuilder .fromUri("host/requestProcessingData/search/findBySoRequestIdAndIsDataInternalOrderByGroupingIdDesc") .queryParam("SO_REQUEST_ID", "12345").queryParam("IS_INTERNAL_DATA", false).build().toString()); - Mockito.verify(restTemplate, times(1)).exchange(eq(uri), eq(HttpMethod.GET), isA(HttpEntity.class), - eq(RequestProcessingData[].class)); + when(restTemplate.exchange(eq(uri), eq(HttpMethod.GET), isA(HttpEntity.class), + isA(ParameterizedTypeReference.class))).thenReturn( + new ResponseEntity>(new ArrayList(), + HttpStatus.NOT_FOUND)); + assertTrue(requestsDbClient.getExternalRequestProcessingDataBySoRequestId("12345").isEmpty()); + + } } -- cgit 1.2.3-korg