diff --git a/anet-java-sdk.properties b/anet-java-sdk.properties index 778241cb..941a5254 100644 --- a/anet-java-sdk.properties +++ b/anet-java-sdk.properties @@ -6,14 +6,20 @@ # Keys for ApplePay transaction tests. These keys may or may not be # the same as the key above. If not specified, they are defaulted to # the keys above. -api.login.id.applepay=API_LOGIN_ID_APPLEPAY -transaction.key.applepay=TRANSACTION_KEY_APPLEPAY -md5.hash.key.applepay=MD5_HASH_KEY_APPLEPAY +api.login.id = API_LOGIN_ID +transaction.key= TRANSACTION_KEY +md5.hash.key=MD5_HASH_KEY +# Keys for ApplePay transaction tests. These keys may or may not be +# the same as the key above. If not specified, they are defaulted to +# the keys above. +# api.login.id.applepay=API_LOGIN_ID_APPLEPAY +# transaction.key.applepay=TRANSACTION_KEY_APPLEPAY +# md5.hash.key.applepay=MD5_HASH_KEY_APPLEPAY # if behind a proxy, use these settings: -http.proxyHost=HTTP_PROXY_HOST -http.proxyPort=HTTP_PROXY_PORT -http.ProxyUse=true -https.proxyHost=HTTPS_PROXY_HOST -https.proxyPort=HTTPS_PROXY_PORT -https.proxyUse=true \ No newline at end of file + http.proxyHost=HTTP_PROXY_HOST + http.proxyPort=HTTP_PROXY_PORT + http.ProxyUse=true + https.proxyHost=HTTPS_PROXY_HOST + https.proxyPort=HTTPS_PROXY_PORT + https.proxyUse=true \ No newline at end of file diff --git a/resources/log4j.properties b/resources/log4j.properties index 6c751e56..a4573b48 100644 --- a/resources/log4j.properties +++ b/resources/log4j.properties @@ -13,7 +13,7 @@ # FATAL, ERROR, WARN, INFO, DEBUG # #------------------------------------------------------------------------------ -log4j.rootCategory=DEBUG, S, R +log4j.rootCategory=FATAL, S, R log4j.logger.net.authorize.util.HttpClient=DEBUG, R log4j.logger.net.authorize.sim.TransactionTest=DEBUG, R @@ -35,7 +35,7 @@ log4j.appender.S.layout.ConversionPattern = %d{MM/dd/yy HH:mm:ss,SS:} %5p [%t] ( # #------------------------------------------------------------------------------ log4j.appender.R = org.apache.log4j.DailyRollingFileAppender -log4j.appender.R.File = logs/net.authorize.log +log4j.appender.R.File = logs/net.authorize.aim.log log4j.appender.R.Append = true log4j.appender.R.DatePattern = '.'yyyy-MM-dd log4j.appender.R.layout = org.apache.log4j.PatternLayout diff --git a/src/test/java/net/authorize/api/controller/test/GetBatchStatistics.java b/src/test/java/net/authorize/api/controller/test/GetBatchStatistics.java index 504c84d3..72cc9b5f 100644 --- a/src/test/java/net/authorize/api/controller/test/GetBatchStatistics.java +++ b/src/test/java/net/authorize/api/controller/test/GetBatchStatistics.java @@ -35,23 +35,20 @@ public void tearDown() throws Exception { super.tearDown(); } - @Test - /*To run this test successfully you should have a valid transaction id + //@Test + /*To run this test successfully you should have a valid batchId */ public void getbatchstatistics() { - MessageTypeEnum messagetypeenum = getBatchStatistics(); - Assert.assertEquals(MessageTypeEnum.OK,messagetypeenum); - } - - private MessageTypeEnum getBatchStatistics() { + String batchId = null ; //"12345"; // Update to valid batchId + Assert.assertNotNull("batchId is null. Enter a valid batchId", batchId); GetBatchStatisticsRequest getRequest = new GetBatchStatisticsRequest(); getRequest.setMerchantAuthentication(merchantAuthenticationType); - String batchId = "12345"; getRequest.setBatchId(batchId); GetBatchStatisticsResponse getResponse = executeTestRequestWithSuccess(getRequest, GetBatchStatisticsController.class, environment); - return getResponse.getMessages().getResultCode(); + MessageTypeEnum messagetypeenum = getResponse.getMessages().getResultCode(); + + Assert.assertEquals("Check the credentials ", MessageTypeEnum.OK,messagetypeenum); } - } diff --git a/src/test/java/net/authorize/api/controller/test/GetSettledBatchList.java b/src/test/java/net/authorize/api/controller/test/GetSettledBatchList.java new file mode 100644 index 00000000..a552355b --- /dev/null +++ b/src/test/java/net/authorize/api/controller/test/GetSettledBatchList.java @@ -0,0 +1,48 @@ +package net.authorize.api.controller.test; +/*@author krgupta + * + */ +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import junit.framework.Assert; +import net.authorize.api.contract.v1.GetSettledBatchListRequest; +import net.authorize.api.contract.v1.GetSettledBatchListResponse; +import net.authorize.api.contract.v1.MessageTypeEnum; +import net.authorize.api.controller.GetSettledBatchListController; + + +public class GetSettledBatchList extends ApiCoreTestBase{ + @BeforeClass + public static void setUpBeforeClass() throws Exception { + ApiCoreTestBase.setUpBeforeClass(); + } + + @AfterClass + public static void tearDownAfterClass() throws Exception { + ApiCoreTestBase.tearDownAfterClass(); + } + + @Before + public void setUp() throws Exception { + super.setUp(); + } + + @After + public void tearDown() throws Exception { + super.tearDown(); + } + + @Test + public void SettledBatchList() + { + GetSettledBatchListRequest getRequest = new GetSettledBatchListRequest(); + getRequest.setMerchantAuthentication(merchantAuthenticationType); + GetSettledBatchListResponse getResponse = executeTestRequestWithSuccess(getRequest, GetSettledBatchListController.class, environment); + MessageTypeEnum messagetypeenum = getResponse.getMessages().getResultCode(); + + Assert.assertEquals("Check the credentials ", MessageTypeEnum.OK,messagetypeenum); + } +} diff --git a/src/test/java/net/authorize/api/controller/test/GetTransactionList.java b/src/test/java/net/authorize/api/controller/test/GetTransactionList.java index 88994960..e0cbf394 100644 --- a/src/test/java/net/authorize/api/controller/test/GetTransactionList.java +++ b/src/test/java/net/authorize/api/controller/test/GetTransactionList.java @@ -38,25 +38,20 @@ public void tearDown() throws Exception { super.tearDown(); } - @Test - /*To run this test successfully you should have a valid transaction id + //@Test + /*To run this test successfully you should have a batchId */ public void TransactionList() { - //update accordingly - String batchId = "4594221"; - - MessageTypeEnum messagetypeenum = transactionlist(merchantAuthenticationType, batchId); - Assert.assertEquals(MessageTypeEnum.OK,messagetypeenum); - } - - private MessageTypeEnum transactionlist(MerchantAuthenticationType merchantAuthentication, String batchId) { - //get a Transaction + String batchId = null ; //"4594221"; // Update to valid batchId + Assert.assertNotNull("batchId is null. Enter a valid batchId", batchId); + GetTransactionListRequest getRequest = new GetTransactionListRequest(); getRequest.setMerchantAuthentication(merchantAuthenticationType); getRequest.setBatchId(batchId); GetTransactionListResponse getResponse = executeTestRequestWithSuccess(getRequest, GetTransactionListController.class, environment); - Assert.assertNotNull(getResponse.getTransactions()); - return getResponse.getMessages().getResultCode(); + MessageTypeEnum messagetypeenum = getResponse.getMessages().getResultCode(); + + Assert.assertEquals("Check the credentials", MessageTypeEnum.OK,messagetypeenum); } } diff --git a/src/test/java/net/authorize/api/controller/test/GetUnsettledTransactionList.java b/src/test/java/net/authorize/api/controller/test/GetUnsettledTransactionList.java index c748c2b0..3477a231 100644 --- a/src/test/java/net/authorize/api/controller/test/GetUnsettledTransactionList.java +++ b/src/test/java/net/authorize/api/controller/test/GetUnsettledTransactionList.java @@ -41,20 +41,13 @@ public void tearDown() throws Exception { } @Test - /*To run this test successfully you should have a valid transaction id - */ - - public void UnSettledTransactionList() { - MessageTypeEnum messagetypeenum = getUnSettledTransactionList(); - Assert.assertEquals(MessageTypeEnum.OK,messagetypeenum); - } - - private MessageTypeEnum getUnSettledTransactionList() { GetUnsettledTransactionListRequest getRequest = new GetUnsettledTransactionListRequest(); getRequest.setMerchantAuthentication(merchantAuthenticationType); GetUnsettledTransactionListResponse getResponse = executeTestRequestWithSuccess(getRequest, GetUnsettledTransactionListController.class, environment); - return getResponse.getMessages().getResultCode(); + MessageTypeEnum messagetypeenum = getResponse.getMessages().getResultCode(); + + Assert.assertEquals("Check the credentials", MessageTypeEnum.OK,messagetypeenum); } } diff --git a/src/test/java/net/authorize/reporting/functional_test/ReportingTest.java b/src/test/java/net/authorize/reporting/functional_test/ReportingTest.java index e0dc1daf..1edbee5f 100644 --- a/src/test/java/net/authorize/reporting/functional_test/ReportingTest.java +++ b/src/test/java/net/authorize/reporting/functional_test/ReportingTest.java @@ -328,11 +328,12 @@ public void Issue48repro() } //@author krgupta - @Test + //@Test public void Issue48solution() { //valid transaction id is required to run this test - String transId = "2239014404"; + String transId = null ; //"2239014404"; // Update to valid transId + Assert.assertNotNull("transId is null. Enter a valid transId", transId); net.authorize.reporting.Transaction transaction = merchant.createReportingTransaction(TransactionType.GET_TRANSACTION_DETAILS); ReportingDetails reportingDetails = ReportingDetails.createReportingDetails(); reportingDetails.setTransactionId(transId);