Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
sp00m authored and gcatanese committed Mar 3, 2025
1 parent 4e7722e commit 44da7a3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/test/java/com/adyen/service/ResourceTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@

import static org.junit.Assert.*;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyBoolean;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

Expand Down Expand Up @@ -90,7 +91,7 @@ public void testNonJsonError() throws Exception {
Resource resource = new Resource(serviceMock, "/companies/{companyId}/merchants", null);

HTTPClientException error = new HTTPClientException(500, "error", Collections.emptyMap(), "not JSON");
when(clientInterfaceMock.request(any(), any(), any(), any(), any(), any(), any())).thenThrow(error);
when(clientInterfaceMock.request(any(), any(), any(), anyBoolean(), any(), any(), any())).thenThrow(error);

ApiException thrown = assertThrows(ApiException.class, () -> resource.request(null, null, ApiConstants.HttpMethod.GET, pathParams, queryString));
assertEquals("not JSON", thrown.getResponseBody());
Expand Down

0 comments on commit 44da7a3

Please sign in to comment.