Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/jpa/2.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
@SpringBootTest可以';找不到带有@Autowired的Jpa存储库_Jpa - Fatal编程技术网

@SpringBootTest可以';找不到带有@Autowired的Jpa存储库

@SpringBootTest可以';找不到带有@Autowired的Jpa存储库,jpa,Jpa,我在用@SpringBootTest测试JPapository。但不知何故,它找不到jpa存储库bean。我在SpringBoot2.2.5中使用基本的SpringBoot初始化设置。此问题是否需要额外配置 @SpringBootTest class BlockRepositoryTest { @Autowired private BlockRepository blockRepository; } public interface BlockRepository扩展了Jpa

我在用@SpringBootTest测试JPapository。但不知何故,它找不到jpa存储库bean。我在SpringBoot2.2.5中使用基本的SpringBoot初始化设置。此问题是否需要额外配置

@SpringBootTest
class BlockRepositoryTest {

    @Autowired
    private BlockRepository blockRepository;
}
public interface BlockRepository扩展了JpaRepository{
}
public interface BlockRepository extends JpaRepository<Block, Long> {
}