-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FieldReflectionArbitraryIntrospector 사용시 Getter, Setter 없이 Fixture 생성 질문드립니다. #961
Comments
@YunNote 님 안녕하세요. 아래 테스트를 통해 확인했을 때도 null로 생성이 됩니다. 혹시 어떤 경우에 기본 생성자만 있을 때 필드도 설정이 되는지 재현 가능한 케이스를 공유해주실 수 있을까요? public class NoGetterNoSetter {
private final String string;
private final String integer;
public NoGetterNoSetter(String string, String integer) {
this.string = string;
this.integer = integer;
}
} @Test
void noGetterNoSetter(){
FixtureMonkey fixtureMonkey = FixtureMonkey.builder()
.objectIntrospector(FieldReflectionArbitraryIntrospector.INSTANCE)
.build();
NoGetterNoSetter actual = fixtureMonkey.giveMeOne(NoGetterNoSetter.class);
then(actual).isNull();
} |
@seongahjo 님 안녕하세요 위 사진처럼 코드를 생성하였습니다.
반드시 final로 사용하였을때문 생성이 안되는것이지 궁금합니다! |
@YunNote 저희 팀 내부에서는 가변 객체를 잘 사용안해서 확인을 못하고 가이드를 잘못드렸군요. 확인 감사합니다! |
@seongahjo 님 안녕하세요 해당 FieldReflectionArbitraryIntrospector 설명에 대한 부분 말씀해주시는 것일까요?? |
@YunNote 아래 참조하시면 어떻게 문서 기여하는지 나와있습니다! 문서가 지금 영어/한글가 있어서 두곳에 반영이 되야할 것 같습니다. |
@seongahjo 작성하여 요청드리겠습니다 ! |
Describe your question
생성할 클래스는 인자가 없는 생성자(또는 기본 생성자)와 getter 또는 setter 중 하나를 가져야 합니다. 라고 설명이 되어있는것으로 확인하였습니다.
테스트시 getter, setter가 없이 기본생성자만 있어도 값이 설정이되는것 같습니다.
해당 부분 제가 잘못이해하였는지 궁금합니다.
fixtureMonkey 버전은 1.0.14 사용중입니다.
The text was updated successfully, but these errors were encountered: