@Test public void shouldValidateReturnTrueWhenNumberOfPriorityLevelsIsPositiveAndSchedulerIsEnabled() throws Exception { EmailSchedulerProperties emailSchedulerProperties = EmailSchedulerProperties.builder() .enabled(true) .priorityLevels(1) .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);  }