| | |
| | | } |
| | | |
| | | @Test |
| | | void createShouldAllowPlanStepsToBeConfiguredLater() |
| | | { |
| | | TTest test = validTest(); |
| | | test.setPlanSteps(Collections.emptyList()); |
| | | mockEnabledOptions(); |
| | | when(testMapper.insertTest(any(TTest.class))).thenAnswer(invocation -> { |
| | | invocation.<TTest>getArgument(0).setTestId(10L); |
| | | return 1; |
| | | }); |
| | | doAnswer(invocation -> { |
| | | invocation.<TTestBattery>getArgument(0).setRelationId(20L); |
| | | return 1; |
| | | }).when(testMapper).insertTestBattery(any(TTestBattery.class)); |
| | | |
| | | assertEquals(10L, testService.createTest(test)); |
| | | |
| | | verify(testMapper, never()).insertTestPlanStep(any(TTestPlanStep.class)); |
| | | } |
| | | |
| | | @Test |
| | | void createShouldRejectBatteryOutsideSelectedGroup() |
| | | { |
| | | TTest test = validTest(); |