@Test void testUpdatePasswordPolicyShouldNotUpdateAllPropertyWhenAllExistingPropertyCorrect() throws FreeIpaClientException { PasswordPolicy passwordPolicy = new PasswordPolicy(); passwordPolicy.setKrbmaxpwdlife(MAX_PASSWORD_LIFETIME_DAYS_VALUE); passwordPolicy.setKrbpwdfailurecountinterval(FAILURE_RESET_INTERVALL_SECONDS_VALUE); passwordPolicy.setKrbpwdlockoutduration(LOCKOUT_DURATION_SECONDS_VALUE); passwordPolicy.setKrbpwdmaxfailure(MAX_FAILURES_BEFORE_LOCK_VALUE); passwordPolicy.setKrbpwdminlength(MIN_PASSWORD_LENGTH_VALUE); passwordPolicy.setKrbpwdmindiffchars(MIN_CHARACTER_CLASSES_VALUE); when(freeIpaClient.getPasswordPolicy()).thenReturn(passwordPolicy); underTest.updatePasswordPolicy(freeIpaClient); verify(freeIpaClient).getPasswordPolicy(); verifyNoMoreInteractions(freeIpaClient); }
void updatePasswordPolicy(FreeIpaClient freeIpaClient) throws FreeIpaClientException { PasswordPolicy config = freeIpaClient.getPasswordPolicy(); Map<String, Object> params = getParameters(config); if (!params.isEmpty()) { freeIpaClient.updatePasswordPolicy(params); } }
PasswordPolicyService { void updatePasswordPolicy(FreeIpaClient freeIpaClient) throws FreeIpaClientException { PasswordPolicy config = freeIpaClient.getPasswordPolicy(); Map<String, Object> params = getParameters(config); if (!params.isEmpty()) { freeIpaClient.updatePasswordPolicy(params); } } }
PasswordPolicyService { void updatePasswordPolicy(FreeIpaClient freeIpaClient) throws FreeIpaClientException { PasswordPolicy config = freeIpaClient.getPasswordPolicy(); Map<String, Object> params = getParameters(config); if (!params.isEmpty()) { freeIpaClient.updatePasswordPolicy(params); } }  }
PasswordPolicyService { void updatePasswordPolicy(FreeIpaClient freeIpaClient) throws FreeIpaClientException { PasswordPolicy config = freeIpaClient.getPasswordPolicy(); Map<String, Object> params = getParameters(config); if (!params.isEmpty()) { freeIpaClient.updatePasswordPolicy(params); } }   }
PasswordPolicyService { void updatePasswordPolicy(FreeIpaClient freeIpaClient) throws FreeIpaClientException { PasswordPolicy config = freeIpaClient.getPasswordPolicy(); Map<String, Object> params = getParameters(config); if (!params.isEmpty()) { freeIpaClient.updatePasswordPolicy(params); } }    }