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=6a8a0d5350a77b6d1e4a8f95c0fe8fbfeef77339;hp=11f2409ca3309f00150867609df96e8300f0c9d6;hpb=379306b6879d2fd0e807784bc3c0c5c2ac704813;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(); } }