首页 > 解决方案 > Guice AbstractModule 的 configure() 方法的 Junit 测试实现

问题描述

我有一个实现configure()GuiceAbstractModule类方法的模块。我bind()在这个方法中的对象实例简单如下:

bind(Command.class)
.annotatedWith(Names.named("commandSpringBean"))
.toProvider(
    SpringIntegration.fromSpring(Command.class, "commandSpringBean"));

如何编写 JUnit 来测试此方法?

标签: junitguice

解决方案


推荐阅读