|
| 1 | +package net.authorize.api.controller.test; |
| 2 | +/*@author krgupta |
| 3 | + * |
| 4 | + */ |
| 5 | +import org.junit.After; |
| 6 | +import org.junit.AfterClass; |
| 7 | +import org.junit.Before; |
| 8 | +import org.junit.BeforeClass; |
| 9 | +import org.junit.Test; |
| 10 | + |
| 11 | +import junit.framework.Assert; |
| 12 | +import net.authorize.api.contract.v1.GetTransactionDetailsRequest; |
| 13 | +import net.authorize.api.contract.v1.GetTransactionDetailsResponse; |
| 14 | +import net.authorize.api.contract.v1.MerchantAuthenticationType; |
| 15 | +import net.authorize.api.contract.v1.MessageTypeEnum; |
| 16 | +import net.authorize.api.contract.v1.TransactionDetailsType; |
| 17 | +import net.authorize.api.controller.GetTransactionDetailsController; |
| 18 | + |
| 19 | + /* test for issue #48 reported on github |
| 20 | +*/ |
| 21 | +public class GetTransactionDetails extends ApiCoreTestBase { |
| 22 | + |
| 23 | + |
| 24 | + @BeforeClass |
| 25 | + public static void setUpBeforeClass() throws Exception { |
| 26 | + ApiCoreTestBase.setUpBeforeClass(); |
| 27 | + } |
| 28 | + |
| 29 | + @AfterClass |
| 30 | + public static void tearDownAfterClass() throws Exception { |
| 31 | + ApiCoreTestBase.tearDownAfterClass(); |
| 32 | + } |
| 33 | + |
| 34 | + @Before |
| 35 | + public void setUp() throws Exception { |
| 36 | + super.setUp(); |
| 37 | + } |
| 38 | + |
| 39 | + @After |
| 40 | + public void tearDown() throws Exception { |
| 41 | + super.tearDown(); |
| 42 | + } |
| 43 | + |
| 44 | + //@Test |
| 45 | + /*To run this test successfully you should have a valid transaction id |
| 46 | + */ |
| 47 | + public void TransactionDetails() |
| 48 | + { |
| 49 | + String transId = null ; //"2236685252"; // Update to valid transId |
| 50 | + Assert.assertNotNull("transId is null. Enter a valid transId", transId); |
| 51 | + |
| 52 | + GetTransactionDetailsRequest getRequest = new GetTransactionDetailsRequest(); |
| 53 | + getRequest.setMerchantAuthentication(merchantAuthenticationType); |
| 54 | + getRequest.setTransId(transId); |
| 55 | + GetTransactionDetailsResponse getResponse = executeTestRequestWithSuccess(getRequest, GetTransactionDetailsController.class, environment); |
| 56 | + MessageTypeEnum messagetypeenum = getResponse.getMessages().getResultCode(); |
| 57 | + |
| 58 | + Assert.assertEquals("Check the credentials", MessageTypeEnum.OK,messagetypeenum); |
| 59 | + } |
| 60 | +} |
0 commit comments