Search in sources :

Example 1 with ConstructionDeriveRequestMetadataValidator

use of com.radixdlt.api.core.openapitools.model.ConstructionDeriveRequestMetadataValidator in project radixdlt by radixdlt.

the class ConstructionDeriveHandlerTest method derive_validator_request_should_return_validator_entity_identifier.

@Test
public void derive_validator_request_should_return_validator_entity_identifier() throws CoreApiException {
    // Arrange
    var publicKey = PrivateKeys.ofNumeric(2).getPublicKey();
    start();
    // Act
    var request = new ConstructionDeriveRequest().networkIdentifier(networkIdentifier()).publicKey(coreModelMapper.publicKey(publicKey)).metadata(new ConstructionDeriveRequestMetadataValidator().type("Validator"));
    var response = sut.handleRequest(request);
    // Assert
    assertThat(response.getEntityIdentifier()).isEqualTo(coreModelMapper.entityIdentifier(publicKey));
}
Also used : ConstructionDeriveRequestMetadataValidator(com.radixdlt.api.core.openapitools.model.ConstructionDeriveRequestMetadataValidator) ConstructionDeriveRequest(com.radixdlt.api.core.openapitools.model.ConstructionDeriveRequest) ApiTest(com.radixdlt.api.ApiTest) Test(org.junit.Test)

Aggregations

ApiTest (com.radixdlt.api.ApiTest)1 ConstructionDeriveRequest (com.radixdlt.api.core.openapitools.model.ConstructionDeriveRequest)1 ConstructionDeriveRequestMetadataValidator (com.radixdlt.api.core.openapitools.model.ConstructionDeriveRequestMetadataValidator)1 Test (org.junit.Test)1