Search in sources :

Example 1 with UserConfigRepository

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

the class GymRepositoryTest method setUp.

@Before
public void setUp() throws Exception {
    UserConfigRepository userConfigRepository = mock(UserConfigRepository.class);
    when(userConfigRepository.findOne(any(String.class))).thenReturn(null);
    localeService = new LocaleService("sv", userConfigRepository);
    final Config dalarnaConfig = new Config("dalarna", "dalarna");
    when(SERVER_CONFIG_REPOSITORY.getConfigForServer("dalarna")).thenReturn(dalarnaConfig);
    final Config uppsalaConfig = new Config("uppsala", "uppsala");
    when(SERVER_CONFIG_REPOSITORY.getConfigForServer("uppsala")).thenReturn(uppsalaConfig);
    final Config angelholmConfig = new Config("ängelholm", "ängelholm");
    when(SERVER_CONFIG_REPOSITORY.getConfigForServer("ängelholm")).thenReturn(angelholmConfig);
    final Config luleConfig = new Config("luleå", "luleå");
    when(SERVER_CONFIG_REPOSITORY.getConfigForServer("luleå")).thenReturn(luleConfig);
    final Config umeConfig = new Config("umeå", "umeå");
    when(SERVER_CONFIG_REPOSITORY.getConfigForServer("umeå")).thenReturn(umeConfig);
    final Config vannasConfig = new Config("vännäs", "vännäs");
    when(SERVER_CONFIG_REPOSITORY.getConfigForServer("vännäs")).thenReturn(vannasConfig);
    final Config lyckseleConfig = new Config("lycksele", "lycksele");
    when(SERVER_CONFIG_REPOSITORY.getConfigForServer("lycksele")).thenReturn(lyckseleConfig);
    final Config norrkopingConfig = new Config("norrköping", "norrköping");
    when(SERVER_CONFIG_REPOSITORY.getConfigForServer("norrköping")).thenReturn(norrkopingConfig);
    final Config trollhattanConfig = new Config("trollhättan", "trollhättan");
    when(SERVER_CONFIG_REPOSITORY.getConfigForServer("trollhättan")).thenReturn(trollhattanConfig);
    final Config helsingborgConfig = new Config("helsingborg", "helsingborg");
    when(SERVER_CONFIG_REPOSITORY.getConfigForServer("helsingborg")).thenReturn(helsingborgConfig);
    configMap = new HashMap<>();
    configMap.put("dalarna", dalarnaConfig);
    configMap.put("uppsala", uppsalaConfig);
    configMap.put("ängelholm", angelholmConfig);
    configMap.put("luleå", luleConfig);
    configMap.put("umeå", umeConfig);
    configMap.put("vännäs", vannasConfig);
    configMap.put("norrköping", norrkopingConfig);
    configMap.put("trollhättan", trollhattanConfig);
    configMap.put("helsingborg", helsingborgConfig);
    configMap.put("lycksele", lyckseleConfig);
    when(SERVER_CONFIG_REPOSITORY.getAllConfig()).thenReturn(configMap);
    repo = TestServerMain.getGymRepositoryForConfig(localeService, SERVER_CONFIG_REPOSITORY);
}
Also used : UserConfigRepository(pokeraidbot.infrastructure.jpa.config.UserConfigRepository) Config(pokeraidbot.infrastructure.jpa.config.Config) LocaleService(pokeraidbot.domain.config.LocaleService) Before(org.junit.Before)

Example 2 with UserConfigRepository

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

the class CounterTextFileParserText 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 3 with UserConfigRepository

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

the class UtilsTest method before.

@BeforeClass
public static void before() {
    userConfigRepository = 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) BeforeClass(org.junit.BeforeClass)

Example 4 with UserConfigRepository

use of pokeraidbot.infrastructure.jpa.config.UserConfigRepository 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 5 with UserConfigRepository

use of pokeraidbot.infrastructure.jpa.config.UserConfigRepository 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)

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