Search in sources :

Example 1 with PushBatchRequest

use of com.quorum.tessera.p2p.recovery.PushBatchRequest in project tessera by ConsenSys.

the class RecoveryResourceTest method pushBatch.

@Test
public void pushBatch() {
    PushBatchRequest pushBatchRequest = new PushBatchRequest(Collections.singletonList("SomeData".getBytes()));
    Response result = recoveryResource.pushBatch(pushBatchRequest);
    assertThat(result.getStatus()).isEqualTo(200);
    ArgumentCaptor<com.quorum.tessera.recovery.resend.PushBatchRequest> argCaptor = ArgumentCaptor.forClass(com.quorum.tessera.recovery.resend.PushBatchRequest.class);
    verify(resendManager).storeResendBatch(argCaptor.capture());
    com.quorum.tessera.recovery.resend.PushBatchRequest capturedRequest = argCaptor.getValue();
    assertThat(capturedRequest).isNotNull();
    assertThat(capturedRequest.getEncodedPayloads()).containsExactly("SomeData".getBytes());
}
Also used : Response(jakarta.ws.rs.core.Response) PushBatchRequest(com.quorum.tessera.p2p.recovery.PushBatchRequest) Test(org.junit.Test)

Aggregations

PushBatchRequest (com.quorum.tessera.p2p.recovery.PushBatchRequest)1 Response (jakarta.ws.rs.core.Response)1 Test (org.junit.Test)1