Skip to content

Commit

Permalink
#415: Use static import for BigInteger.valueOf to keep codacy happy.
Browse files Browse the repository at this point in the history
Not actually part of this branch, but it was a remark when updating the
maven surefire plugin in a previous issue, but was missed.
  • Loading branch information
mvanaken committed Mar 19, 2024
1 parent 702c690 commit f7c9257
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,16 @@ private Optional<ParseState> setupResult() {
@Test
public void createSliceFromParseValue() {
final ParseValue value = setupValue();
assertTrue(value.slice().source.isAvailable(ZERO, BigInteger.valueOf(4)));
assertFalse(value.slice().source.isAvailable(ZERO, BigInteger.valueOf(5)));
assertTrue(value.slice().source.isAvailable(ZERO, valueOf(4)));
assertFalse(value.slice().source.isAvailable(ZERO, valueOf(5)));
}

@Test
public void indexOutOfBounds() {
final Optional<ParseState> result = setupResult();
final DataExpressionSource source = new DataExpressionSource(ref("a"), 1, result.get(), enc());

final Exception e = Assertions.assertThrows(IllegalStateException.class, () -> source.getData(ZERO, BigInteger.valueOf(4)));
final Exception e = Assertions.assertThrows(IllegalStateException.class, () -> source.getData(ZERO, valueOf(4)));
assertEquals("ValueExpression dataExpression yields 1 result(s) (expected at least 2).", e.getMessage());
}

Expand Down

0 comments on commit f7c9257

Please sign in to comment.