org.silverpeas.security.web
Class CipherKeyResourceTest

java.lang.Object
  extended by com.sun.jersey.test.framework.JerseyTest
      extended by com.silverpeas.web.RESTWebServiceTest<CryptoTestResources>
          extended by org.silverpeas.security.web.CipherKeyResourceTest

public class CipherKeyResourceTest
extends RESTWebServiceTest<CryptoTestResources>

Unit tests on the services provided by the CipherKeyResource REST-based web resource.


Field Summary
 
Fields inherited from class com.silverpeas.web.RESTWebServiceTest
CONTEXT_NAME
 
Constructor Summary
CipherKeyResourceTest()
           
 
Method Summary
static void createSecurityDirectoryAndSetupJCEProviders()
           
 void deleteKeyFile()
           
static void deleteSecurityDirectory()
           
 String[] getExistingComponentInstances()
          Gets the component instances to take into account in tests.
 void prepareTheUser()
           
 void setCipherKey()
           
 void setNonHexadecimalCipherKey()
           
 void setTheCipherKeyByANonAuthenticatedUser()
           
 void setTheCipherKeyByANonAuthorizedUser()
           
 void setTheCipherKeyWithinADeprecatedSession()
           
 void setTooLongCipherKey()
           
 void setTooShortCipherKey()
           
 void updateCipherKey()
           
 
Methods inherited from class com.silverpeas.web.RESTWebServiceTest
addComponentInstance, addTool, aUser, authenticate, buildQueryParametersFrom, denieAuthorizationToUsers, denieSpaceAuthorizationToUsers, getAccessControllerMock, 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
 

Constructor Detail

CipherKeyResourceTest

public CipherKeyResourceTest()
Method Detail

createSecurityDirectoryAndSetupJCEProviders

public static void createSecurityDirectoryAndSetupJCEProviders()
                                                        throws IOException
Throws:
IOException

deleteSecurityDirectory

public static void deleteSecurityDirectory()
                                    throws IOException
Throws:
IOException

prepareTheUser

public void prepareTheUser()
                    throws Exception
Throws:
Exception

deleteKeyFile

public void deleteKeyFile()
                   throws Exception
Throws:
Exception

setTheCipherKeyByANonAuthenticatedUser

public void setTheCipherKeyByANonAuthenticatedUser()

setTheCipherKeyWithinADeprecatedSession

public void setTheCipherKeyWithinADeprecatedSession()

setTheCipherKeyByANonAuthorizedUser

public void setTheCipherKeyByANonAuthorizedUser()

setCipherKey

public void setCipherKey()
                  throws Exception
Throws:
Exception

updateCipherKey

public void updateCipherKey()
                     throws Exception
Throws:
Exception

setNonHexadecimalCipherKey

public void setNonHexadecimalCipherKey()
                                throws Exception
Throws:
Exception

setTooShortCipherKey

public void setTooShortCipherKey()
                          throws Exception
Throws:
Exception

setTooLongCipherKey

public void setTooLongCipherKey()
                         throws Exception
Throws:
Exception

getExistingComponentInstances

public String[] getExistingComponentInstances()
Gets the component instances to take into account in tests. Theses component instances will be considered as existing. Others than thoses will be rejected with an HTTP error 404 (NOT FOUND).

Specified by:
getExistingComponentInstances in class RESTWebServiceTest<CryptoTestResources>
Returns:
an array with the identifier of the component instances to take into account in tests. The array cannot be null but it can be empty.


Copyright © 2016 Silverpeas. All Rights Reserved.