我试图理解https://www.playframework.com/documentation/2.6.x/JavaCache,但看不到如何将其合并到Akka项目中。尤其是,这些示例是不完整的。例如
import play.cache.*;
import play.mvc.*;
import javax.inject.Inject;
public class Application extends Controller {
private AsyncCacheApi cache;
@Inject
public Application(AsyncCacheApi cache) {
this.cache = cache;
}
// ...
}
如何例如在单元测试用例中实例化Application?我实际上从哪里获得AsynchCacheApi实例以传递到新的Application(缓存)中?