我正在使用springdata(springboot)和mongodb。我有这两个实体@Document(collection="users")publicclassUserEntity{privateStringemail;@DBRefprivateDeviceEntitydevice;}@Document(collection="device")publicclassDeviceEntity{privateStringname;}andIamcreatingthefirstobjectofdevicethensettingittouserentity.Nowiwillsaveuse
我是Mockito库的新手,但被困在某个地方。问题是当我模拟SpringjpaRepository的保存方法时,我总是得到null。我在我的项目中使用这样的代码,但为了测试,我制作了一个用于测试的虚拟代码。这些是我的代码://ThisistheclassforwhichIammakingtestcase@Service("deviceManagementService")@Scope(BRASSConstants.SCOPE_SESSION)@TransactionalpublicclassDeviceManagementServiceImplimplementsDeviceManag
我是Mockito库的新手,但被困在某个地方。问题是当我模拟SpringjpaRepository的保存方法时,我总是得到null。我在我的项目中使用这样的代码,但为了测试,我制作了一个用于测试的虚拟代码。这些是我的代码://ThisistheclassforwhichIammakingtestcase@Service("deviceManagementService")@Scope(BRASSConstants.SCOPE_SESSION)@TransactionalpublicclassDeviceManagementServiceImplimplementsDeviceManag