TSK-65: Fix tests because of failure and update UserPrincipal
This commit is contained in:
parent
6ed308a767
commit
150508e8e9
|
@ -13,10 +13,7 @@ public class UserPrincipal implements Principal {
|
|||
this.name = name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return this.name;
|
||||
}
|
||||
|
|
|
@ -109,13 +109,14 @@ public class TaskServiceImplIntAutocommitTest {
|
|||
throws FileNotFoundException, SQLException, TaskNotFoundException, NotAuthorizedException, WorkbasketNotFoundException, ClassificationNotFoundException {
|
||||
TaskanaEngineConfiguration taskanaEngineConfiguration = new TaskanaEngineConfiguration(null, false, false);
|
||||
TaskanaEngine te = taskanaEngineConfiguration.buildTaskanaEngine();
|
||||
((TaskanaEngineImpl) te).setConnectionManagementMode(ConnectionManagementMode.AUTOCOMMIT);
|
||||
TaskServiceImpl taskServiceImpl = (TaskServiceImpl) te.getTaskService();
|
||||
|
||||
Workbasket wb = new Workbasket();
|
||||
wb.setName("workbasket");
|
||||
taskanaEngine.getWorkbasketService().createWorkbasket(wb);
|
||||
te.getWorkbasketService().createWorkbasket(wb);
|
||||
Classification classification = new Classification();
|
||||
taskanaEngine.getClassificationService().addClassification(classification);
|
||||
te.getClassificationService().addClassification(classification);
|
||||
|
||||
Task task = new Task();
|
||||
task.setName("Unit Test Task");
|
||||
|
|
|
@ -92,12 +92,12 @@ public class TaskServiceImplIntExplicitTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testTaskService() throws Throwable {
|
||||
public void testCreateTask() throws Throwable {
|
||||
try {
|
||||
Subject.doAs(subject, new PrivilegedExceptionAction<Object>() {
|
||||
@Override
|
||||
public Object run() throws TaskNotFoundException, WorkbasketNotFoundException, FileNotFoundException, NotAuthorizedException, SQLException, ClassificationNotFoundException {
|
||||
do_testTaskService();
|
||||
do_testCreateTask();
|
||||
return null;
|
||||
}
|
||||
});
|
||||
|
@ -106,7 +106,7 @@ public class TaskServiceImplIntExplicitTest {
|
|||
}
|
||||
}
|
||||
|
||||
public void do_testTaskService() throws FileNotFoundException, SQLException, TaskNotFoundException, NotAuthorizedException, WorkbasketNotFoundException, ClassificationNotFoundException {
|
||||
public void do_testCreateTask() throws FileNotFoundException, SQLException, TaskNotFoundException, NotAuthorizedException, WorkbasketNotFoundException, ClassificationNotFoundException {
|
||||
Connection connection = dataSource.getConnection();
|
||||
taskanaEngineImpl.setConnection(connection);
|
||||
|
||||
|
@ -193,7 +193,7 @@ public class TaskServiceImplIntExplicitTest {
|
|||
ClassificationServiceImpl classificationServiceImpl = (ClassificationServiceImpl) te.getClassificationService();
|
||||
|
||||
Workbasket workbasket = new Workbasket();
|
||||
workbasket.setName("workbasket");
|
||||
workbasket.setName("workbasket99");
|
||||
Classification classification = new Classification();
|
||||
workbasketServiceImpl.createWorkbasket(workbasket);
|
||||
classificationServiceImpl.addClassification(classification);
|
||||
|
|
Loading…
Reference in New Issue