Search in sources :

Example 1 with TestServer

use of org.activiti.rest.util.TestServerUtil.TestServer in project Activiti by Activiti.

the class SerializableVariablesDiabledTest method setupServer.

@Before
public void setupServer() {
    if (serverUrlPrefix == null) {
        TestServer testServer = TestServerUtil.createAndStartServer(ObjectVariableSerializationDisabledApplicationConfiguration.class);
        serverUrlPrefix = testServer.getServerUrlPrefix();
        this.repositoryService = testServer.getApplicationContext().getBean(RepositoryService.class);
        this.runtimeService = testServer.getApplicationContext().getBean(RuntimeService.class);
        this.identityService = testServer.getApplicationContext().getBean(IdentityService.class);
        this.taskService = testServer.getApplicationContext().getBean(TaskService.class);
        User user = identityService.newUser("kermit");
        user.setFirstName("Kermit");
        user.setLastName("the Frog");
        user.setPassword("kermit");
        identityService.saveUser(user);
        Group group = identityService.newGroup("admin");
        group.setName("Administrators");
        identityService.saveGroup(group);
        identityService.createMembership(user.getId(), group.getId());
        this.testUserId = user.getId();
        this.testGroupId = group.getId();
    }
}
Also used : IdentityService(org.activiti.engine.IdentityService) Group(org.activiti.engine.identity.Group) User(org.activiti.engine.identity.User) RuntimeService(org.activiti.engine.RuntimeService) TaskService(org.activiti.engine.TaskService) TestServer(org.activiti.rest.util.TestServerUtil.TestServer) RepositoryService(org.activiti.engine.RepositoryService) Before(org.junit.Before)

Aggregations

IdentityService (org.activiti.engine.IdentityService)1 RepositoryService (org.activiti.engine.RepositoryService)1 RuntimeService (org.activiti.engine.RuntimeService)1 TaskService (org.activiti.engine.TaskService)1 Group (org.activiti.engine.identity.Group)1 User (org.activiti.engine.identity.User)1 TestServer (org.activiti.rest.util.TestServerUtil.TestServer)1 Before (org.junit.Before)1