SetupTeardownContext extends DefaultContext { @Override public Optional<RobotBreakpoint> getLineBreakpoint() { return breakpointSupplier.lineBreakpointFor(locationUri, line); } SetupTeardownContext(final URI locationUri, final String keywordName, final int line,
            final StackFrameContext previousContext,
            final RobotBreakpointSupplier breakpointSupplier);   SetupTeardownContext(final String errorMessage, final StackFrameContext previousContext);   SetupTeardownContext(final URI locationUri, final int line, final String errorMessage,
            final StackFrameContext previousContext);   SetupTeardownContext(final URI locationUri, final int line, final String errorMessage,
            final StackFrameContext previousContext, final RobotBreakpointSupplier breakpointSupplier); private  SetupTeardownContext(final URI locationUri, final String keywordName, final int line,
            final String errorMessage, final StackFrameContext previousContext,
            final RobotBreakpointSupplier breakpointSupplier); @Override boolean isErroneous(); @Override Optional<String> getErrorMessage(); @Override Optional<URI> getAssociatedPath(); @Override Optional<FileRegion> getFileRegion(); @Override StackFrameContext moveTo(final RunningKeyword keyword, final RobotBreakpointSupplier breakpointSupplier); @Override StackFrameContext previousContext(); @Override Optional<RobotBreakpoint> getLineBreakpoint(); @Override Optional<RobotBreakpoint> getKeywordFailBreakpoint(final QualifiedKeywordName currentlyFailedKeyword);  }
@Test public void lineBreakpointIsProvidedThroughSupplier_1() { final RobotBreakpointSupplier breakpointSupplier = mock(RobotBreakpointSupplier.class); final RobotBreakpoint breakpoint = mock(RobotBreakpoint.class); when(breakpointSupplier.lineBreakpointFor(URI.create("file: .thenReturn(Optional.of(breakpoint)); final SetupTeardownContext context = new SetupTeardownContext(URI.create("file: mock(StackFrameContext.class), breakpointSupplier); assertThat(context.getLineBreakpoint()).contains(breakpoint); }
@Test public void lineBreakpointIsProvidedThroughSupplier_2() { final RobotBreakpointSupplier breakpointSupplier = mock(RobotBreakpointSupplier.class); final RobotBreakpoint breakpoint = mock(RobotBreakpoint.class); when(breakpointSupplier.lineBreakpointFor(URI.create("file: .thenReturn(Optional.of(breakpoint)); final SetupTeardownContext context = new SetupTeardownContext(URI.create("file: mock(StackFrameContext.class), breakpointSupplier); assertThat(context.getLineBreakpoint()).contains(breakpoint); }
@Test public void noLineBreakpointIsProvided_1() { final SetupTeardownContext context = new SetupTeardownContext(null, mock(StackFrameContext.class)); assertThat(context.getLineBreakpoint()).isEmpty(); }
@Test public void noLineBreakpointIsProvided_2() { final SetupTeardownContext context = new SetupTeardownContext(URI.create("file: mock(StackFrameContext.class)); assertThat(context.getLineBreakpoint()).isEmpty(); }