Package org.jboss.seam.mock.ResourceRequestEnvironment

Examples of org.jboss.seam.mock.ResourceRequestEnvironment.ResourceRequest


   }

   @Test
   public void adminRoleTestWithRestriction() throws Exception
   {
      new ResourceRequest(requestEnv, Method.GET, "/restv1/secured/restrictedAdmin")
      {
         @Override
         protected void prepareRequest(EnhancedMockHttpServletRequest request)
         {
            super.prepareRequest(request);
View Full Code Here


   }

   @Test
   public void invalidAdminAuthorization() throws Exception
   {
      new ResourceRequest(requestEnv, Method.GET, "/restv1/secured/restrictedAdmin")
      {
         @Override
         protected void prepareRequest(EnhancedMockHttpServletRequest request)
         {
            super.prepareRequest(request);
View Full Code Here

  
   @Test
   // JBPAPP-3713
   public void ejbLookup() throws Exception
   {
      new ResourceRequest(requestEnv, Method.GET, "/restv1/secured/ejbLookup")
      {
         @Override
         protected void prepareRequest(EnhancedMockHttpServletRequest request)
         {
            super.prepareRequest(request);
View Full Code Here

  
    @Test
   // JBPAPP-3713
   public void synchronizationsLookup() throws Exception
   {
      new ResourceRequest(requestEnv, Method.GET, "/restv1/secured/synchronizationsLookup")
      {
         @Override
         protected void prepareRequest(EnhancedMockHttpServletRequest request)
         {
            super.prepareRequest(request);
View Full Code Here

   @Test(dataProvider = "contextDataTypes")
   public void testContextData(String pathSegment) throws Exception
   {
      final String path = "/restv1/contextData" + pathSegment;

      new ResourceRequest(new ResourceRequestEnvironment(this), Method.GET, path)
      {

         @Override
         protected void prepareRequest(EnhancedMockHttpServletRequest request)
         {
View Full Code Here

   public void createTaskTest() throws Exception
   {
      final String mimeType = "application/json";
      final String representation = "{\"task\":{\"name\":\"Test task\"}}";
     
      new ResourceRequest(new ResourceRequestEnvironment(this), Method.POST, "/v1/auth/category/School/unresolved")
      {
        
         @Override
         protected void prepareRequest(EnhancedMockHttpServletRequest request)
         {
View Full Code Here

   public void editTaskTest() throws Exception
   {
      final String mimeType = "application/xml";
      final String representation = "<task><id>4</id><name>Learn new English vocabulary</name></task>";

      new ResourceRequest(new ResourceRequestEnvironment(this), Method.PUT, "/v1/auth/category/School/unresolved/4")
      {

         @Override
         protected void prepareRequest(EnhancedMockHttpServletRequest request)
         {
            super.prepareRequest(request);
            request.addHeader("Authorization", "Basic ZGVtbzpkZW1v"); // demo:demo
            request.addHeader("Content-Type", mimeType);
            request.setContentType(mimeType);
            request.setContent(representation.getBytes());
         }

         @Override
         protected void onResponse(EnhancedMockHttpServletResponse response)
         {
            super.onResponse(response);
            assertEquals(response.getStatus(), 204, "Unexpected response code.");
         }

      }.run();

      new ResourceRequest(new ResourceRequestEnvironment(this), Method.GET, "/v1/auth/category/School/unresolved/4")
      {

         @Override
         protected void prepareRequest(EnhancedMockHttpServletRequest request)
         {
View Full Code Here

   }
  
   @Test
   public void deleteTaskTest() throws Exception
   {
      new ResourceRequest(new ResourceRequestEnvironment(this), Method.DELETE, "/v1/auth/category/School/unresolved/2")
      {
        
         @Override
         protected void prepareRequest(EnhancedMockHttpServletRequest request)
         {
View Full Code Here

   public void resolveTask() throws Exception {
     
      final String mimeType = "application/xml";
      final String representation = "<task><id>14</id></task>";
     
      new ResourceRequest(new ResourceRequestEnvironment(this), Method.PUT, "/v1/auth/category/School/resolved/14")
      {

         @Override
         protected void prepareRequest(EnhancedMockHttpServletRequest request)
         {
View Full Code Here

   }
  
   @Test(dataProvider="data")
   public void editTaskTest(final String mimeType, final String expectedResponsePart) throws Exception
   {
      new ResourceRequest(new ResourceRequestEnvironment(this), Method.GET, "/v1/user/demo/tasks/resolved")
      {

         @Override
         protected void prepareRequest(EnhancedMockHttpServletRequest request)
         {
View Full Code Here

TOP

Related Classes of org.jboss.seam.mock.ResourceRequestEnvironment.ResourceRequest

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.