Package org.mockito

Examples of org.mockito.InOrder


      .when().get(DEPLOYMENT_QUERY_URL);
  }

  @Test
  public void testDeploymentRetrieval() {
    InOrder inOrder = Mockito.inOrder(mockedQuery);

    String queryKey = "Name";
    Response response = given().queryParam("nameLike", queryKey)
        .then().expect().statusCode(Status.OK.getStatusCode())
        .when().get(DEPLOYMENT_QUERY_URL);

    // assert query invocation
    inOrder.verify(mockedQuery).deploymentNameLike(queryKey);
    inOrder.verify(mockedQuery).list();

    String content = response.asString();
    List<String> deployments = from(content).getList("");
    Assert.assertEquals("There should be one deployment returned.", 1, deployments.size());
    Assert.assertNotNull("There should be one deployment returned", deployments.get(0));
View Full Code Here


    return parameters;
  }

  @Test
  public void testSortingParameters() {
    InOrder inOrder = Mockito.inOrder(mockedQuery);
    executeAndVerifySuccessfulSorting("id", "asc", Status.OK);
    inOrder.verify(mockedQuery).orderByDeploymentId();
    inOrder.verify(mockedQuery).asc();

    inOrder = Mockito.inOrder(mockedQuery);
    executeAndVerifySuccessfulSorting("id", "desc", Status.OK);
    inOrder.verify(mockedQuery).orderByDeploymentId();
    inOrder.verify(mockedQuery).desc();

    inOrder = Mockito.inOrder(mockedQuery);
    executeAndVerifySuccessfulSorting("deploymentTime", "asc", Status.OK);
    inOrder.verify(mockedQuery).orderByDeploymenTime();
    inOrder.verify(mockedQuery).asc();

    inOrder = Mockito.inOrder(mockedQuery);
    executeAndVerifySuccessfulSorting("deploymentTime", "desc", Status.OK);
    inOrder.verify(mockedQuery).orderByDeploymenTime();
    inOrder.verify(mockedQuery).desc();

    inOrder = Mockito.inOrder(mockedQuery);
    executeAndVerifySuccessfulSorting("name", "asc", Status.OK);
    inOrder.verify(mockedQuery).orderByDeploymentName();
    inOrder.verify(mockedQuery).asc();

    inOrder = Mockito.inOrder(mockedQuery);
    executeAndVerifySuccessfulSorting("name", "desc", Status.OK);
    inOrder.verify(mockedQuery).orderByDeploymentName();
    inOrder.verify(mockedQuery).desc();
  }
View Full Code Here

   
    Response response = given().queryParam("firstName", queryFirstName)
      .then().expect().statusCode(Status.OK.getStatusCode())
      .when().get(USER_QUERY_URL);
   
    InOrder inOrder = inOrder(mockQuery);
    inOrder.verify(mockQuery).userFirstName(queryFirstName);
    inOrder.verify(mockQuery).list();
   
    String content = response.asString();
    List<String> instances = from(content).getList("");
    Assert.assertEquals("There should be one user returned.", 1, instances.size());
    Assert.assertNotNull("The returned user should not be null.", instances.get(0));
View Full Code Here

    Controller controller = new Controller( remoteUI, uiDescriptor );
    controller.createRootPages( ui );

    controller.showRoot( ui, root2, mock( PageData.class ) );

    InOrder order = inOrder( listener );
    order.verify( listener ).before( ui, getTestPage( controller, root1 ), getTestPage( controller, root2 ) );
    order.verify( listener ).after( ui, getTestPage( controller, root1 ), getTestPage( controller, root2 ) );
  }
View Full Code Here

    Controller controller = new Controller( remoteUI, uiDescriptor );
    controller.createRootPages( ui );

    TestPage testPage = ( TestPage )controller.showPage( ui, page, mock( PageData.class ) ).getPage();

    InOrder order = inOrder( listener );
    order.verify( listener ).before( ui, getTestPage( controller, root1 ), testPage );
    order.verify( listener ).after( ui, getTestPage( controller, root1 ), testPage );
  }
View Full Code Here

    controller.createRootPages( ui );

    controller.showPage( ui, pageDescriptor, mock( PageData.class ) );
    controller.closeCurrentPage( ui );

    InOrder order = inOrder( factory, remoteUI );
    order.verify( factory ).createActionRenderer( ui, remoteUI, descriptor );
    order.verify( factory ).createActionRenderer( ui, remoteUI, descriptor );
    order.verify( remoteUI ).activate( any( PageRenderer.class ) );
  }
View Full Code Here

    Controller controller = new Controller( remoteUI, uiDescriptor );
    controller.createRootPages( ui );

    controller.showPage( ui, pageDescriptor, mock( PageData.class ) );

    InOrder order = inOrder( factory, remoteUI );
    order.verify( factory ).createActionRenderer( ui, remoteUI, descriptor );
    order.verify( remoteUI ).activate( any( PageRenderer.class ) );
  }
View Full Code Here

    Controller controller = new Controller( remoteUI, uiDescriptor );
    controller.createRootPages( ui );

    controller.showRoot( ui, rootPage, mock( PageData.class ) );

    InOrder order = inOrder( factory, remoteUI );
    order.verify( factory ).createActionRenderer( ui, remoteUI, descriptor );
    order.verify( factory ).createActionRenderer( ui, remoteUI, descriptor );
    order.verify( remoteUI ).activate( any( PageRenderer.class ) );
  }
View Full Code Here

    controller.createRootPages( ui );

    TestPage testPage = ( TestPage )controller.showPage( ui, page, mock( PageData.class ) ).getPage();
    controller.closeCurrentPage( ui );

    InOrder order = inOrder( listener );
    order.verify( listener ).before( ui, testPage, getTestPage( controller, rootPage ) );
    order.verify( listener ).after( ui, testPage, getTestPage( controller, rootPage ) );
  }
View Full Code Here

    controller.showPage( ui, page, mock( PageData.class ) );
    controller.showPage( ui, page2, mock( PageData.class ) );

    controller.closeCurrentPage( ui );

    InOrder order = inOrder( listener, remoteObject );
    order.verify( listener ).before( any( UI.class ), any( Page.class ), any( Page.class ) );
    order.verify( remoteObject ).destroy();
    order.verify( listener ).after( any( UI.class ), any( Page.class ), any( Page.class ) );
  }
View Full Code Here

TOP

Related Classes of org.mockito.InOrder

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.