-
Notifications
You must be signed in to change notification settings - Fork 139
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PW-8014] Removed Error Deserialization (#961)
* removed error deserialization and added IT's * remove unused imports * fix the tests that broke with new exception * create separate field for responseBody
- Loading branch information
Showing
10 changed files
with
103 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package com.adyen; | ||
|
||
import com.adyen.enums.Environment; | ||
import com.adyen.model.checkout.PaymentLinkResponse; | ||
import com.adyen.model.checkout.ServiceError; | ||
import com.adyen.model.management.AllowedOriginsResponse; | ||
import com.adyen.model.management.CreateAllowedOriginRequest; | ||
import com.adyen.model.management.JSON; | ||
import com.adyen.model.management.RestServiceError; | ||
import com.adyen.service.Checkout; | ||
import com.adyen.service.exception.ApiException; | ||
import com.adyen.service.management.MyApiCredential; | ||
import org.junit.Assert; | ||
import org.junit.Ignore; | ||
import org.junit.Test; | ||
|
||
import java.io.IOException; | ||
|
||
public class ErrorHandlingTest extends BaseTest{ | ||
@Test | ||
@Ignore("Integration test") | ||
public void addAllowedOriginFail() throws IOException, ApiException { | ||
Client client = new Client(System.getenv("API_KEY"), Environment.TEST); | ||
MyApiCredential service = new MyApiCredential(client); | ||
|
||
CreateAllowedOriginRequest createAllowedOriginRequest = new CreateAllowedOriginRequest(); | ||
createAllowedOriginRequest.setDomain("https://google.com"); | ||
try | ||
{ | ||
service.addAllowedOrigin(createAllowedOriginRequest); | ||
} catch(ApiException e) { | ||
Assert.assertTrue(e.getResponseBody().contains("Invalid allowed origin information provided.")); | ||
} | ||
} | ||
|
||
@Test | ||
@Ignore("Integration test") | ||
public void CheckoutErrorTest() throws IOException, ApiException { | ||
Client client = new Client(System.getenv("API_KEY"), Environment.TEST); | ||
Checkout service = new Checkout(client); | ||
try | ||
{ | ||
service.getPaymentLinks("1234"); | ||
} catch(ApiException e) { | ||
Assert.assertTrue(e.getResponseBody().contains("Invalid payment link ID")); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters