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. ExplicitJPostmanResponseframework 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 concreteverifyvalue 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[]assertsOptional assertion rule sections to apply after response execution.StringdataOptional data group or data section to apply before request execution.StringdebugLocal JPostman debug override.String[]dependsOnDependency method names to run before this runner.booleanenabledRuns this runner even whenJPostmanContext.skipAll()is enabled.String[]excludeRequest names to exclude from this runner.StringexecutorSelects a namedJPostmanExecutorby method name or"#id".String[]filterOptional response fields to keep before printing or verifying.String[]folderCollection folder path from the collection root to the target folder.StringidOptional annotation id used by dependsOn = "#id".String[]includeRequest names to include.booleanlifecycleEnables the new request/response runner lifecycle callback mode.StringnamespaceContext namespace to use.String[]rulesOptional secure rule sections for response filtering and masking.booleanskipSkips this runner/test execution before dependencies or request execution run.String[]tagsLogical tags for this runner execution.intverifyExpected 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
-1usesJPostmanContext.verifyStatusCode(). Use0to explicitly skip status-code verification for this runner and keep a successful result. Use1to 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 keepverify = -1. Standalone response and call test methods remain separate executions and use their own verification value.- Returns:
- expected HTTP status code,
-1to use the context default,0to pass without status verification, or1to mark the completed test skipped
- Default:
- -1
-
-
-
executor
String executor
Selects a namedJPostmanExecutorby 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
debugto inheritJPostmanContext.debug(). Usenoneto suppress output,errorfor the full failure trace,requestfor prepared-request diagnostics,responsefor received-response diagnostics,infofor runtime annotation information, orallfor all local diagnostics. Request, response, info, and all are printed after annotation execution for both passing and failing executions. The localerrormode 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
falseinvokes the runner method body once after all selected collection requests reach runner completion, including aggregate HTTP/verification failures. Blank-request@JPostmanRequestdependencies still apply per selected request. Set this totrueto 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 byjpostman.runner().start(...),jpostman.runner().request(...), orjpostman.runner().response(...)and when the fluent runner chain should control the method body for the before/after phases.- Returns:
trueto 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, whiledata = "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 theassertionsconfig property. This selector only chooses sections from those already-loaded files. Java reserves the wordassert, so the annotation member is namedasserts.- Returns:
- assertion rule sections, or empty array to use request-name/default resolution
- Default:
- {}
-
-
-
enabled
boolean enabled
Runs this runner even whenJPostmanContext.skipAll()is enabled.- Returns:
trueto opt in while skipAll is active
- Default:
- false
-
-