Package org.pentaho.platform.web.http.api.resources.proxies

Examples of org.pentaho.platform.web.http.api.resources.proxies.BlockStatusProxy


    }
    return getBlockStatusProxy( totallyBlocked, partiallyBlocked );
  }

  protected BlockStatusProxy getBlockStatusProxy( Boolean totallyBlocked, Boolean partiallyBlocked ) {
    return new BlockStatusProxy( totallyBlocked, partiallyBlocked );
  }
View Full Code Here


      @ResponseCode ( code = 200, condition = "Successfully got the blockout status." ),
      @ResponseCode ( code = 401, condition = "User is not authorized to get the blockout status." )
  } )
  public Response getBlockStatus( JobScheduleRequest jobScheduleRequest ) {
    try {
      BlockStatusProxy blockStatusProxy = schedulerService.getBlockStatus( jobScheduleRequest );
      return buildOkResponse( blockStatusProxy );
    } catch ( SchedulerException e ) {
      return buildStatusResponse( Status.UNAUTHORIZED );
    }
  }
View Full Code Here

  @Test
  public void testGetBlockStatus() throws Exception {
    JobScheduleRequest mockJobScheduleRequest = mock( JobScheduleRequest.class );

    BlockStatusProxy mockBlockStatusProxy = mock( BlockStatusProxy.class );
    doReturn( mockBlockStatusProxy ).when( schedulerResource.schedulerService )
      .getBlockStatus( mockJobScheduleRequest );

    Response mockResponse = mock( Response.class );
    doReturn( mockResponse ).when( schedulerResource ).buildOkResponse( mockBlockStatusProxy );
View Full Code Here

  @Test
  public void testGetBlockStatus() throws Exception {

    JobScheduleRequest jobScheduleRequestMock = mock( JobScheduleRequest.class );
    BlockStatusProxy blockStatusProxyMock = mock( BlockStatusProxy.class );
    IJobTrigger jobTrigger = mock( IJobTrigger.class );

    doReturn( jobTrigger ).when( schedulerService ).convertScheduleRequestToJobTrigger( jobScheduleRequestMock );
    doReturn( true ).when( schedulerService.blockoutManager ).isPartiallyBlocked( jobTrigger );
    doReturn( true ).when( schedulerService.blockoutManager ).willFire( jobTrigger );
    doReturn( blockStatusProxyMock ).when( schedulerService ).getBlockStatusProxy( anyBoolean(), anyBoolean() );

    // Test 1
    BlockStatusProxy blockStatusProxy = schedulerService.getBlockStatus( jobScheduleRequestMock );

    assertNotNull( blockStatusProxy );

    // Test 2
    doReturn( false ).when( schedulerService.blockoutManager ).isPartiallyBlocked( jobTrigger );
View Full Code Here

TOP

Related Classes of org.pentaho.platform.web.http.api.resources.proxies.BlockStatusProxy

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.