Search in sources :

Example 1 with GetAttestationDataResponse

use of tech.pegasys.teku.api.response.v1.validator.GetAttestationDataResponse in project teku by ConsenSys.

the class OkHttpValidatorRestApiClientTest method createAttestationData_WhenSuccessWithNonData_ReturnsAttestationData.

@Test
public void createAttestationData_WhenSuccessWithNonData_ReturnsAttestationData() {
    final UInt64 slot = UInt64.ONE;
    final int committeeIndex = 1;
    final AttestationData expectedAttestationData = schemaObjects.attestation().data;
    mockWebServer.enqueue(new MockResponse().setResponseCode(SC_OK).setBody(asJson(new GetAttestationDataResponse(expectedAttestationData))));
    Optional<AttestationData> attestationData = apiClient.createAttestationData(slot, committeeIndex);
    assertThat(attestationData).isPresent();
    assertThat(attestationData.get()).usingRecursiveComparison().isEqualTo(expectedAttestationData);
}
Also used : AttestationData(tech.pegasys.teku.api.schema.AttestationData) MockResponse(okhttp3.mockwebserver.MockResponse) GetAttestationDataResponse(tech.pegasys.teku.api.response.v1.validator.GetAttestationDataResponse) UInt64(tech.pegasys.teku.infrastructure.unsigned.UInt64) Test(org.junit.jupiter.api.Test)

Aggregations

MockResponse (okhttp3.mockwebserver.MockResponse)1 Test (org.junit.jupiter.api.Test)1 GetAttestationDataResponse (tech.pegasys.teku.api.response.v1.validator.GetAttestationDataResponse)1 AttestationData (tech.pegasys.teku.api.schema.AttestationData)1 UInt64 (tech.pegasys.teku.infrastructure.unsigned.UInt64)1