Skip to content

Commit

Permalink
Add new satisfiesContract with Auth
Browse files Browse the repository at this point in the history
  • Loading branch information
jsfrench committed Feb 23, 2018
1 parent 854b123 commit b77a762
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/main/java/io/github/robwin/swagger/test/SwaggerAssert.java
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,13 @@ public SwaggerAssert isEqualTo(String expectedLocation) {

/**
* Verifies that the actual value is equal to the given one.
*
* @param expectedLocation the location of the given value to compare the actual value to.
* @param auths List of io.swagger.models.auth.AuthorizationValue for access to the expectedLocation
* @param auths List of io.swagger.models.auth.AuthorizationValue for access to protected locations.
* @return {@code this} assertion object.
* @throws AssertionError if the actual value is not equal to the given one or if the actual value is {@code null}..
*/
public SwaggerAssert isEqualTo(String expectedLocation, List<AuthorizationValue> auths) {

return isEqualTo(new SwaggerParser().read(expectedLocation, auths, true));
}

Expand Down Expand Up @@ -123,6 +123,18 @@ public SwaggerAssert satisfiesContract(String expectedLocation) {
return satisfiesContract(new SwaggerParser().read(expectedLocation));
}

/**
* Verifies that the actual value is equal to the given one.
*
* @param expectedLocation the location of the given value to compare the actual value to.
* @param auths List of io.swagger.models.auth.AuthorizationValue for access to protected locations.
* @return {@code this} assertion object.
* @throws AssertionError if the actual value is not equal to the given one or if the actual value is {@code null}..
*/
public SwaggerAssert satisfiesContract(String expectedLocation, List<AuthorizationValue> auths) {
return satisfiesContract(new SwaggerParser().read(expectedLocation, auths, true));
}

private SwaggerAssertionConfig loadSwaggerAssertionFlagsConfiguration(String configurationResourceLocation) {
final Properties props = new Properties();
try (final InputStream is = this.getClass().getResourceAsStream(configurationResourceLocation)) {
Expand Down

0 comments on commit b77a762

Please sign in to comment.