Skip to content

Commit

Permalink
[JAVA][Rest-assured] reqSpec() method has been added into api.mustach…
Browse files Browse the repository at this point in the history
…e for requests custom… (#7556)

* reqSpec() method has been added into api.mustache for requests customisation (group operations)

* add - reqSpec() has been added to samples
  • Loading branch information
viclovsky authored and wing328 committed Feb 8, 2018
1 parent ee561fc commit 62a9302
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,14 @@ public class {{classname}} {
return this;
}

/**
* Customise request specification
*/
public {{classname}} reqSpec(Consumer<RequestSpecBuilder> consumer) {
consumer.accept(reqSpec);
return this;
}

{{#operations}}
{{#operation}}
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,14 @@ public AnotherFakeApi setJSON(JSON json) {
return this;
}

/**
* Customise request specification
*/
public AnotherFakeApi reqSpec(Consumer<RequestSpecBuilder> consumer) {
consumer.accept(reqSpec);
return this;
}

/**
* To test special tags
* To test special tags
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,14 @@ public FakeApi setJSON(JSON json) {
return this;
}

/**
* Customise request specification
*/
public FakeApi reqSpec(Consumer<RequestSpecBuilder> consumer) {
consumer.accept(reqSpec);
return this;
}

/**
*
* Test serialization of outer boolean types
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,14 @@ public FakeClassnameTags123Api setJSON(JSON json) {
return this;
}

/**
* Customise request specification
*/
public FakeClassnameTags123Api reqSpec(Consumer<RequestSpecBuilder> consumer) {
consumer.accept(reqSpec);
return this;
}

/**
* To test class name in snake case
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,14 @@ public PetApi setJSON(JSON json) {
return this;
}

/**
* Customise request specification
*/
public PetApi reqSpec(Consumer<RequestSpecBuilder> consumer) {
consumer.accept(reqSpec);
return this;
}

/**
* Add a new pet to the store
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,14 @@ public StoreApi setJSON(JSON json) {
return this;
}

/**
* Customise request specification
*/
public StoreApi reqSpec(Consumer<RequestSpecBuilder> consumer) {
consumer.accept(reqSpec);
return this;
}

/**
* Delete purchase order by ID
* For valid response try integer IDs with value &lt; 1000. Anything above 1000 or nonintegers will generate API errors
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,14 @@ public UserApi setJSON(JSON json) {
return this;
}

/**
* Customise request specification
*/
public UserApi reqSpec(Consumer<RequestSpecBuilder> consumer) {
consumer.accept(reqSpec);
return this;
}

/**
* Create user
* This can only be done by the logged in user.
Expand Down

0 comments on commit 62a9302

Please sign in to comment.