I found a solution !!!!
For some reason, the Namespace, AppID, and AuthDomain fields of the test data warehouse must match the dev_server fields, then dev_server can see the objects inserted into the test.
You can see the values for the environment (dev_server or test code) with the following statements
System.out.println(NamespaceManager.get()); System.out.println(ApiProxy.getCurrentEnvironment().getAppId()); System.out.println(ApiProxy.getCurrentEnvironment().getAuthDomain());
In your case, LocalServiceTestHelper (ex: gaeHelper) you can set the values for the test environment
// the NamespaceManager is thread local. NamespaceManager.set(NamespaceManager.getGoogleAppsNamespace()); gaeHelper.setEnvAppId(<the name of your app in appengine-web.xml>); gaeHelper.setEnvAuthDomain("gmail.com");
Then dev_server will see your entities. However, due to synchronization problems, if the test is written to the data warehouse after running dev_server, dev_server will not see it if it cannot be forced to re-read the file (which I still do not understand). In addition, the server must be restarted.
source share