I have an unit test like this:
@Test
public void callRegisterByForm() {
// AnyContentAsJson anyContentAsJson = null;
running(fakeApplication(), new Runnable() {
@Override
public void run() {
Map<String, String> map = new HashMap<String, String>();
map.put("phoneNumber", "+5103978860");
map.put("countryCode", "us");
Result result = routeAndCall(fakeRequest("POST", "/register").withFormUrlEncodedBody(map));
assertThat(status(result)).isEqualTo(OK);
assertThat(contentType(result)).isEqualTo("application/json");
JsonNode jsonResult = Json.parse(contentAsString(result));
assertThat(jsonResult.get(Config.DEV_REG_STATUS_PARAM).asText()).isEqualTo("OK");
assertThat(jsonResult.get(Config.DEV_PHONE_NUMBER_PARAM).asText()).isEqualTo("+5103978860");
}
});
}
How do I test the server's controller? I tried to setup a remote java application and use 'play debug run' on console but still not able right click on this test case to run and have the server's controller stop at breakpoints.
This is the image when I right click a test case. It asks me to select a launcher to use.