From 23d1bd2dfbbbd2a5dd975d085e8a9f092464e76e Mon Sep 17 00:00:00 2001 From: Jesse Morgan Date: Wed, 21 Sep 2016 21:56:57 -0700 Subject: Switching individual_profile_from_login_password to POST The CCB API has changed such that the individual_profile_from_login_password API now expects the username and password to be sent as a form body. --- src/test/java/com/p4square/ccbapi/CCBAPIClientTest.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/test/java/com/p4square/ccbapi/CCBAPIClientTest.java') diff --git a/src/test/java/com/p4square/ccbapi/CCBAPIClientTest.java b/src/test/java/com/p4square/ccbapi/CCBAPIClientTest.java index b7d32e1..71427b5 100644 --- a/src/test/java/com/p4square/ccbapi/CCBAPIClientTest.java +++ b/src/test/java/com/p4square/ccbapi/CCBAPIClientTest.java @@ -158,10 +158,10 @@ public class CCBAPIClientTest { @Test public void testGetIndividualProfilesByLogin() throws Exception { // Set expectation. - URI expectedURI = new URI("https://localhost:8080/api.php?" - + "srv=individual_profile_from_login_password&password=pass&login=user"); + URI expectedURI = new URI("https://localhost:8080/api.php?srv=individual_profile_from_login_password"); + byte[] expectedForm = "login=user&password=pass".getBytes(); InputStream is = getClass().getResourceAsStream("model/ccb_individual_profile_response.xml"); - EasyMock.expect(mockHttpClient.sendPostRequest(expectedURI, null)) + EasyMock.expect(mockHttpClient.sendPostRequest(EasyMock.eq(expectedURI), EasyMock.aryEq(expectedForm))) .andReturn(is); EasyMock.replay(mockHttpClient); -- cgit v1.2.3