Class ResourceCreationTest

  • All Implemented Interfaces:
    WebResourceTesting

    public abstract class ResourceCreationTest
    extends RESTWebServiceTest
    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, ...)
    • Constructor Detail

      • ResourceCreationTest

        public ResourceCreationTest()
    • 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> javax.ws.rs.core.Response 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.
      • post

        public <C> javax.ws.rs.core.Response post​(C entity,
                                                  String atURI,
                                                  AuthId authId)
        Posts the specified web entity at the specified URI and with the given authentication identification.
        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.
        authId - the authentication identification to use to identify the user behind the request.
        Returns:
        the response of the post.
      • creationOfANewResourceByANonAuthenticatedUser

        public void creationOfANewResourceByANonAuthenticatedUser()
      • creationOfANewResourceWithADeprecatedSession

        public void creationOfANewResourceWithADeprecatedSession()
      • creationOfANewResourceByANonAuthorizedUser

        public void creationOfANewResourceByANonAuthorizedUser()
      • postAnInvalidResourceState

        public void postAnInvalidResourceState()