Class CommonTestInjection.BreakpointSetter

  • All Implemented Interfaces:
    Closeable, AutoCloseable
    Enclosing class:
    CommonTestInjection

    public static class CommonTestInjection.BreakpointSetter
    extends Object
    implements Closeable
    Breakpoints should be set via this CommonTestInjection.BreakpointSetter within the test case and close should be invoked as cleanup. Since this is closeable, it should usually be used in the try-with-resource syntax, such as:
    
     try (BreakpointSetter breakpointSetter = new BreakpointSetter() {
         //... test code here that calls breakpointSetter.setImplementation(...)
     }
     
    • Constructor Detail

      • BreakpointSetter

        public BreakpointSetter()
    • Method Detail

      • setImplementation

        public void setImplementation​(String key,
                                      CommonTestInjection.Breakpoint implementation)
        This is usually set by the test cases.

        If a breakpoint implementation is set by this method, then code execution would break at the code execution point marked by CommonTestInjection#injectBreakpoint with matching key, executes the provided implementation in the CommonTestInjection.Breakpoint, then resumes the normal code execution.

        Parameters:
        key - could simply be the fully qualified class name or more granular like class name + other id (such as method name). This should batch the key used in injectBreakpoint
        implementation - The Breakpoint implementation
        See Also:
        CommonTestInjection.injectBreakpoint(String, Object...)