Search in sources :

Example 6 with UpdateUserParams

use of com.enonic.xp.security.UpdateUserParams in project xp by enonic.

the class ModifyProfileHandlerTest method testExamples.

@Test
public void testExamples() {
    final User user = TestDataFixtures.getTestUser();
    Mockito.when(securityService.getUser(Mockito.any())).thenReturn(Optional.of(user));
    Mockito.when(this.securityService.updateUser(Mockito.isA(UpdateUserParams.class))).thenAnswer(invocationOnMock -> invokeUpdate((UpdateUserParams) invocationOnMock.getArguments()[0], user));
    runScript("/lib/xp/examples/auth/modifyProfile.js");
}
Also used : User(com.enonic.xp.security.User) EditableUser(com.enonic.xp.security.EditableUser) UpdateUserParams(com.enonic.xp.security.UpdateUserParams) Test(org.junit.jupiter.api.Test)

Aggregations

UpdateUserParams (com.enonic.xp.security.UpdateUserParams)6 User (com.enonic.xp.security.User)6 Test (org.junit.jupiter.api.Test)5 AbstractElasticsearchIntegrationTest (com.enonic.xp.repo.impl.elasticsearch.AbstractElasticsearchIntegrationTest)3 CreateUserParams (com.enonic.xp.security.CreateUserParams)3 EditableUser (com.enonic.xp.security.EditableUser)3 PrincipalKey (com.enonic.xp.security.PrincipalKey)2 Context (com.enonic.xp.context.Context)1 ContextBuilder (com.enonic.xp.context.ContextBuilder)1 PropertySet (com.enonic.xp.data.PropertySet)1 PropertyTree (com.enonic.xp.data.PropertyTree)1 EventPublisher (com.enonic.xp.event.EventPublisher)1 MemoryBlobStore (com.enonic.xp.internal.blobstore.MemoryBlobStore)1 BinaryServiceImpl (com.enonic.xp.repo.impl.binary.BinaryServiceImpl)1 BranchServiceImpl (com.enonic.xp.repo.impl.branch.storage.BranchServiceImpl)1 IndexServiceInternalImpl (com.enonic.xp.repo.impl.elasticsearch.IndexServiceInternalImpl)1 SearchDaoImpl (com.enonic.xp.repo.impl.elasticsearch.search.SearchDaoImpl)1 StorageDaoImpl (com.enonic.xp.repo.impl.elasticsearch.storage.StorageDaoImpl)1 IndexServiceImpl (com.enonic.xp.repo.impl.index.IndexServiceImpl)1 NodeServiceImpl (com.enonic.xp.repo.impl.node.NodeServiceImpl)1