|
|
@@ -5,6 +5,7 @@ import com.ningdatech.pmapi.AppTests; |
|
|
|
import com.ningdatech.pmapi.common.statemachine.util.StateMachineUtils; |
|
|
|
import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; |
|
|
|
import com.ningdatech.pmapi.projectlib.model.entity.Project; |
|
|
|
import com.ningdatech.pmapi.projectlib.service.IProjectService; |
|
|
|
import org.junit.jupiter.api.Test; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
|
|
|
@@ -21,13 +22,14 @@ public class StateMachineTest extends AppTests { |
|
|
|
@Autowired |
|
|
|
private StateMachineUtils stateMachineUtils; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private IProjectService projectService; |
|
|
|
|
|
|
|
@Test |
|
|
|
public void stateMachineTest() { |
|
|
|
Project project = new Project(); |
|
|
|
project.setStage(ProjectStatusEnum.NOT_APPROVED.getCode()); |
|
|
|
project.setStatus(ProjectStatusEnum.UNDER_INTERNAL_AUDIT.getCode()); |
|
|
|
project.setDeclareAmount(BigDecimal.valueOf(2000)); |
|
|
|
stateMachineUtils.withDraw(project); |
|
|
|
Project project = projectService.getById(292); |
|
|
|
stateMachineUtils.pass(project); |
|
|
|
System.out.println(String.format("project:%s", JSON.toJSONString(project))); |
|
|
|
projectService.updateById(project); |
|
|
|
} |
|
|
|
} |