package com.capgemini.reports.teamcenter.queries.saved;

import com.capgemini.framework.teamcenter.exceptions.NoTeamcenterConnectionException;
import com.capgemini.framework.teamcenter.policies.PolicyLocation;
import com.capgemini.reports.AbstractTeamcenterTest;
import com.teamcenter.schemas.soa._2006_03.exceptions.ServiceException;
import com.teamcenter.soa.client.model.strong.EPMTask;
import org.junit.Assert;
import org.junit.Test;

import java.util.List;

public class WorkflowOnChangeQueryTest extends AbstractTeamcenterTest {

    @Test
    public void testSearchWorkflow() throws ServiceException, NoTeamcenterConnectionException {
        List<EPMTask> result = new WorkflowOnChangeQuery(getSession()).searchIDAndRevision("MOD200381", "A").searchSequenceId("1").findAll();
        Assert.assertNotNull(result);
        Assert.assertFalse(result.isEmpty());
    }

    @Test
    public void testSearchWorkflow2() throws ServiceException, NoTeamcenterConnectionException {
        List<EPMTask> result = new WorkflowOnChangeQuery(getSession()).searchIDAndRevision("FPP0020016", "AA").searchSequenceId("1").findAll();
        Assert.assertNotNull(result);
        Assert.assertFalse(result.isEmpty());
    }

    @Override
    public PolicyLocation getPropertyPolicyIdentifier() {
        return R13_POLICY_FULL;
    }
}
