Closed junyoung-kang-kurly closed 3 months ago
SimpleValueJqwikPlugin 사용시 Set 유형에 2개이상 엘리먼트에 할당되도록 했을시, sample 객체 생성이 완료되지 못하고 무한루프 하고 있습니다.
public class TestObject { private Set<Integer> integers; public Collection<Integer> getIntegers() { return integers; } }
public class SampleCreatingFailureTest { @Property(tries = 10) void test() { // given FixtureMonkey sut = FixtureMonkey.builder() .objectIntrospector(FieldReflectionArbitraryIntrospector.INSTANCE) .plugin(new SimpleValueJqwikPlugin()) .build(); // when - sample 객체가 생성되지 않고 무한루프 합니다. TestObject actual = sut.giveMeBuilder(TestObject.class) .size("integers", 2) .sample(); // then then(actual).isNotNull(); then(actual.getIntegers()).hasSize(2); } }
Set<Integer> integers 필드에 2개의 엘리먼트에 임의 값들이 할당되어야 합니다.
Set<Integer> integers
하지만 무한루프와 함께 할당이 되지 않고 객체생성이 되지 않아 .sample() 다음 라인으로 진행되지 않습니다.
아래 조치중 하나를 하면 정상 동작하고 있습니다.
.size("integers", 1)
Set<Integer>
Set<String>
@junyoung-kang-kurly 1.0.18에서 해결됐습니다! 감사합니다~
Describe the bug
SimpleValueJqwikPlugin 사용시 Set 유형에 2개이상 엘리먼트에 할당되도록 했을시, sample 객체 생성이 완료되지 못하고 무한루프 하고 있습니다.
Your environment
Steps to reproduce
Expected behaviour
Set<Integer> integers
필드에 2개의 엘리먼트에 임의 값들이 할당되어야 합니다.Actual behaviour
하지만 무한루프와 함께 할당이 되지 않고 객체생성이 되지 않아 .sample() 다음 라인으로 진행되지 않습니다.
아래 조치중 하나를 하면 정상 동작하고 있습니다.
.size("integers", 1)
로 변경)Set<Integer>
의 제네릭을 Number가 아닌 유형으로 변경. (예:Set<String>
)