X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=policy-agent%2Fsrc%2Ftest%2Fjava%2Forg%2Foransc%2Fpolicyagent%2Fclients%2FAsyncRestClientTest.java;h=884b36feaaa022b9abf1c5379ab9e2502a97a3b1;hb=97aaf161d02804c08cffff826f3afdb7690ee5bb;hp=11f2409ca3309f00150867609df96e8300f0c9d6;hpb=47e7c2191584a9bc6d120f91b585d01b44828cc6;p=nonrtric.git diff --git a/policy-agent/src/test/java/org/oransc/policyagent/clients/AsyncRestClientTest.java b/policy-agent/src/test/java/org/oransc/policyagent/clients/AsyncRestClientTest.java index 11f2409c..884b36fe 100644 --- a/policy-agent/src/test/java/org/oransc/policyagent/clients/AsyncRestClientTest.java +++ b/policy-agent/src/test/java/org/oransc/policyagent/clients/AsyncRestClientTest.java @@ -31,9 +31,9 @@ import okhttp3.mockwebserver.MockWebServer; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import org.oransc.policyagent.clients.AsyncRestClient.AsyncRestClientException; import org.springframework.http.HttpHeaders; import org.springframework.http.MediaType; +import org.springframework.web.reactive.function.client.WebClientResponseException; import reactor.core.publisher.Mono; import reactor.test.StepVerifier; @@ -81,8 +81,8 @@ public class AsyncRestClientTest { mockWebServer.enqueue(new MockResponse().setResponseCode(ERROR_CODE)); Mono returnedMono = clientUnderTest.get(REQUEST_URL); - StepVerifier.create(returnedMono).expectErrorMatches(throwable -> throwable instanceof AsyncRestClientException) - .verify(); + StepVerifier.create(returnedMono) + .expectErrorMatches(throwable -> throwable instanceof WebClientResponseException).verify(); } @Test @@ -100,8 +100,8 @@ public class AsyncRestClientTest { mockWebServer.enqueue(new MockResponse().setResponseCode(ERROR_CODE)); Mono returnedMono = clientUnderTest.put(REQUEST_URL, TEST_JSON); - StepVerifier.create(returnedMono).expectErrorMatches(throwable -> throwable instanceof AsyncRestClientException) - .verify(); + StepVerifier.create(returnedMono) + .expectErrorMatches(throwable -> throwable instanceof WebClientResponseException).verify(); } @Test @@ -117,8 +117,8 @@ public class AsyncRestClientTest { mockWebServer.enqueue(new MockResponse().setResponseCode(ERROR_CODE)); Mono returnedMono = clientUnderTest.delete(REQUEST_URL); - StepVerifier.create(returnedMono).expectErrorMatches(throwable -> throwable instanceof AsyncRestClientException) - .verify(); + StepVerifier.create(returnedMono) + .expectErrorMatches(throwable -> throwable instanceof WebClientResponseException).verify(); } @Test @@ -136,8 +136,8 @@ public class AsyncRestClientTest { mockWebServer.enqueue(new MockResponse().setResponseCode(ERROR_CODE)); Mono returnedMono = clientUnderTest.post(REQUEST_URL, TEST_JSON); - StepVerifier.create(returnedMono).expectErrorMatches(throwable -> throwable instanceof AsyncRestClientException) - .verify(); + StepVerifier.create(returnedMono) + .expectErrorMatches(throwable -> throwable instanceof WebClientResponseException).verify(); } @Test @@ -155,7 +155,7 @@ public class AsyncRestClientTest { mockWebServer.enqueue(new MockResponse().setResponseCode(ERROR_CODE)); Mono returnedMono = clientUnderTest.postWithAuthHeader(REQUEST_URL, TEST_JSON, USERNAME, PASSWORD); - StepVerifier.create(returnedMono).expectErrorMatches(throwable -> throwable instanceof AsyncRestClientException) - .verify(); + StepVerifier.create(returnedMono) + .expectErrorMatches(throwable -> throwable instanceof WebClientResponseException).verify(); } }