Objectify error “You cannot create a Key for an object with a null @Id” in JUnit
问题 I got the following error while testing a simple piece of code in JUnit that creates a User object (an Objectify Entity) and then tries to attach it as a Parent to another Objectify Entity called DownloadTask : java.lang.IllegalArgumentException: You cannot create a Key for an object with a null @Id. Object was com.netbase.followerdownloader.model.User@57fcbecc at com.googlecode.objectify.impl.KeyMetadata.getRawKey(KeyMetadata.java:185) at com.googlecode.objectify.impl.Keys.rawKeyOf(Keys.java