Created
June 8, 2017 13:06
-
-
Save vyo/55fb83999b877f675234a8646c013fc5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class EchoControllerJerseyTest extends JerseyTest { | |
@Override | |
protected Application configure() { | |
return new ResourceConfig(EchoController.class); | |
} | |
@Test | |
public void echo() throws Exception { | |
String input = "input"; | |
String reverse = new StringBuilder(input).reverse().toString(); | |
Response response = target("echo") | |
.path(input) | |
.request() | |
.get(); | |
assertEquals(Status.OK.getStatusCode(), response.getStatus()); | |
assertEquals(MediaType.APPLICATION_JSON_TYPE, response.getMediaType()); | |
assertEquals(reverse, response.readEntity(Echo.class).getEcho()); } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment