機能テストで、fakeApplication() の実際のアドレスは?
@Test
public void findById() {
running(fakeApplication(), new Runnable() {
public void run() {
Computer macintosh = Computer.find.byId(21l);
assertThat(macintosh.name).isEqualTo("Macintosh");
assertThat(formatted(macintosh.introduced)).isEqualTo("1984-01-24");
}
});
}
編集
アンディの答えは私にとってはうまくいきます。
@Test
public void findById() {
running(testServer(3333, fakeApplication(inMemoryDatabase())), new Runnable() {
public void run() {
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost("http://localhost:3333/endpoint");
}
});
}