Class AbstractWebServicesTest
- java.lang.Object
-
- de.hybris.platform.testframework.HybrisJUnit4Test
-
- de.hybris.platform.servicelayer.ServicelayerBaseTest
-
- de.hybris.platform.servicelayer.ServicelayerTest
-
- de.hybris.platform.webservicescommons.webservices.AbstractWebServicesTest
-
- All Implemented Interfaces:
JaloSessionHolder
@Deprecated(since="6.0", forRemoval=true) public abstract class AbstractWebServicesTest extends ServicelayerTestDeprecated, for removal: This API element is subject to removal in a future version.Deprecated since 6.0, useNeedsEmbeddedServerannotation to run embedded server on test class andWsSecuredRequestBuilderorWsRequestBuilderto constructInvocation.Builderthat you need to access your web services
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringEMBEDDEDSERVER_HTTP_PORT_CONFIG_KEYDeprecated, for removal: This API element is subject to removal in a future version.static java.lang.StringEMBEDDEDSERVER_HTTPS_PORT_CONFIG_KEYDeprecated, for removal: This API element is subject to removal in a future version.protected static java.lang.StringHEADER_AUTH_KEYDeprecated, for removal: This API element is subject to removal in a future version.protected static java.lang.StringHEADER_AUTH_VALUE_PREFIXDeprecated, for removal: This API element is subject to removal in a future version.protected javax.ws.rs.client.ClientjerseyClientDeprecated, for removal: This API element is subject to removal in a future version.protected javax.ws.rs.client.WebTargetwebResourceDeprecated, for removal: This API element is subject to removal in a future version.static java.lang.StringWS_REQUIRED_CHANNEL_PROPERTYDeprecated, for removal: This API element is subject to removal in a future version.static java.lang.StringWS_TEST_OAUTH2_CLIENT_ID_KEYDeprecated, for removal: This API element is subject to removal in a future version.static java.lang.StringWS_TEST_OAUTH2_CLIENT_SECRET_KEYDeprecated, for removal: This API element is subject to removal in a future version.static java.lang.StringWS_TEST_OAUTH2_CUSTOMER_PASSWORD_KEYDeprecated, for removal: This API element is subject to removal in a future version.static java.lang.StringWS_TEST_OAUTH2_CUSTOMER_USERNAME_KEYDeprecated, for removal: This API element is subject to removal in a future version.static java.lang.StringWS_TEST_OAUTH2_TOKEN_ENDPOINT_PATH_KEYDeprecated, for removal: This API element is subject to removal in a future version.-
Fields inherited from class de.hybris.platform.servicelayer.ServicelayerTest
importService
-
Fields inherited from class de.hybris.platform.testframework.HybrisJUnit4Test
jaloSession
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractWebServicesTest()Deprecated, for removal: This API element is subject to removal in a future version.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected javax.ws.rs.client.Invocation.BuilderaddAuthorizationHeader(javax.ws.rs.client.WebTarget webResource, java.lang.String token)Deprecated, for removal: This API element is subject to removal in a future version.protected voidassertBadRequest(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.protected voidassertCreated(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.protected voidassertForbidden(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.protected voidassertOk(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.protected voidassertResponseStatus(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.protected voidassertResponseStatus(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.protected voidassertUnauthorized(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.protected javax.ws.rs.client.Invocation.BuilderauthorizeClientUsingClientCredentials(javax.ws.rs.client.WebTarget webResource)Deprecated, for removal: This API element is subject to removal in a future version.protected javax.ws.rs.client.Invocation.BuilderauthorizeClientUsingClientCredentials(javax.ws.rs.client.WebTarget webResource, java.lang.String clientId, java.lang.String clientSecret)Deprecated, for removal: This API element is subject to removal in a future version.protected javax.ws.rs.client.Invocation.BuilderauthorizeClientUsingResourceOwnerPassword(javax.ws.rs.client.WebTarget webResource)Deprecated, for removal: This API element is subject to removal in a future version.protected javax.ws.rs.client.Invocation.BuilderauthorizeClientUsingResourceOwnerPassword(javax.ws.rs.client.WebTarget webResource, java.lang.String customerName, java.lang.String customerPassword)Deprecated, for removal: This API element is subject to removal in a future version.protected javax.ws.rs.client.Invocation.BuilderauthorizeClientUsingResourceOwnerPassword(javax.ws.rs.client.WebTarget webResource, java.lang.String customerName, java.lang.String customerPassword, java.lang.String clientId, java.lang.String clientSecret)Deprecated, for removal: This API element is subject to removal in a future version.protected voidbeforeEmbeddedServerCreation()Deprecated, for removal: This API element is subject to removal in a future version.protected javax.ws.rs.client.ClientcreateClient(org.glassfish.jersey.client.ClientConfig config)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 testsprotected EmbeddedServercreateEmbeddedServer()Deprecated, for removal: This API element is subject to removal in a future version.voidensureEmbeddedServerIsRunning()Deprecated, for removal: This API element is subject to removal in a future version.protected voidensureWebappIsRunning()Deprecated, for removal: This API element is subject to removal in a future version.protected ExtensionInfogetAuthorizationExtensionInfo()Deprecated, for removal: This API element is subject to removal in a future version.protected java.lang.StringgetAuthorizationExtensionName()Deprecated, for removal: This API element is subject to removal in a future version.protected EmbeddedServerBuildergetEmbeddedServerBuilder()Deprecated, for removal: This API element is subject to removal in a future version.ExtensionInfogetExtensionInfo()Deprecated, for removal: This API element is subject to removal in a future version.abstract java.lang.StringgetExtensionName()Deprecated, for removal: This API element is subject to removal in a future version.protected java.lang.StringgetOAuth2TokenUsingClientCredentials(javax.ws.rs.client.WebTarget webResource, java.lang.String clientID, java.lang.String clientSecret)Deprecated, for removal: This API element is subject to removal in a future version.protected java.lang.StringgetOAuth2TokenUsingResourceOwnerPassword(javax.ws.rs.client.WebTarget webResource, java.lang.String clientID, java.lang.String clientSecret, java.lang.String customerName, java.lang.String customerPassword)Deprecated, for removal: This API element is subject to removal in a future version.static java.lang.StringgetTokenFromJsonStr(java.lang.String jsonStr)Deprecated, for removal: This API element is subject to removal in a future version.protected java.lang.StringgetWebRoot(ExtensionInfo extensionInfo)Deprecated, for removal: This API element is subject to removal in a future version.protected java.lang.StringgetWsVersionForExtensionInfo(ExtensionInfo extensionInfo)Deprecated, for removal: This API element is subject to removal in a future version.booleanisUseSSL()Deprecated, for removal: This API element is subject to removal in a future version.static <T> TjsonToObj(java.lang.String jsonStr, java.lang.Class<T> c)Deprecated, for removal: This API element is subject to removal in a future version.static java.lang.StringobjToJson(java.lang.Object obj)Deprecated, for removal: This API element is subject to removal in a future version.voidsetUp()Deprecated, for removal: This API element is subject to removal in a future version.protected javax.ws.rs.client.WebTargetsetupWebResource(ExtensionInfo extensionInfo)Deprecated, for removal: This API element is subject to removal in a future version.voidsetUseSSL(boolean useSSL)Deprecated, for removal: This API element is subject to removal in a future version.static voidstopEmbeddedTomcat()Deprecated, for removal: This API element is subject to removal in a future version.-
Methods inherited from class de.hybris.platform.servicelayer.ServicelayerTest
createCoreData, createDefaultCatalog, createDefaultUsers, createHardwareCatalog, getApplicationContext, importCsv, importData, importData, importData, importStream, importStream, isPrefetchModeNone
-
Methods inherited from class de.hybris.platform.servicelayer.ServicelayerBaseTest
autowireProperties, getBeanName, prepareApplicationContextAndSession
-
Methods inherited from class de.hybris.platform.testframework.HybrisJUnit4Test
establishJaloSession, finish, getOrCreateCurrency, getOrCreateLanguage, init, intenseChecksActivated, takeJaloSession
-
-
-
-
Field Detail
-
WS_REQUIRED_CHANNEL_PROPERTY
public static final java.lang.String WS_REQUIRED_CHANNEL_PROPERTY
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
- Constant Field Values
-
EMBEDDEDSERVER_HTTP_PORT_CONFIG_KEY
public static final java.lang.String EMBEDDEDSERVER_HTTP_PORT_CONFIG_KEY
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
- Constant Field Values
-
EMBEDDEDSERVER_HTTPS_PORT_CONFIG_KEY
public static final java.lang.String EMBEDDEDSERVER_HTTPS_PORT_CONFIG_KEY
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
- Constant Field Values
-
WS_TEST_OAUTH2_TOKEN_ENDPOINT_PATH_KEY
public static final java.lang.String WS_TEST_OAUTH2_TOKEN_ENDPOINT_PATH_KEY
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
- Constant Field Values
-
WS_TEST_OAUTH2_CLIENT_ID_KEY
public static final java.lang.String WS_TEST_OAUTH2_CLIENT_ID_KEY
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
- Constant Field Values
-
WS_TEST_OAUTH2_CLIENT_SECRET_KEY
public static final java.lang.String WS_TEST_OAUTH2_CLIENT_SECRET_KEY
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
- Constant Field Values
-
WS_TEST_OAUTH2_CUSTOMER_USERNAME_KEY
public static final java.lang.String WS_TEST_OAUTH2_CUSTOMER_USERNAME_KEY
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
- Constant Field Values
-
WS_TEST_OAUTH2_CUSTOMER_PASSWORD_KEY
public static final java.lang.String WS_TEST_OAUTH2_CUSTOMER_PASSWORD_KEY
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
- Constant Field Values
-
HEADER_AUTH_KEY
protected static final java.lang.String HEADER_AUTH_KEY
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
- Constant Field Values
-
HEADER_AUTH_VALUE_PREFIX
protected static final java.lang.String HEADER_AUTH_VALUE_PREFIX
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
- Constant Field Values
-
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.
-
-
Method Detail
-
stopEmbeddedTomcat
public static void stopEmbeddedTomcat()
Deprecated, for removal: This API element is subject to removal in a future version.
-
getWsVersionForExtensionInfo
protected java.lang.String getWsVersionForExtensionInfo(ExtensionInfo extensionInfo)
Deprecated, for removal: This API element is subject to removal in a future version.
-
setUp
public void setUp() throws java.lang.ExceptionDeprecated, for removal: This API element is subject to removal in a future version.- Throws:
java.lang.Exception
-
createClient
protected javax.ws.rs.client.Client createClient(org.glassfish.jersey.client.ClientConfig config) throws java.security.NoSuchAlgorithmException, java.security.KeyManagementExceptionDeprecated, 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:
java.security.NoSuchAlgorithmExceptionjava.security.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 java.lang.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 java.lang.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 java.lang.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, java.lang.String clientId, java.lang.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, java.lang.String customerName, java.lang.String customerPassword, java.lang.String clientId, java.lang.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, java.lang.String customerName, java.lang.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 java.lang.String getOAuth2TokenUsingClientCredentials(javax.ws.rs.client.WebTarget webResource, java.lang.String clientID, java.lang.String clientSecret)Deprecated, for removal: This API element is subject to removal in a future version.
-
getOAuth2TokenUsingResourceOwnerPassword
protected java.lang.String getOAuth2TokenUsingResourceOwnerPassword(javax.ws.rs.client.WebTarget webResource, java.lang.String clientID, java.lang.String clientSecret, java.lang.String customerName, java.lang.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, java.lang.String token)Deprecated, for removal: This API element is subject to removal in a future version.
-
getTokenFromJsonStr
public static java.lang.String getTokenFromJsonStr(java.lang.String jsonStr) throws java.io.IOExceptionDeprecated, for removal: This API element is subject to removal in a future version.- Throws:
java.io.IOException
-
jsonToObj
public static <T> T jsonToObj(java.lang.String jsonStr, java.lang.Class<T> c) throws java.io.IOExceptionDeprecated, for removal: This API element is subject to removal in a future version.- Throws:
java.io.IOException
-
objToJson
public static java.lang.String objToJson(java.lang.Object obj) throws java.io.IOExceptionDeprecated, for removal: This API element is subject to removal in a future version.- Throws:
java.io.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-ClientResponseexpectEmptyBody- 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-ClientResponseexpectEmptyBody- 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-ClientResponseexpectEmptyBody- 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-ClientResponseexpectEmptyBody- 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-ClientResponseexpectEmptyBody- 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-ClientResponseexpectEmptyBody- 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.
-
-