Interface Mocks

  • All Known Implementing Classes:
    EmptyMocks

    public interface Mocks
    Hooks to mock the engine that provide test doubles for offline unit testing of stacks.
    • Method Detail

      • newResourceAsync

        java.util.concurrent.CompletableFuture<Mocks.ResourceResult> newResourceAsync​(Mocks.ResourceArgs args)
        Invoked when a new resource is created by the program.

        Parameters:
        args - arguments containing resource information
        Returns:
        A resource identifier and resource state. State can be either a POJO or a dictionary bag. The returned ID may be null for component resources.
      • callAsync

        default java.util.concurrent.CompletableFuture<java.util.Map<java.lang.String,​java.lang.Object>> callAsync​(Mocks.CallArgs args)
        Invoked when the program needs to call a provider to load data (e.g., to retrieve an existing resource).

        Default implementation returns an empty map.

        Parameters:
        args - arguments containing call information
        Returns:
        the call invocation result, can be either a POCO or a dictionary bag.