Search in sources :

Example 1 with PasswordValidator

use of org.cloudfoundry.identity.uaa.scim.validate.PasswordValidator in project uaa by cloudfoundry.

the class UaaChangePasswordServiceTest method setUp.

@Before
public void setUp() {
    SecurityContextHolder.clearContext();
    SecurityContextHolder.getContext().setAuthentication(new MockAuthentication());
    scimUserProvisioning = mock(ScimUserProvisioning.class);
    passwordValidator = mock(PasswordValidator.class);
    subject = new UaaChangePasswordService(scimUserProvisioning, passwordValidator);
}
Also used : MockAuthentication(org.cloudfoundry.identity.uaa.test.MockAuthentication) PasswordValidator(org.cloudfoundry.identity.uaa.scim.validate.PasswordValidator) ScimUserProvisioning(org.cloudfoundry.identity.uaa.scim.ScimUserProvisioning) UaaChangePasswordService(org.cloudfoundry.identity.uaa.account.UaaChangePasswordService) Before(org.junit.Before)

Example 2 with PasswordValidator

use of org.cloudfoundry.identity.uaa.scim.validate.PasswordValidator in project uaa by cloudfoundry.

the class UaaResetPasswordServiceTests method setUp.

@BeforeEach
void setUp() {
    SecurityContextHolder.clearContext();
    scimUserProvisioning = mock(ScimUserProvisioning.class);
    codeStore = mock(ExpiringCodeStore.class);
    passwordValidator = mock(PasswordValidator.class);
    clientDetailsService = mock(MultitenantClientServices.class);
    RandomValueStringGenerator randomValueStringGenerator = new RandomValueStringGenerator();
    currentZoneId = "currentZoneId-" + randomValueStringGenerator.generate();
    IdentityZoneManager mockIdentityZoneManager = mock(IdentityZoneManager.class);
    when(mockIdentityZoneManager.getCurrentIdentityZoneId()).thenReturn(currentZoneId);
    ResourcePropertySource resourcePropertySource = mock(ResourcePropertySource.class);
    uaaResetPasswordService = new UaaResetPasswordService(scimUserProvisioning, codeStore, passwordValidator, clientDetailsService, resourcePropertySource, mockIdentityZoneManager);
}
Also used : MultitenantClientServices(org.cloudfoundry.identity.uaa.zone.MultitenantClientServices) ResourcePropertySource(org.springframework.core.io.support.ResourcePropertySource) UaaResetPasswordService(org.cloudfoundry.identity.uaa.account.UaaResetPasswordService) PasswordValidator(org.cloudfoundry.identity.uaa.scim.validate.PasswordValidator) ExpiringCodeStore(org.cloudfoundry.identity.uaa.codestore.ExpiringCodeStore) RandomValueStringGenerator(org.springframework.security.oauth2.common.util.RandomValueStringGenerator) ScimUserProvisioning(org.cloudfoundry.identity.uaa.scim.ScimUserProvisioning) IdentityZoneManager(org.cloudfoundry.identity.uaa.zone.beans.IdentityZoneManager) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

ScimUserProvisioning (org.cloudfoundry.identity.uaa.scim.ScimUserProvisioning)2 PasswordValidator (org.cloudfoundry.identity.uaa.scim.validate.PasswordValidator)2 UaaChangePasswordService (org.cloudfoundry.identity.uaa.account.UaaChangePasswordService)1 UaaResetPasswordService (org.cloudfoundry.identity.uaa.account.UaaResetPasswordService)1 ExpiringCodeStore (org.cloudfoundry.identity.uaa.codestore.ExpiringCodeStore)1 MockAuthentication (org.cloudfoundry.identity.uaa.test.MockAuthentication)1 MultitenantClientServices (org.cloudfoundry.identity.uaa.zone.MultitenantClientServices)1 IdentityZoneManager (org.cloudfoundry.identity.uaa.zone.beans.IdentityZoneManager)1 Before (org.junit.Before)1 BeforeEach (org.junit.jupiter.api.BeforeEach)1 ResourcePropertySource (org.springframework.core.io.support.ResourcePropertySource)1 RandomValueStringGenerator (org.springframework.security.oauth2.common.util.RandomValueStringGenerator)1