use of com.odysseusinc.arachne.portal.model.statemachine.study.StudyTransition in project ArachneCentralAPI by OHDSI.
the class StudyStateMachineTest method testAnalysisListDiscriminatorChangingInfo.
@Test
public void testAnalysisListDiscriminatorChangingInfo() {
Study activeStudy = createStudy(ACTIVE);
activeStudy.getAnalyses().add(new Analysis());
// now study has one analysis and transitions from Active to Initiate should have Info status
List<StudyTransition> availableStates = stateMachine.getAvailableStates(activeStudy);
assertEquals(2, availableStates.size());
assertTrue(availableStates.get(0).isInfo());
assertFalse(availableStates.get(1).isInfo());
}
use of com.odysseusinc.arachne.portal.model.statemachine.study.StudyTransition in project ArachneCentralAPI by OHDSI.
the class StudyStateMachineTest method testAnalysisListDiscriminatorDoingNothing.
@Test
public void testAnalysisListDiscriminatorDoingNothing() {
Study activeStudy = createStudy(ACTIVE);
List<StudyTransition> availableStates = stateMachine.getAvailableStates(activeStudy);
assertEquals(2, availableStates.size());
assertFalse(availableStates.get(0).isInfo());
assertFalse(availableStates.get(1).isInfo());
}
use of com.odysseusinc.arachne.portal.model.statemachine.study.StudyTransition in project ArachneCentralAPI by OHDSI.
the class StudyStateMachineTest method testAvailableStates.
@Test
public void testAvailableStates() {
Study study = createStudy(INITIATE);
List<StudyTransition> transitionsFrom = stateMachine.getTransitionsFrom(study.getStatus());
assertEquals(1, transitionsFrom.size());
assertEquals(transitionsFrom.get(0).getFrom().getName(), INITIATE);
assertEquals(transitionsFrom.get(0).getTo().getName(), ACTIVE);
}
Aggregations