Class HttpExternalSystemCommunicationTest
- java.lang.Object
-
- org.openbravo.test.base.MockableBaseTest
-
- org.openbravo.test.base.OBBaseTest
-
- org.openbravo.base.weld.test.WeldBaseTest
-
- org.openbravo.service.externalsystem.http.HttpExternalSystemCommunicationTest
-
public class HttpExternalSystemCommunicationTest extends WeldBaseTest
Tests to cover the sending of data withHttpExternalSystem
. Note: these tests expect to have the server running as they execute HTTP requests and evaluate the responses.
-
-
Field Summary
-
Fields inherited from class org.openbravo.test.base.OBBaseTest
DOLLAR, DOLLAR_ID, EURO, EURO_ID, QA_TEST_ADMIN_USER_ID, QA_TEST_CLIENT_ID, QA_TEST_ORG_ID, TEST_BP_CATEGORY_ID, TEST_CLIENT_ID, TEST_INVOICE_ID, TEST_LOCATION_ID, TEST_ORDER_ID, TEST_ORG_ID, TEST_ORG_TREE, TEST_PRODUCT_ID, TEST_ROLE_ID, TEST_US_ORG_ID, TEST_USER_ID, TEST_WAREHOUSE_ID, TEST2_USER_ID, userIds, watchFailures
-
-
Constructor Summary
Constructors Constructor Description HttpExternalSystemCommunicationTest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
cannotSendPayloadInDeleteRequests()
void
cannotSendPayloadInGetRequests()
void
cannotSendWithUnsupportedRequestMethod()
void
checkOAuth2TokenRetrieval()
void
cleanUp()
void
init()
void
retryOnceWithOAuth2OnUnauthorizedError()
void
sendRequestToUnknownResource()
void
sendUnauthorized()
void
sendWithBasicAuth()
void
sendWithBasicAuthAlwaysInHeader()
void
sendWithCreateOperation()
void
sendWithDeleteOperation()
void
sendWithQueryParams()
void
sendWithReadOperation()
void
sendWithUpdateOperation()
-
Methods inherited from class org.openbravo.base.weld.test.WeldBaseTest
createTestArchive, getWeldComponent, resetOBInterceptors, setUp
-
Methods inherited from class org.openbravo.test.base.OBBaseTest
addReadWriteAccess, classSetUp, commitTransaction, count, getConnectionProvider, getOneInstance, getRandomUser, getTestLogAppender, initializeDalLayer, initializeDisabledTestCases, initializeTestLogAppender, isErrorOccured, reportException, rollback, setLogStackTraces, setQAAdminContext, setSystemAdministratorContext, setTestAdminContext, setTestLogAppenderLevel, setTestUserContext, setUserContext, shouldMockServletContext, staticInitializeDalLayer, testDone
-
Methods inherited from class org.openbravo.test.base.MockableBaseTest
mockStatic
-
-
-
-
Method Detail
-
init
public void init()
-
cleanUp
public void cleanUp()
-
sendWithBasicAuth
public void sendWithBasicAuth() throws org.codehaus.jettison.json.JSONException, javax.servlet.ServletException
- Throws:
org.codehaus.jettison.json.JSONException
javax.servlet.ServletException
-
sendWithBasicAuthAlwaysInHeader
public void sendWithBasicAuthAlwaysInHeader() throws org.codehaus.jettison.json.JSONException, javax.servlet.ServletException
- Throws:
org.codehaus.jettison.json.JSONException
javax.servlet.ServletException
-
checkOAuth2TokenRetrieval
public void checkOAuth2TokenRetrieval() throws org.codehaus.jettison.json.JSONException, javax.servlet.ServletException
- Throws:
org.codehaus.jettison.json.JSONException
javax.servlet.ServletException
-
retryOnceWithOAuth2OnUnauthorizedError
public void retryOnceWithOAuth2OnUnauthorizedError() throws org.codehaus.jettison.json.JSONException, javax.servlet.ServletException
- Throws:
org.codehaus.jettison.json.JSONException
javax.servlet.ServletException
-
sendUnauthorized
public void sendUnauthorized() throws org.codehaus.jettison.json.JSONException
- Throws:
org.codehaus.jettison.json.JSONException
-
cannotSendWithUnsupportedRequestMethod
public void cannotSendWithUnsupportedRequestMethod()
-
sendRequestToUnknownResource
public void sendRequestToUnknownResource() throws org.codehaus.jettison.json.JSONException
- Throws:
org.codehaus.jettison.json.JSONException
-
sendWithDeleteOperation
public void sendWithDeleteOperation() throws javax.servlet.ServletException
- Throws:
javax.servlet.ServletException
-
sendWithReadOperation
public void sendWithReadOperation() throws javax.servlet.ServletException
- Throws:
javax.servlet.ServletException
-
sendWithQueryParams
public void sendWithQueryParams() throws javax.servlet.ServletException, org.codehaus.jettison.json.JSONException
- Throws:
javax.servlet.ServletException
org.codehaus.jettison.json.JSONException
-
sendWithCreateOperation
public void sendWithCreateOperation() throws javax.servlet.ServletException, org.codehaus.jettison.json.JSONException
- Throws:
javax.servlet.ServletException
org.codehaus.jettison.json.JSONException
-
sendWithUpdateOperation
public void sendWithUpdateOperation() throws javax.servlet.ServletException, org.codehaus.jettison.json.JSONException
- Throws:
javax.servlet.ServletException
org.codehaus.jettison.json.JSONException
-
cannotSendPayloadInGetRequests
public void cannotSendPayloadInGetRequests()
-
cannotSendPayloadInDeleteRequests
public void cannotSendPayloadInDeleteRequests()
-
-