@Test void testUpdatePasswordPolicyShouldThrowExceptionWhenThePasswordPolicyRetrieveThrowsAnException() throws FreeIpaClientException { when(freeIpaClient.getPasswordPolicy()).thenThrow(new FreeIpaClientException("Error")); Assertions.assertThrows(FreeIpaClientException.class, () -> { underTest.updatePasswordPolicy(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); } }    }