package stroom.docstore.impl;

import com.google.inject.AbstractModule;
import com.google.inject.Guice;
import com.google.inject.Inject;
import com.google.inject.Injector;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.Mock;
import org.mockito.junit.jupiter.MockitoExtension;
import stroom.docstore.DocumentSerialiser2;
import stroom.docstore.Persistence;
import stroom.docstore.Serialiser2Factory;
import stroom.docstore.Store;
import stroom.docstore.StoreFactory;
import stroom.docstore.shared.Doc;
import stroom.security.SecurityContext;

@ExtendWith(MockitoExtension.class)
class TestDocStoreModule {

    @Mock
    private Persistence persistenceMock;
    @Mock
    private SecurityContext securityContextMock;
    @Mock
    private Doc docMock;

//    @Inject
//    Store store;

    @Inject
    StoreFactory storeFactory;

    @Test
    void testInjection() {

        final Injector injector = Guice.createInjector(new AbstractModule() {
            @Override
            protected void configure() {

                bind(Persistence.class).toInstance(persistenceMock);
                bind(SecurityContext.class).toInstance(securityContextMock);
                install(new DocStoreModule());
            }
        });

        final Serialiser2Factory serialiser2Factory = injector.getInstance(Serialiser2Factory.class);
        injector.injectMembers(this);
//        final Store<MyDoc> store = injector.getInstance(Store<MyDoc>.class);
        final DocumentSerialiser2<MyDoc> serialiser = serialiser2Factory.createSerialiser(MyDoc.class);


//        store.setSerialiser(serialiser);

        Store<MyDoc> store2 = storeFactory.createStore(serialiser, "MyDocType", MyDoc.class);
    }

    private static class MyDoc extends Doc {
    }

}
@@ -807,42 +807,8 @@
 k;%0A%0A
-//    @Inject%0A//    Store store;%0A%0A
     
@@ -1391,87 +1391,8 @@
 s);%0A
-//        final Store%3CMyDoc%3E store = injector.getInstance(Store%3CMyDoc%3E.class);%0A
     
@@ -1496,53 +1496,8 @@
 );%0A%0A
-%0A//        store.setSerialiser(serialiser);%0A%0A
     
@@ -1638,16 +1638,15 @@
 s Doc %7B%0A
+
     %7D%0A
-%0A
 %7D

Tidy up TestDocStoreModule