Package org.robotninjas.barge.api

Examples of org.robotninjas.barge.api.RequestVoteResponse


  @Test
  public void onPOSTRequestVoteReturn200WithResponseGivenServiceReturnsResponse() throws Exception {
    when(raftService.requestVote(Model.vote)).thenReturn(Model.voteResponse);

    RequestVoteResponse actual = client().target("/vote")
        .request()
        .post(Entity.entity(Model.vote, MediaType.APPLICATION_JSON_TYPE))
        .readEntity(RequestVoteResponse.class);

    assertThat(actual).isEqualTo(Model.voteResponse);
View Full Code Here


    ScheduledFuture mockScheduledFuture = mock(ScheduledFuture.class);

    when(mockRaftStateContext.type()).thenReturn(CANDIDATE);

    RequestVoteResponse response = RequestVoteResponse.newBuilder().setTerm(0).setVoteGranted(true).build();
    ListenableFuture<RequestVoteResponse> responseFuture = Futures.immediateFuture(response);
    when(mockRaftClient.requestVote(any(Replica.class), any(RequestVote.class))).thenReturn(responseFuture);
  }
View Full Code Here

TOP

Related Classes of org.robotninjas.barge.api.RequestVoteResponse

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.