Class AbstractWebServicesTest

All Implemented Interfaces:
JaloSessionHolder

@Deprecated(since="6.0", forRemoval=true) public abstract class AbstractWebServicesTest extends ServicelayerTest
Deprecated, for removal: This API element is subject to removal in a future version.
Deprecated since 6.0, use NeedsEmbeddedServer annotation to run embedded server on test class and WsSecuredRequestBuilder or WsRequestBuilder to construct Invocation.Builder that you need to access your web services
  • Field Details

    • WS_REQUIRED_CHANNEL_PROPERTY

      public static final String WS_REQUIRED_CHANNEL_PROPERTY
      Deprecated, for removal: This API element is subject to removal in a future version.
      See Also:
    • EMBEDDEDSERVER_HTTP_PORT_CONFIG_KEY

      public static final String EMBEDDEDSERVER_HTTP_PORT_CONFIG_KEY
      Deprecated, for removal: This API element is subject to removal in a future version.
      See Also:
    • EMBEDDEDSERVER_HTTPS_PORT_CONFIG_KEY

      public static final String EMBEDDEDSERVER_HTTPS_PORT_CONFIG_KEY
      Deprecated, for removal: This API element is subject to removal in a future version.
      See Also:
    • WS_TEST_OAUTH2_TOKEN_ENDPOINT_PATH_KEY

      public static final String WS_TEST_OAUTH2_TOKEN_ENDPOINT_PATH_KEY
      Deprecated, for removal: This API element is subject to removal in a future version.
      See Also:
    • WS_TEST_OAUTH2_CLIENT_ID_KEY

      public static final String WS_TEST_OAUTH2_CLIENT_ID_KEY
      Deprecated, for removal: This API element is subject to removal in a future version.
      See Also:
    • WS_TEST_OAUTH2_CLIENT_SECRET_KEY

      public static final String WS_TEST_OAUTH2_CLIENT_SECRET_KEY
      Deprecated, for removal: This API element is subject to removal in a future version.
      See Also:
    • WS_TEST_OAUTH2_CUSTOMER_USERNAME_KEY

      public static final String WS_TEST_OAUTH2_CUSTOMER_USERNAME_KEY
      Deprecated, for removal: This API element is subject to removal in a future version.
      See Also:
    • WS_TEST_OAUTH2_CUSTOMER_PASSWORD_KEY

      public static final String WS_TEST_OAUTH2_CUSTOMER_PASSWORD_KEY
      Deprecated, for removal: This API element is subject to removal in a future version.
      See Also:
    • HEADER_AUTH_KEY

      protected static final String HEADER_AUTH_KEY
      Deprecated, for removal: This API element is subject to removal in a future version.
      See Also:
    • HEADER_AUTH_VALUE_PREFIX

      protected static final String HEADER_AUTH_VALUE_PREFIX
      Deprecated, for removal: This API element is subject to removal in a future version.
      See Also:
    • webResource

      protected javax.ws.rs.client.WebTarget webResource
      Deprecated, for removal: This API element is subject to removal in a future version.
    • jerseyClient

      protected javax.ws.rs.client.Client jerseyClient
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Constructor Details

    • AbstractWebServicesTest

      protected AbstractWebServicesTest()
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Method Details

    • stopEmbeddedTomcat

      public static void stopEmbeddedTomcat()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getWsVersionForExtensionInfo

      protected String getWsVersionForExtensionInfo(ExtensionInfo extensionInfo)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • setUp

      public void setUp() throws Exception
      Deprecated, for removal: This API element is subject to removal in a future version.
      Throws:
      Exception
    • createClient

      protected javax.ws.rs.client.Client createClient(org.glassfish.jersey.client.ClientConfig config) throws NoSuchAlgorithmException, KeyManagementException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Method creates client which accepts all hostname and trust all certificates - because of that it is suitable only for tests
      Parameters:
      config - client config
      Returns:
      created client
      Throws:
      NoSuchAlgorithmException
      KeyManagementException
    • setupWebResource

      protected javax.ws.rs.client.WebTarget setupWebResource(ExtensionInfo extensionInfo)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • ensureEmbeddedServerIsRunning

      public void ensureEmbeddedServerIsRunning()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • createEmbeddedServer

      protected EmbeddedServer createEmbeddedServer()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • beforeEmbeddedServerCreation

      protected void beforeEmbeddedServerCreation()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getEmbeddedServerBuilder

      protected EmbeddedServerBuilder getEmbeddedServerBuilder()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • ensureWebappIsRunning

      protected void ensureWebappIsRunning()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getExtensionName

      public abstract String getExtensionName()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getExtensionInfo

      public ExtensionInfo getExtensionInfo()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getAuthorizationExtensionName

      protected String getAuthorizationExtensionName()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getAuthorizationExtensionInfo

      protected ExtensionInfo getAuthorizationExtensionInfo()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getWebRoot

      protected String getWebRoot(ExtensionInfo extensionInfo)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • authorizeClientUsingClientCredentials

      protected javax.ws.rs.client.Invocation.Builder authorizeClientUsingClientCredentials(javax.ws.rs.client.WebTarget webResource, String clientId, String clientSecret)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • authorizeClientUsingClientCredentials

      protected javax.ws.rs.client.Invocation.Builder authorizeClientUsingClientCredentials(javax.ws.rs.client.WebTarget webResource)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • authorizeClientUsingResourceOwnerPassword

      protected javax.ws.rs.client.Invocation.Builder authorizeClientUsingResourceOwnerPassword(javax.ws.rs.client.WebTarget webResource, String customerName, String customerPassword, String clientId, String clientSecret)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • authorizeClientUsingResourceOwnerPassword

      protected javax.ws.rs.client.Invocation.Builder authorizeClientUsingResourceOwnerPassword(javax.ws.rs.client.WebTarget webResource, String customerName, String customerPassword)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • authorizeClientUsingResourceOwnerPassword

      protected javax.ws.rs.client.Invocation.Builder authorizeClientUsingResourceOwnerPassword(javax.ws.rs.client.WebTarget webResource)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getOAuth2TokenUsingClientCredentials

      protected String getOAuth2TokenUsingClientCredentials(javax.ws.rs.client.WebTarget webResource, String clientID, String clientSecret)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getOAuth2TokenUsingResourceOwnerPassword

      protected String getOAuth2TokenUsingResourceOwnerPassword(javax.ws.rs.client.WebTarget webResource, String clientID, String clientSecret, String customerName, String customerPassword)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • addAuthorizationHeader

      protected javax.ws.rs.client.Invocation.Builder addAuthorizationHeader(javax.ws.rs.client.WebTarget webResource, String token)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getTokenFromJsonStr

      public static String getTokenFromJsonStr(String jsonStr) throws IOException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Throws:
      IOException
    • jsonToObj

      public static <T> T jsonToObj(String jsonStr, Class<T> c) throws IOException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Throws:
      IOException
    • objToJson

      public static String objToJson(Object obj) throws IOException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Throws:
      IOException
    • assertOk

      protected void assertOk(javax.ws.rs.core.Response response, boolean expectEmptyBody)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Tests whether the response has status OK. Expects correct status (200), content type of 'application/xml'
      Parameters:
      response - ClientResponse
      expectEmptyBody - true - the body is checked for null value
    • assertCreated

      protected void assertCreated(javax.ws.rs.core.Response response, boolean expectEmptyBody)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Tests whether resource was successfully created. Expects correct status (201), content type of 'application/xml'
      Parameters:
      response - ClientResponse
      expectEmptyBody - true - the body is checked for null value
    • assertForbidden

      protected void assertForbidden(javax.ws.rs.core.Response response, boolean expectEmptyBody)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Tests whether the response has status FORBIDDEN. Expects correct status (403), content type of 'application/xml'
      Parameters:
      response - ClientResponse
      expectEmptyBody - true - the body is checked for null value
    • assertBadRequest

      protected void assertBadRequest(javax.ws.rs.core.Response response, boolean expectEmptyBody)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Tests whether the response has status BAD_REQUEST. Expects correct status (400), content type of 'application/xml'
      Parameters:
      response - ClientResponse
      expectEmptyBody - true - the body is checked for null value
    • assertUnauthorized

      protected void assertUnauthorized(javax.ws.rs.core.Response response, boolean expectEmptyBody)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Tests whether the response has status UNAUTHORIZED. Expects correct status (401), content type of 'application/xml'
      Parameters:
      response - ClientResponse
      expectEmptyBody - true - the body is checked for null value
    • assertResponseStatus

      protected void assertResponseStatus(javax.ws.rs.core.Response.Status responseStatus, javax.ws.rs.core.Response response, boolean expectEmptyBody)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Tests whether the response status has expected value.
      Parameters:
      response - ClientResponse
      expectEmptyBody - true - the body is checked for null value
    • assertResponseStatus

      protected void assertResponseStatus(javax.ws.rs.core.Response.Status status, javax.ws.rs.core.Response response)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • setUseSSL

      public void setUseSSL(boolean useSSL)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • isUseSSL

      public boolean isUseSSL()
      Deprecated, for removal: This API element is subject to removal in a future version.