com.silverpeas.web
Class ResourceCreationTest<T extends TestResources>

java.lang.Object
  extended by com.sun.jersey.test.framework.JerseyTest
      extended by com.silverpeas.web.RESTWebServiceTest<T>
          extended by com.silverpeas.web.ResourceCreationTest<T>
All Implemented Interfaces:
WebResourceTesting

public abstract class ResourceCreationTest<T extends TestResources>
extends RESTWebServiceTest<T>
implements WebResourceTesting

Unit tests on the creation of a new resource in Silverpeas through a REST web service. This class is an abstract one and it implements some tests that are redondant over all web resources in Silverpeas (about authorization failure, authentication failure, ...)


Field Summary
 
Fields inherited from class com.silverpeas.web.RESTWebServiceTest
CONTEXT_NAME
 
Fields inherited from interface com.silverpeas.web.WebResourceTesting
HTTP_SESSIONKEY
 
Constructor Summary
ResourceCreationTest(String webServicePackage, String springContext)
           
 
Method Summary
static String at(String uri)
          A convenient method to improve the readability of the method calls.
 void creationOfANewResourceByANonAuthenticatedUser()
           
 void creationOfANewResourceByANonAuthorizedUser()
           
 void creationOfANewResourceWithADeprecatedSession()
           
<C> com.sun.jersey.api.client.ClientResponse
post(C entity, String atURI)
          Posts the specified web entity at the specified URI.
 void postAnInvalidResourceState()
           
 
Methods inherited from class com.silverpeas.web.RESTWebServiceTest
addComponentInstance, addTool, aUser, authenticate, buildQueryParametersFrom, denieAuthorizationToUsers, denieSpaceAuthorizationToUsers, getAccessControllerMock, getExistingComponentInstances, getExistingTools, getMockedSpaceAccessController, getOrganizationControllerMock, getPersonalizationServiceMock, getTestResources, prepareMockedResources, resource, setComponentAccessibilityToUser
 
Methods inherited from class com.sun.jersey.test.framework.JerseyTest
client, configure, getBaseURI, getClient, getClientFactory, getPort, getTestContainerFactory, setClientFactory, setTestContainerFactory, setUp, tearDown
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.silverpeas.web.WebResourceTesting
anUnexistingResourceURI, aResource, aResourceURI, getSessionKey, getWebEntityClass
 

Constructor Detail

ResourceCreationTest

public ResourceCreationTest(String webServicePackage,
                            String springContext)
See Also:
RESTWebServiceTest.RESTWebServiceTest(java.lang.String, java.lang.String)
Method Detail

at

public static String at(String uri)
A convenient method to improve the readability of the method calls.

Parameters:
uri - a resource URI.
Returns:
the specified resource URI.

post

public <C> com.sun.jersey.api.client.ClientResponse post(C entity,
                                                         String atURI)
Posts the specified web entity at the specified URI.

Type Parameters:
C - the type of the web entity to post.
Parameters:
entity - the web entity to post.
atURI - the URI at which the entity has to be posted.
Returns:
the response of the post.

creationOfANewResourceByANonAuthenticatedUser

public void creationOfANewResourceByANonAuthenticatedUser()

creationOfANewResourceWithADeprecatedSession

public void creationOfANewResourceWithADeprecatedSession()

creationOfANewResourceByANonAuthorizedUser

public void creationOfANewResourceByANonAuthorizedUser()

postAnInvalidResourceState

public void postAnInvalidResourceState()


Copyright © 2016 Silverpeas. All Rights Reserved.