use of com.radixdlt.api.core.openapitools.model.PublicKey in project radixdlt by radixdlt.
the class ConstructionDeriveHandlerTest method invalid_public_key_should_throw_exception.
@Test
public void invalid_public_key_should_throw_exception() {
// Arrange
start();
// Act
// Assert
var request = new ConstructionDeriveRequest().networkIdentifier(new NetworkIdentifier().network("localnet")).publicKey(new PublicKey().hex("deadbeaddeadbead")).metadata(new ConstructionDeriveRequestMetadataToken().symbol("test").type("Token"));
assertThatThrownBy(() -> sut.handleRequest(request)).isInstanceOfSatisfying(CoreApiException.class, e -> {
var error = e.toError();
assertThat(error.getDetails()).isInstanceOf(InvalidPublicKeyError.class);
assertThat(error.getCode()).isEqualTo(CoreApiErrorCode.BAD_REQUEST.getErrorCode());
});
}
Aggregations