@Test public void exceptionIsThrown_whenTryingToMoveToGlobalTestSetupOrTeardownButKeywordIsOfOtherType() { assertThatIllegalArgumentException() .isThrownBy(() -> CommonContextsTransitions.moveToTestSetupOrTeardown(newArrayList(), new RunningKeyword("lib", "kw", KeywordCallType.NORMAL_CALL), null, mock(RobotBreakpointSupplier.class))); assertThatIllegalArgumentException() .isThrownBy(() -> CommonContextsTransitions.moveToTestSetupOrTeardown(newArrayList(), new RunningKeyword("lib", "kw", KeywordCallType.FOR), null, mock(RobotBreakpointSupplier.class))); assertThatIllegalArgumentException() .isThrownBy(() -> CommonContextsTransitions.moveToTestSetupOrTeardown(newArrayList(), new RunningKeyword("lib", "kw", KeywordCallType.FOR_ITERATION), null, mock(RobotBreakpointSupplier.class))); }
static StackFrameContext moveToTestSetupOrTeardown(final List<RobotFile> models, final RunningKeyword keyword, final StackFrameContext previousContext, final RobotBreakpointSupplier breakpointSupplier) { Preconditions.checkArgument(keyword.isSetup() || keyword.isTeardown()); final boolean isSetup = keyword.isSetup(); final StackFrameContext newContext = moveToSuiteDefinedSetupOrTeardown(models, isSetup, keyword, previousContext, breakpointSupplier); if (newContext != null) { return newContext; } else { final URI fileUri = models.get(0).getParent().getProcessedFile().toURI(); final String msg = ErrorMessages.errorOfLocalPrePostKwNotFound(isSetup); final String errorMsg = String.format(msg, keyword.asCall()); return new SetupTeardownContext(fileUri, 1, errorMsg, previousContext); } }
CommonContextsTransitions { static StackFrameContext moveToTestSetupOrTeardown(final List<RobotFile> models, final RunningKeyword keyword, final StackFrameContext previousContext, final RobotBreakpointSupplier breakpointSupplier) { Preconditions.checkArgument(keyword.isSetup() || keyword.isTeardown()); final boolean isSetup = keyword.isSetup(); final StackFrameContext newContext = moveToSuiteDefinedSetupOrTeardown(models, isSetup, keyword, previousContext, breakpointSupplier); if (newContext != null) { return newContext; } else { final URI fileUri = models.get(0).getParent().getProcessedFile().toURI(); final String msg = ErrorMessages.errorOfLocalPrePostKwNotFound(isSetup); final String errorMsg = String.format(msg, keyword.asCall()); return new SetupTeardownContext(fileUri, 1, errorMsg, previousContext); } } }
CommonContextsTransitions { static StackFrameContext moveToTestSetupOrTeardown(final List<RobotFile> models, final RunningKeyword keyword, final StackFrameContext previousContext, final RobotBreakpointSupplier breakpointSupplier) { Preconditions.checkArgument(keyword.isSetup() || keyword.isTeardown()); final boolean isSetup = keyword.isSetup(); final StackFrameContext newContext = moveToSuiteDefinedSetupOrTeardown(models, isSetup, keyword, previousContext, breakpointSupplier); if (newContext != null) { return newContext; } else { final URI fileUri = models.get(0).getParent().getProcessedFile().toURI(); final String msg = ErrorMessages.errorOfLocalPrePostKwNotFound(isSetup); final String errorMsg = String.format(msg, keyword.asCall()); return new SetupTeardownContext(fileUri, 1, errorMsg, previousContext); } }  }
CommonContextsTransitions { static StackFrameContext moveToTestSetupOrTeardown(final List<RobotFile> models, final RunningKeyword keyword, final StackFrameContext previousContext, final RobotBreakpointSupplier breakpointSupplier) { Preconditions.checkArgument(keyword.isSetup() || keyword.isTeardown()); final boolean isSetup = keyword.isSetup(); final StackFrameContext newContext = moveToSuiteDefinedSetupOrTeardown(models, isSetup, keyword, previousContext, breakpointSupplier); if (newContext != null) { return newContext; } else { final URI fileUri = models.get(0).getParent().getProcessedFile().toURI(); final String msg = ErrorMessages.errorOfLocalPrePostKwNotFound(isSetup); final String errorMsg = String.format(msg, keyword.asCall()); return new SetupTeardownContext(fileUri, 1, errorMsg, previousContext); } }   }
CommonContextsTransitions { static StackFrameContext moveToTestSetupOrTeardown(final List<RobotFile> models, final RunningKeyword keyword, final StackFrameContext previousContext, final RobotBreakpointSupplier breakpointSupplier) { Preconditions.checkArgument(keyword.isSetup() || keyword.isTeardown()); final boolean isSetup = keyword.isSetup(); final StackFrameContext newContext = moveToSuiteDefinedSetupOrTeardown(models, isSetup, keyword, previousContext, breakpointSupplier); if (newContext != null) { return newContext; } else { final URI fileUri = models.get(0).getParent().getProcessedFile().toURI(); final String msg = ErrorMessages.errorOfLocalPrePostKwNotFound(isSetup); final String errorMsg = String.format(msg, keyword.asCall()); return new SetupTeardownContext(fileUri, 1, errorMsg, previousContext); } }    }