package com.github.openwebnet.component.module;

import com.github.openwebnet.repository.DeviceRepository;
import com.github.openwebnet.repository.EnvironmentRepository;
import com.github.openwebnet.repository.GatewayRepository;
import com.github.openwebnet.repository.LightRepository;
import com.github.openwebnet.repository.impl.DeviceRepositoryImpl;
import com.github.openwebnet.repository.impl.EnvironmentRepositoryImpl;
import com.github.openwebnet.repository.impl.GatewayRepositoryImpl;
import com.github.openwebnet.repository.impl.LightRepositoryImpl;

import javax.inject.Singleton;

import dagger.Module;
import dagger.Provides;

import static org.mockito.Mockito.mock;

@Module
public class RepositoryModuleTest {

    private boolean isMocked;

    public RepositoryModuleTest(boolean isMocked) {
        this.isMocked = isMocked;
    }

    @Provides
    @Singleton
    EnvironmentRepository provideEnvironment() {
        return isMocked ? mock(EnvironmentRepository.class) : new EnvironmentRepositoryImpl();
    }

    @Provides
    @Singleton
    GatewayRepository provideGateway() {
        return isMocked ? mock(GatewayRepository.class) : new GatewayRepositoryImpl();
    }

    @Provides
    @Singleton
    LightRepository provideLight() {
        return isMocked ? mock(LightRepository.class) : new LightRepositoryImpl();
    }

    @Provides
    @Singleton
    DeviceRepository provideDevice() {
        return isMocked ? mock(DeviceRepository.class) : new DeviceRepositoryImpl();
    }

}

@@ -42,16 +42,71 @@
 odule;%0A%0A
+import com.github.openwebnet.repository.DatabaseRealm;%0A
 import c
@@ -889,32 +889,160 @@
 sMocked;%0A    %7D%0A%0A
+    @Provides%0A    @Singleton%0A    public DatabaseRealm provideDatabaseRealm() %7B%0A        return mock(DatabaseRealm.class);%0A    %7D%0A%0A
     @Provides%0A  

fix test di