Annotation Type JPostmanRunner


  • @Target(METHOD)
    @Retention(RUNTIME)
    public @interface JPostmanRunner
    Executes multiple Postman requests from a collection folder before a test method runs.

    This annotation behaves like JPostmanResponse, but the request names are discovered from the selected Postman folder instead of being declared one by one. Explicit JPostmanResponse framework tests for the same namespace, folder, and request name remain separate tests and are skipped by the folder loop. An explicit Response that is not a framework test and defines a concrete verify value is executed by the runner first, including its dependencies and cache body, then filtered from the normal folder loop.

    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      String[] asserts
      Optional assertion rule sections to apply after response execution.
      String data
      Optional data group or data section to apply before request execution.
      String debug
      Local JPostman debug override.
      String[] dependsOn
      Dependency method names to run before this runner.
      boolean enabled
      Runs this runner even when JPostmanContext.skipAll() is enabled.
      String[] exclude
      Request names to exclude from this runner.
      String executor
      Selects a named JPostmanExecutor by method name or "#id".
      String[] filter
      Optional response fields to keep before printing or verifying.
      String[] folder
      Collection folder path from the collection root to the target folder.
      String id
      Optional annotation id used by dependsOn = "#id".
      String[] include
      Request names to include.
      boolean lifecycle
      Enables the new request/response runner lifecycle callback mode.
      String namespace
      Context namespace to use.
      String[] rules
      Optional secure rule sections for response filtering and masking.
      boolean skip
      Skips this runner/test execution before dependencies or request execution run.
      String[] tags
      Logical tags for this runner execution.
      int verify
      Expected HTTP status code for each executed request.
    • Element Detail

      • id

        String id
        Optional annotation id used by dependsOn = "#id".
        Returns:
        annotation id
        Default:
        ""
      • tags

        String[] tags
        Logical tags for this runner execution.
        Returns:
        runner tags, or empty array when not defined
        Default:
        {}
      • namespace

        String namespace
        Context namespace to use. Empty means the default context.
        Returns:
        context namespace
        Default:
        ""
      • folder

        String[] folder
        Collection folder path from the collection root to the target folder.

        Each value represents one folder level. An empty value selects requests from the collection root.

         folder = "Products"
         folder = { "level1", "level2", "level3" }
         
        Returns:
        folder path levels from parent to child
        Default:
        {""}
      • rules

        String[] rules
        Optional secure rule sections for response filtering and masking.
        Returns:
        secure rule sections
        Default:
        {}
      • filter

        String[] filter
        Optional response fields to keep before printing or verifying.
        Returns:
        response fields to keep
        Default:
        {}
      • dependsOn

        String[] dependsOn
        Dependency method names to run before this runner.

        For runner launcher methods, a single runner dependency such as dependsOn = "#testRunner" can reuse the referenced runner body with this annotation's tags when this runner does not define its own folder, include/exclude, executor, rules, filter, data, asserts, verify, or lifecycle settings.

        Returns:
        dependency method names
        Default:
        {}
      • include

        String[] include
        Request names to include. Empty means include all discovered requests.
        Returns:
        request names to include
        Default:
        {}
      • exclude

        String[] exclude
        Request names to exclude from this runner.
        Returns:
        request names to exclude
        Default:
        {}
      • verify

        int verify
        Expected HTTP status code for each executed request.

        The default value -1 uses JPostmanContext.verifyStatusCode(). Use 0 to explicitly skip status-code verification for this runner and keep a successful result. Use 1 to perform the same runner execution but mark the otherwise successful completed test as skipped. Set a concrete value when each runner request should be verified by the annotation runtime. Response and call dependencies executed while this runner is active inherit this value when they keep verify = -1. Standalone response and call test methods remain separate executions and use their own verification value.

        Returns:
        expected HTTP status code, -1 to use the context default, 0 to pass without status verification, or 1 to mark the completed test skipped
        Default:
        -1
      • executor

        String executor
        Selects a named JPostmanExecutor by method name or "#id". Leave empty to use the single executor or the executor without an id.
        Returns:
        executor selector, or empty string for automatic/default selection
        Default:
        ""
      • debug

        String debug
        Local JPostman debug override.

        Use debug to inherit JPostmanContext.debug(). Use none to suppress output, error for the full failure trace, request for prepared-request diagnostics, response for received-response diagnostics, info for runtime annotation information, or all for all local diagnostics. Request, response, info, and all are printed after annotation execution for both passing and failing executions. The local error mode is different: it is printed only for failures and is deferred until after the JPostman report execution details.

        Returns:
        local debug setting
        Default:
        "debug"
      • lifecycle

        boolean lifecycle
        Enables the new request/response runner lifecycle callback mode.

        The default false invokes the runner method body once after all selected collection requests reach runner completion, including aggregate HTTP/verification failures. Blank-request @JPostmanRequest dependencies still apply per selected request. Set this to true to keep dependencies as one-time runner setup and invoke the runner body after each attempted HTTP request (including completed failed responses), with the before-request phase additionally enabled for fluent runner rules used by jpostman.runner().start(...), jpostman.runner().request(...), or jpostman.runner().response(...) and when the fluent runner chain should control the method body for the before/after phases.

        Returns:
        true to enable before-request and response lifecycle callbacks
        Default:
        false
      • data

        String data
        Optional data group or data section to apply before request execution.

        Use this for request data loaded by JPostmanContext.dataload(). For example, data = "product" applies the product data group, while data = "product.mouse" applies an exact data section.

        Returns:
        data group or section name, or empty string when no data should be applied
        Default:
        ""
      • asserts

        String[] asserts
        Optional assertion rule sections to apply after response execution.

        Assertion files are loaded by JPostmanContext.assertions() or the assertions config property. This selector only chooses sections from those already-loaded files. Java reserves the word assert, so the annotation member is named asserts.

        Returns:
        assertion rule sections, or empty array to use request-name/default resolution
        Default:
        {}
      • enabled

        boolean enabled
        Runs this runner even when JPostmanContext.skipAll() is enabled.
        Returns:
        true to opt in while skipAll is active
        Default:
        false
      • skip

        boolean skip
        Skips this runner/test execution before dependencies or request execution run.
        Returns:
        true to skip this runner/test execution
        Default:
        false