Search in sources :

Example 6 with LocaleService

use of pokeraidbot.domain.config.LocaleService in project pokeraidbot by magnusmickelsson.

the class LocaleServiceTest 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);
}
Also used : UserConfigRepository(pokeraidbot.infrastructure.jpa.config.UserConfigRepository) LocaleService(pokeraidbot.domain.config.LocaleService) Before(org.junit.Before)

Example 7 with LocaleService

use of pokeraidbot.domain.config.LocaleService in project pokeraidbot by magnusmickelsson.

the class RaidPokemonsTest 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);
    strategyService = new PokemonRaidStrategyService(pokemonRepository);
}
Also used : UserConfigRepository(pokeraidbot.infrastructure.jpa.config.UserConfigRepository) PokemonRepository(pokeraidbot.domain.pokemon.PokemonRepository) LocaleService(pokeraidbot.domain.config.LocaleService) Before(org.junit.Before)

Example 8 with LocaleService

use of pokeraidbot.domain.config.LocaleService 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 9 with LocaleService

use of pokeraidbot.domain.config.LocaleService 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)9 UserConfigRepository (pokeraidbot.infrastructure.jpa.config.UserConfigRepository)7 Before (org.junit.Before)5 PokemonRepository (pokeraidbot.domain.pokemon.PokemonRepository)3 Test (org.junit.Test)2 LocalDateTime (java.time.LocalDateTime)1 User (net.dv8tion.jda.core.entities.User)1 BeforeClass (org.junit.BeforeClass)1 Bean (org.springframework.context.annotation.Bean)1 Gym (pokeraidbot.domain.gym.Gym)1 Pokemon (pokeraidbot.domain.pokemon.Pokemon)1 Raid (pokeraidbot.domain.raid.Raid)1 Config (pokeraidbot.infrastructure.jpa.config.Config)1