Class MapsArgument<In,​DelegateIn,​Out>

  • All Implemented Interfaces:
    Quality<java.util.function.Function<java.util.function.Function<DelegateIn,​Out>,​java.util.function.Function<In,​Out>>>

    public final class MapsArgument<In,​DelegateIn,​Out>
    extends java.lang.Object
    implements Quality<java.util.function.Function<java.util.function.Function<DelegateIn,​Out>,​java.util.function.Function<In,​Out>>>
    This quality can be used to isolate the logic of the outer function in a delegating function, which enables testing only the actual functions logic, not the logic of the delegate function.
     OuterFunction
     +-----------------------------------------------------------------------------------+
     |                      DelegateFunction                                             |
     |                     +------------------------------------------+                  |
     | OuterArgument ----> |  DelegateArgument -----> DelegateResult  | ---> OuterResult |
     |                     +------------------------------------------+                  |
     +-----------------------------------------------------------------------------------+
     
    Example:
     assertThat(delegate -> x -> delegate.apply(x + 2),
         new MapsArgument<Integer, Integer, Integer>(1, equalTo(3))
     );
     
    • Constructor Summary

      Constructors 
      Constructor Description
      MapsArgument​(In outerArgument, Quality<? super DelegateIn> delegateArgumentQuality)
      Creates a new instance with outerArgument as the input to the outer function and the delegateArgumentQuality as quality matching the delegate argument.
    • Constructor Detail

      • MapsArgument

        public MapsArgument​(In outerArgument,
                            Quality<? super DelegateIn> delegateArgumentQuality)
        Creates a new instance with outerArgument as the input to the outer function and the delegateArgumentQuality as quality matching the delegate argument.