我有一个spring-boot应用程序(1.4RC1,我知道它是RC,但Spring Data Redis 1.7.2不是),其中我使用spring-boot-starter-redis。当我保存一个对象(通过存储库)时,一切都很顺利,并且我可以像我所期望的那样看到数据库中的所有属性。当我想要从数据库中读取数据时(通过存储库),我只从父对象中获取属性。自定义类属性为空。正如文档所述,您可以编写,但由于我不需要这样做,
我读到,当使用@Mock时,它应该与@RunWith(MockitoJUnitRunner.class)一起使用,而对于@MockBean,它应该与@RunWith(SpringRunner.class)一起使用。@RunWith(MockitoJUnitRunner.class) // also work when @RunWith(SpringRunner.class) is used
public class testS