我正在使用 GraphQLTestTemplate 来模拟查询的响应。
@RunWith(SpringRunner.class)
@GraphQLTest
public class UnitTest {
@Autowired
private GraphQLTestTemplate graphQlTestTemplate ;
}
当我运行单元测试时,它给了我错误:org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.graphql.spring.boot.test.GraphQLTestTemplate' available: expected at least 1 bean which qualifies as autowire candidate.
pom.xml:
<graphql-spring-boot-starter-test.version>5.0.2</graphql-spring-boot-starter-test.version>
<graphql-java-tools.version>5.2.4</graphql-java-tools.version>