File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed
main/java/com/amplifyframework/datastore
test/java/com/amplifyframework/datastore Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -491,6 +491,7 @@ private void beforeOperation(@NonNull final Runnable runnable) {
491491
492492 private Completable initializeOrchestrator () {
493493 if (api .getPlugins ().isEmpty ()) {
494+ isOrchestratorReady .set (true );
494495 return Completable .complete ();
495496 } else {
496497 // Let's prevent the orchestrator startup from possibly running in main.
Original file line number Diff line number Diff line change @@ -102,9 +102,20 @@ public void configureAndInitializeInLocalMode() throws AmplifyException {
102102 //Configure DataStore with an empty config (All defaults)
103103 ApiCategory emptyApiCategory = spy (ApiCategory .class );
104104 AWSDataStorePlugin standAloneDataStorePlugin = new AWSDataStorePlugin (modelProvider , emptyApiCategory );
105+ SynchronousDataStore synchronousDataStore = SynchronousDataStore .delegatingTo (standAloneDataStorePlugin );
105106 standAloneDataStorePlugin .configure (new JSONObject (), context );
106107 standAloneDataStorePlugin .initialize (context );
108+
109+ // Trick the DataStore since it's not getting initialized as part of the Amplify.initialize call chain
110+ Amplify .Hub .publish (HubChannel .DATASTORE , HubEvent .create (InitializationStatus .SUCCEEDED ));
111+
107112 assertSyncProcessorNotStarted ();
113+
114+ Person person1 = createPerson ("Test" , "Dummy I" );
115+ synchronousDataStore .save (person1 );
116+ assertNotNull (person1 .getId ());
117+ Person person1FromDb = synchronousDataStore .get (Person .class , person1 .getId ());
118+ assertEquals (person1 , person1FromDb );
108119 }
109120
110121 /**
You can’t perform that action at this time.
0 commit comments