次のようなクエリ文字列パラメーターを受け入れる Java play 2 コントローラーがあります。
コントローラ:
public static Result syncInterests(
String lastsyncdate,
String fooid) {
}
テスト:
Result result = routeAndCall(fakeRequest(GET, "/foo/sync?fooid=123"));
しかし、このエラーが発生します。どういう意味ですか?これは確かに Java アクションです。
failed: This is not a JavaAction and can't be invoked this way.
編集:
これがルートで定義する方法です。lastsyncdate はオプションです。
GET /foo/sync controllers.FooSync.syncInterests(lastsyncdate: String, fooid: String)
編集:
これを機能させることができませんでした。だから私はこの機能を使ってテストを行い、他の作業を続けます。
Result result = callAction(controllers.routes.ref.FooSync.syncInterests(time, fooId));