Skip to content

Commit

Permalink
Added exception test.
Browse files Browse the repository at this point in the history
Signed-off-by: mark-terry <mark.terry@consensys.net>
  • Loading branch information
mark-terry committed Oct 11, 2022
1 parent 6660c47 commit d9ebbdb
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
package org.hyperledger.besu.ethereum.api.jsonrpc.internal.parameters;

import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;

import org.junit.Test;

Expand Down Expand Up @@ -112,4 +113,11 @@ public void longShouldReturnLongNumberValue() {
assertThat(blockParameter.isPending()).isFalse();
assertThat(blockParameter.isSafe()).isFalse();
}

@Test
public void invalidValueShouldThrowException() {
assertThatThrownBy(() -> new BlockParameter("invalid"))
.isInstanceOf(NumberFormatException.class)
.hasMessageContaining("invalid");
}
}

0 comments on commit d9ebbdb

Please sign in to comment.