Package org.silverpeas.web.test
Class ResourceDeletionTest
- java.lang.Object
-
- org.silverpeas.web.test.RESTWebServiceTest
-
- org.silverpeas.web.test.ResourceDeletionTest
-
- All Implemented Interfaces:
WebResourceTesting
public abstract class ResourceDeletionTest extends RESTWebServiceTest implements WebResourceTesting
Unit tests on the deletion of a 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 org.silverpeas.web.test.RESTWebServiceTest
dbSetupRule
-
-
Constructor Summary
Constructors Constructor Description ResourceDeletionTest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.ws.rs.core.Response
deleteAt(String uri)
Requests a deleting of the web resource identified at the specified URI.<C> C
deleteAt(String uri, Class<C> c)
Requests a deletion of the web resource identified at the specified URI.javax.ws.rs.core.Response
deleteAt(String uri, AuthId authId)
Requests a deletion of the web resource identified at the specified URI.void
deletionOfAnUnexistingResource()
void
deletionOfAResourceByANonAuthenticatedUser()
void
deletionOfAResourceByANonAuthorizedUser()
void
deletionOfAResourceWithADeprecatedSession()
-
Methods inherited from class org.silverpeas.web.test.RESTWebServiceTest
applyQueryParameters, authenticate, denyAuthorizationToUsers, denySpaceAuthorizationToUsers, getBaseURI, getDataSetScript, getExistingComponentInstances, getExistingTools, getSilverpeasEnvironmentTest, getTableCreationScript, getTokenKeyOf, getWebResourceBaseURIBuilder, reloadAdminCaches, resource, setUpHTTPRequest, setUserIdent, withAsAuthId
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.silverpeas.web.test.WebResourceTesting
anUnexistingResourceURI, aResource, aResourceURI, getAPITokenValue, getWebEntityClass
-
-
-
-
Method Detail
-
deleteAt
public javax.ws.rs.core.Response deleteAt(String uri)
Requests a deleting of the web resource identified at the specified URI. If an error occurs, then an UniformInterfaceException exception is thrown.- Parameters:
uri
- the uri of the resource to delete.- Returns:
- the
Response
of the deletion.
-
deleteAt
public javax.ws.rs.core.Response deleteAt(String uri, AuthId authId)
Requests a deletion of the web resource identified at the specified URI. If an error occurs, then an UniformInterfaceException exception is thrown.- Parameters:
uri
- the uri of the resource to delete.- Returns:
- the
Response
of the deletion.
-
deleteAt
public <C> C deleteAt(String uri, Class<C> c)
Requests a deletion of the web resource identified at the specified URI. If an error occurs, then an UniformInterfaceException exception is thrown.- Parameters:
c
- the class of which the returned resource should be an instance.uri
- the uri of the resource to delete.- Returns:
- the web entity.
-
deletionOfAResourceByANonAuthenticatedUser
public void deletionOfAResourceByANonAuthenticatedUser()
-
deletionOfAResourceWithADeprecatedSession
public void deletionOfAResourceWithADeprecatedSession()
-
deletionOfAResourceByANonAuthorizedUser
public void deletionOfAResourceByANonAuthorizedUser()
-
deletionOfAnUnexistingResource
public void deletionOfAnUnexistingResource()
-
-