Skip to content

Commit c18640f

Browse files
committed
Modified files for issue ARBSubscriptionList SearchType of cardExpiringThisMonth doesn't work
1 parent 312c3c9 commit c18640f

2 files changed

Lines changed: 5 additions & 26 deletions

File tree

src/main/java/net/authorize/api/controller/ARBGetSubscriptionListController.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,7 @@ protected void validateRequest() {
1717

1818
//validate required fields
1919
if ( null == request.getSearchType()) throw new NullPointerException("SearchType cannot be null");
20-
21-
//Paging is not the compulsory parameter so need not be validated
22-
// if ( null == request.getPaging()) throw new NullPointerException("Paging cannot be null");
23-
24-
//validate not-required fields
20+
2521
}
2622

2723
@Override

src/test/java/net/authorize/api/controller/test/ArbSubscriptionTest.java

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -114,38 +114,21 @@ public void testSubscription() throws Exception {
114114

115115
/**
116116
* @Zalak
117-
* Repro issue - ARBSubscriptionList SearchType of "cardExpiringThisMonth" doesn't work
117+
* Repro and fix test for issue - ARBSubscriptionList SearchType of "cardExpiringThisMonth" doesn't work
118118
*/
119-
// @Test (expected = NullPointerException.class)
120-
public void GetSubscriptionearchCardExpiringThisMonthIssueTest()
121-
{
122-
ARBGetSubscriptionListRequest getSubscriptionListRequest = new ARBGetSubscriptionListRequest();
123-
getSubscriptionListRequest.setSearchType(ARBGetSubscriptionListSearchTypeEnum.CARD_EXPIRING_THIS_MONTH);
124-
getSubscriptionListRequest.setMerchantAuthentication(merchantAuthenticationType);
125-
ARBGetSubscriptionListController nullController = new ARBGetSubscriptionListController(getSubscriptionListRequest);
126-
Assert.assertNull(nullController);
127-
128-
}
129-
130-
/**
131-
* @Zalak
132-
* After fixing the issue - ARBSubscriptionList SearchType of "cardExpiringThisMonth" doesn't work
133-
*/
134-
@Test
135-
public void GetSubscriptionearchCardExpiringThisMonthFixTest()
119+
@Test
120+
public void ShouldReturnSubsciptionsWhenPagingNotPassedTest()
136121
{
137122
ARBGetSubscriptionListRequest getSubscriptionListRequest = new ARBGetSubscriptionListRequest();
138123
getSubscriptionListRequest.setSearchType(ARBGetSubscriptionListSearchTypeEnum.CARD_EXPIRING_THIS_MONTH);
139124
getSubscriptionListRequest.setMerchantAuthentication(merchantAuthenticationType);
140125
ARBGetSubscriptionListController nullController = new ARBGetSubscriptionListController(getSubscriptionListRequest);
126+
Assert.assertNotNull(nullController);
141127
ARBGetSubscriptionListResponse response = executeTestRequestWithSuccess(getSubscriptionListRequest, ARBGetSubscriptionListController.class, environment);
142128
Assert.assertNotNull(response);
143-
Assert.assertNotNull(nullController);
144129

145130
}
146131

147-
148-
149132
private ARBGetSubscriptionListRequest setupSubscriptionListRequest(MerchantAuthenticationType merchantAuthentication) {
150133

151134
ARBGetSubscriptionListSorting sorting = new ARBGetSubscriptionListSorting();

0 commit comments

Comments
 (0)