Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/60.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Playframework 2.0 什么是Play 2.0 FakeApplication';用户的url地址_Playframework 2.0 - Fatal编程技术网

Playframework 2.0 什么是Play 2.0 FakeApplication';用户的url地址

Playframework 2.0 什么是Play 2.0 FakeApplication';用户的url地址,playframework-2.0,Playframework 2.0,在功能测试中,fakeApplication()的实际地址是什么 编辑 安迪的答案对我很有用 @Test public void findById() { running(testServer(3333, fakeApplication(inMemoryDatabase())), new Runnable() { public void run() { HttpClient httpclient = new DefaultHttpClient(); HttpP

在功能测试中,fakeApplication()的实际地址是什么

编辑

安迪的答案对我很有用

@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");
    }
  });
}

AFAICT,如果您需要url,您应该使用FakeServer而不是FakeApplication

AFAICT,如果您需要url,您应该使用FakeServer而不是FakeApplication

@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");
    }
  });
}