use of org.mobicents.smsc.slee.services.http.server.tx.exceptions.HttpApiException in project smscgateway by RestComm.
the class HttpRequestUtilsTest method testExtractParametersFromPost.
/**
* Test extract parameters from post.
*/
@Test
public void testExtractParametersFromPost() {
LOG.info("Starting test: testExtractParametersFromPost.");
try {
final Map<String, String[]> result01 = convert(HTTP_POST_BODY_O1);
assertNotNull(result01);
assertEquals(result01.size(), 0);
final Map<String, String[]> result02 = convert(HTTP_POST_BODY_O2);
assertNotNull(result02);
assertEquals(result02.size(), 0);
final Map<String, String[]> result03 = convert(HTTP_POST_BODY_ARABIC_OK_DATA_FILE_BYTES, new FileInputStream(HTTP_POST_BODY_ARABIC_OK_DATA_FILE));
assertNotNull(result03);
assertEquals(result03.size(), HTTP_POST_BODY_ARABIC_OK_PARAMETERS);
assertEquals("e$services@HMG123", result03.get(HttpRequestUtils.P_PASSWORD)[0]);
assertEquals("966500866422", result03.get(HttpRequestUtils.P_TO)[0]);
} catch (FileNotFoundException e) {
fail("Unexpected test error. Message: " + e.getMessage() + ".", e);
} catch (HttpApiException e) {
fail("Unexpected test error. Message: " + e.getMessage() + ".", e);
}
}
Aggregations