Skip to content

Commit

Permalink
test for #128
Browse files Browse the repository at this point in the history
  • Loading branch information
fehguy committed Jul 30, 2016
1 parent 550040e commit 55eedd5
Showing 1 changed file with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,14 @@
package io.swagger.test.integration.responses;

import io.swagger.test.client.ApiClient;
import io.swagger.test.client.ApiException;

import java.util.HashMap;
import java.util.Map;

import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertTrue;
import static org.testng.Assert.fail;

public class PrimitiveResponseTestIT {
ApiClient client = new ApiClient();
Expand Down Expand Up @@ -158,4 +161,21 @@ public void verifyBaseIntegerResponse() throws Exception {
String str = client.invokeAPI("/issue-125", "GET", queryParams, null, new HashMap<String, String>(), null, "application/json", null, new String[0]);
assertEquals(str, "0");
}

/**
* test for https://github.com/swagger-api/swagger-inflector/issues/128
*/
@org.junit.Test
public void verify303Response() throws Exception {
Map<String, String> queryParams = new HashMap<String, String>();

try {
String str = client.invokeAPI("/issue-128", "GET", queryParams, null, new HashMap<String, String>(), null, "application/json", null, new String[0]);
fail("expected non-200 response");
}
catch (ApiException e) {
assertTrue(e.getCode() == 303);
assertEquals(e.getMessage(), "\"http://foo.bar/other\"");
}
}
}

0 comments on commit 55eedd5

Please sign in to comment.