Class ContractCaseCoreBehaviour.Builder

    • Constructor Detail

      • Builder

        public Builder()
    • Method Detail

      • mockType

        @Stability(Stable)
        public ContractCaseCoreBehaviour.Builder mockType​(String mockType)
        Parameters:
        mockType - The type of this mock. This parameter is required. Usually this is inverted on read vs write, for example, a written MOCK_HTTP_CLIENT might become a MOCK_HTTP_SERVER during reading.

        This will almost always be the same as the top level type for your mock during read - but if it is different, ContractCase will respect this value.

        Returns:
        this
      • stateVariables

        @Stability(Stable)
        public ContractCaseCoreBehaviour.Builder stateVariables​(String stateVariables)
        Parameters:
        stateVariables - Whether or not this mock mode will invoke state handlers. This parameter is required. If set to "default" then ContractCase will not invoke or require the state handlers and will use the default values for all state variables. If set to "state", then ContractCase will invoke the state handlers and require the expected variables to be returned.

        All other values are errors.

        Returns:
        this
      • triggers

        @Stability(Stable)
        public ContractCaseCoreBehaviour.Builder triggers​(String triggers)
        Parameters:
        triggers - Whether or not this mock mode needs to be triggered by user-provided code. This parameter is required. If "provided" then ContractCase will require the user to provide a trigger and a test function (eg, for testing an HTTP Client, code that will invoke it must be provided). If "generated", then ContractCase will not require user provided triggers as it will generate them (eg, if the system under test is an HTTP server, ContractCase will generate client calls).
        Returns:
        this