fix:测试计划关联同步接口用例报错
This commit is contained in:
parent
143045c8fc
commit
7f33a80ad7
|
@ -511,21 +511,24 @@ public class TestPlanService {
|
|||
|
||||
}
|
||||
if(StringUtils.equals(l.getTestType(),TestCaseStatus.testcase.name())){
|
||||
TestPlanApiCase t=new TestPlanApiCase();
|
||||
ApiTestCaseWithBLOBs apitest=apiTestCaseMapper.selectByPrimaryKey(l.getTestId());
|
||||
ApiDefinitionWithBLOBs apidefinition=apiDefinitionMapper.selectByPrimaryKey(apitest.getApiDefinitionId());
|
||||
t.setId(UUID.randomUUID().toString());
|
||||
t.setTestPlanId(request.getPlanId());
|
||||
t.setApiCaseId(l.getTestId());
|
||||
t.setEnvironmentId(apidefinition.getEnvironmentId());
|
||||
t.setCreateTime(System.currentTimeMillis());
|
||||
t.setUpdateTime(System.currentTimeMillis());
|
||||
TestPlanApiCaseExample example=new TestPlanApiCaseExample();
|
||||
example.createCriteria().andTestPlanIdEqualTo(request.getPlanId()).andApiCaseIdEqualTo(t.getApiCaseId());
|
||||
if(testPlanApiCaseMapper.countByExample(example)<=0){
|
||||
testPlanApiCaseMapper.insert(t);
|
||||
TestPlanApiCase t = new TestPlanApiCase();
|
||||
ApiTestCaseWithBLOBs apitest = apiTestCaseMapper.selectByPrimaryKey(l.getTestId());
|
||||
if (null != apitest) {
|
||||
ApiDefinitionWithBLOBs apidefinition = apiDefinitionMapper.selectByPrimaryKey(apitest.getApiDefinitionId());
|
||||
t.setId(UUID.randomUUID().toString());
|
||||
t.setTestPlanId(request.getPlanId());
|
||||
t.setApiCaseId(l.getTestId());
|
||||
t.setEnvironmentId(apidefinition.getEnvironmentId());
|
||||
t.setCreateTime(System.currentTimeMillis());
|
||||
t.setUpdateTime(System.currentTimeMillis());
|
||||
TestPlanApiCaseExample example = new TestPlanApiCaseExample();
|
||||
example.createCriteria().andTestPlanIdEqualTo(request.getPlanId()).andApiCaseIdEqualTo(t.getApiCaseId());
|
||||
if (testPlanApiCaseMapper.countByExample(example) <= 0) {
|
||||
testPlanApiCaseMapper.insert(t);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
if(StringUtils.equals(l.getTestType(),TestCaseStatus.automation.name())){
|
||||
TestPlanApiScenario t=new TestPlanApiScenario();
|
||||
|
|
Loading…
Reference in New Issue