Created
July 17, 2014 04:08
-
-
Save hisamekms/466494965417eb086ea7 to your computer and use it in GitHub Desktop.
Jersey Test FrameworkとGuiceを一緒に使う ref: http://qiita.com/hisamekms/items/85de686f32d3a5d6fd4f
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
package web.resources; | |
import web.MyApplication; | |
import org.glassfish.jersey.test.DeploymentContext; | |
import org.glassfish.jersey.test.JerseyTest; | |
import org.junit.Test; | |
import static org.hamcrest.CoreMatchers.is; | |
import static org.junit.Assert.assertThat; | |
public class HelloResourceTest extends JerseyTest { | |
@Test | |
public void testHello() throws Exception { | |
String response = target("hello").request().get(String.class); | |
assertThat(response, is("Hello!")); | |
} | |
@Override | |
protected DeploymentContext configureDeployment() { | |
return DeploymentContext.newInstance(MyApplication.class); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment