Skip to content

Commit

Permalink
Remove usage of classgraph utils in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fmbenhassine committed Sep 2, 2023
1 parent cc4c7ce commit 504f440
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import java.math.BigDecimal;
import java.math.RoundingMode;

import nonapi.io.github.classgraph.utils.ReflectionUtils;
import org.jeasy.random.util.ReflectionUtils;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

Expand Down Expand Up @@ -94,7 +94,7 @@ void generatedValueShouldHaveProvidedPositiveScale() {
}

@Test
void generatedValueShouldHaveProvidedPositiveScaleAndRoundingMode() {
void generatedValueShouldHaveProvidedPositiveScaleAndRoundingMode() throws NoSuchFieldException, IllegalAccessException {
// given
Integer scale = 2;
RoundingMode roundingMode = RoundingMode.DOWN;
Expand All @@ -105,7 +105,8 @@ void generatedValueShouldHaveProvidedPositiveScaleAndRoundingMode() {

then(bigDecimal.scale()).isEqualTo(scale);

var actualRoundingMode = ReflectionUtils.getFieldVal(bigDecimalRangeRandomizer, "roundingMode", false);
var field = bigDecimalRangeRandomizer.getClass().getDeclaredField("roundingMode");
var actualRoundingMode = ReflectionUtils.getFieldValue(bigDecimalRangeRandomizer, field);
then(actualRoundingMode).isEqualTo(RoundingMode.DOWN);
}

Expand Down

0 comments on commit 504f440

Please sign in to comment.