use of tech.pegasys.teku.api.response.v1.validator.GetAggregatedAttestationResponse in project teku by ConsenSys.
the class OkHttpValidatorRestApiClientTest method createAggregate_WhenSuccess_ReturnsAttestation.
@Test
public void createAggregate_WhenSuccess_ReturnsAttestation() {
final Bytes32 attestationHashTreeRoot = Bytes32.random();
final Attestation expectedAttestation = schemaObjects.attestation();
mockWebServer.enqueue(new MockResponse().setResponseCode(SC_OK).setBody(asJson(new GetAggregatedAttestationResponse(expectedAttestation))));
final Optional<Attestation> attestation = apiClient.createAggregate(UInt64.ONE, attestationHashTreeRoot);
assertThat(attestation).isPresent();
assertThat(attestation.get()).usingRecursiveComparison().isEqualTo(expectedAttestation);
}
Aggregations