Skip to content

Commit

Permalink
private method removed from tests and updated properties
Browse files Browse the repository at this point in the history
  • Loading branch information
krgupta committed Sep 16, 2015
1 parent 22e7700 commit a6d8f82
Show file tree
Hide file tree
Showing 7 changed files with 86 additions and 46 deletions.
24 changes: 15 additions & 9 deletions anet-java-sdk.properties
Expand Up @@ -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
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
4 changes: 2 additions & 2 deletions resources/log4j.properties
Expand Up @@ -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
Expand All @@ -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
Expand Down
Expand Up @@ -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);
}

}
@@ -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);
}
}
Expand Up @@ -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);
}
}
Expand Up @@ -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);
}
}
Expand Up @@ -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);
Expand Down

0 comments on commit a6d8f82

Please sign in to comment.