Search in sources :

Example 6 with UserConfigRepository

use of pokeraidbot.infrastructure.jpa.config.UserConfigRepository in project pokeraidbot by magnusmickelsson.

the class TestServerMain method getLocaleService.

@Bean
public LocaleService getLocaleService() {
    // Emulate no user configuration, which means server config is always used unless explicitly specified in a test
    UserConfigRepository userConfigRepository = Mockito.mock(UserConfigRepository.class);
    when(userConfigRepository.findOne(any(String.class))).thenReturn(null);
    return new LocaleService("sv", userConfigRepository);
}
Also used : UserConfigRepository(pokeraidbot.infrastructure.jpa.config.UserConfigRepository) LocaleService(pokeraidbot.domain.config.LocaleService) Bean(org.springframework.context.annotation.Bean)

Example 7 with UserConfigRepository

use of pokeraidbot.infrastructure.jpa.config.UserConfigRepository in project pokeraidbot by magnusmickelsson.

the class PokemonRepositoryTest method setUp.

@Before
public void setUp() throws Exception {
    UserConfigRepository userConfigRepository = Mockito.mock(UserConfigRepository.class);
    when(userConfigRepository.findOne(any(String.class))).thenReturn(null);
    localeService = new LocaleService("sv", userConfigRepository);
    pokemonRepository = new PokemonRepository("/pokemons.csv", localeService);
}
Also used : UserConfigRepository(pokeraidbot.infrastructure.jpa.config.UserConfigRepository) PokemonRepository(pokeraidbot.domain.pokemon.PokemonRepository) LocaleService(pokeraidbot.domain.config.LocaleService) Before(org.junit.Before)

Aggregations

LocaleService (pokeraidbot.domain.config.LocaleService)7 UserConfigRepository (pokeraidbot.infrastructure.jpa.config.UserConfigRepository)7 Before (org.junit.Before)5 PokemonRepository (pokeraidbot.domain.pokemon.PokemonRepository)2 BeforeClass (org.junit.BeforeClass)1 Bean (org.springframework.context.annotation.Bean)1 Config (pokeraidbot.infrastructure.jpa.config.Config)1