@Test public void shouldValidateReturnTrueWhenSchedulerIsDisabledAndAllTheParamsAreWrong() throws Exception { final int negativeInt = -100; assertions.assertThat(negativeInt).isNegative(); EmailSchedulerProperties emailSchedulerProperties = EmailSchedulerProperties.builder() .enabled(false) .priorityLevels(negativeInt) .persistence(EmailSchedulerProperties.Persistence.builder() .desiredBatchSize(negativeInt) .minKeptInMemory(negativeInt) .maxKeptInMemory(negativeInt) .build()) .build(); boolean givenValidationResult = emailSchedulerProperties.validate(); assertions.assertThat(givenValidationResult).isTrue(); }
@PostConstruct protected boolean validate() { if (enabled) { checkIsValid(this); } else { setValuesToNull(); } return true; }
EmailSchedulerProperties { @PostConstruct protected boolean validate() { if (enabled) { checkIsValid(this); } else { setValuesToNull(); } return true; } }
EmailSchedulerProperties { @PostConstruct protected boolean validate() { if (enabled) { checkIsValid(this); } else { setValuesToNull(); } return true; }  }
EmailSchedulerProperties { @PostConstruct protected boolean validate() { if (enabled) { checkIsValid(this); } else { setValuesToNull(); } return true; }  static void checkIsValid(@NonNull final EmailSchedulerProperties emailSchedulerProperties); }
EmailSchedulerProperties { @PostConstruct protected boolean validate() { if (enabled) { checkIsValid(this); } else { setValuesToNull(); } return true; }  static void checkIsValid(@NonNull final EmailSchedulerProperties emailSchedulerProperties);  }