rest-assured/src/main/java/io/restassured/RestAssured.java
public static List<Argument> withArgs(Object firstArgument, Object... additionalArguments) {
        Validate.notNull(firstArgument, "You need to supply at least one argument");
        final List<Argument> arguments = new LinkedList<Argument>();
        arguments.add(Argument.arg(firstArgument));
        if (additionalArguments != null && additionalArguments.length > 0) {
            for (Object additionalArgument : additionalArguments) {
                arguments.add(Argument.arg(additionalArgument));
            }
        }
        return Collections.unmodifiableList(arguments);
    }
public static List<Argument> withArgs(Object firstArgument, Object... additionalArguments) {
        Validate.notNull(firstArgument, "You need to supply at least one argument");
        final List<Argument> arguments = new LinkedList<Argument>();
        arguments.add(Argument.arg(firstArgument));
        if (additionalArguments != null && additionalArguments.length > 0) {
            for (Object additionalArgument : additionalArguments) {
                arguments.add(Argument.arg(additionalArgument));
            }
        }
        return Collections.unmodifiableList(arguments);
    }
public static List < Argument > withArgs ( Object firstArgument , Object ... additionalArguments ) { Validate . notNull ( firstArgument , "You need to supply at least one argument" ) ; final List < Argument > arguments = new LinkedList < Argument > ( ) ; arguments . add ( Argument . arg ( firstArgument ) ) ; if ( additionalArguments != null && additionalArguments . length > 0 ) { for ( Object additionalArgument : additionalArguments ) { arguments . add ( Argument . arg ( additionalArgument ) ) ; } } return Collections . unmodifiableList ( arguments ) ; }
Create a list of arguments that can be used to create parts of the path in a body/content expression.
This is useful in situations where you have e.g. pre-defined variables that constitutes the key. For example:
<pre>
String someSubPath = "else";
int index = 1;
when().get().then().body("something.%s[%d]", withArgs(someSubPath, index), equalTo("some value")). ..
</pre>
<p/>
or if you have complex root paths and don't wish to duplicate the path for small variations:
<pre>
get("/x").then().assertThat().
root("filters.filterConfig[%d].filterConfigGroups.find { it.name == 'Gold' }.includes").
body(withArgs(0), hasItem("first")).
body(withArgs(1), hasItem("second")).
..
</pre>
<p/>
The key and arguments follows the standard <a href="http://download.oracle.com/javase/1,5.0/docs/api/java/util/Formatter.html#syntax">formatting syntax</a> of Java.

@return A list of arguments.
Create a list of arguments that can be used to create parts of the path in a body / content expression . This is useful in situations where you have e . g . pre - defined variables that constitutes the key . For example : <pre > String someSubPath = else ; int index = 1 ; when () . get () . then () . body ( something . %s [ %d ] withArgs ( someSubPath index ) equalTo ( some value )) . .. < / pre > <p / > or if you have complex root paths and don t wish to duplicate the path for small variations : <pre > get ( / x ) . then () . assertThat () . root ( filters . filterConfig [ %d ] . filterConfigGroups . find { it . name == Gold } . includes ) . body ( withArgs ( 0 ) hasItem ( first )) . body ( withArgs ( 1 ) hasItem ( second )) . .. < / pre > <p / > The key and arguments follows the standard <a href = http : // download . oracle . com / javase / 1 5 . 0 / docs / api / java / util / Formatter . html#syntax > formatting syntax< / a > of Java .