-
Notifications
You must be signed in to change notification settings - Fork 742
Open
Description
It seems that podam does not randomize property with proper accessors.
import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.Test;
import uk.co.jemos.podam.api.PodamFactoryImpl;
import uk.co.jemos.podam.api.RandomDataProviderStrategyImpl;
import static org.assertj.core.api.Assertions.assertThat;
@Slf4j
class ZzzRemoveMe {
@Test
void __() {
class Some {
public Boolean getDef() {
return def;
}
public void setDef(Boolean def) {
this.def = def;
}
public Boolean getIsGhi() { // STANDARD getter of the `isGhi` field
return isGhi;
}
public void setIsGhi(Boolean isGhi) { // STANDARD setter of the `isGhi` field
isGhi = isGhi;
}
private Boolean def;
private Boolean isGhi;
}
final var manufactured = new PodamFactoryImpl(new RandomDataProviderStrategyImpl()).manufacturePojo(Some.class);
assertThat(manufactured.getDef())
.as("def")
.isNotNull();
assertThat(manufactured.getIsGhi())
.as("isGhi")
.isNotNull();
}
}
Adding non standard accessors doesn't help.
public Boolean getGhi() { // Not a getter the the field; doesn't work anyway
return isGhi;
}
public void setGhi(Boolean ghi) { // Not a setter for the field; doesn't work anyway
isGhi = isGhi;
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels