use of com.faforever.server.config.ServerProperties in project faf-java-server by FAForever.
the class ChatServiceTest method setUp.
@Before
public void setUp() throws Exception {
ServerProperties properties = new ServerProperties();
Chat chat = properties.getChat();
chat.setAdminChannels(Collections.singletonList("#admins"));
chat.setModeratorChannels(Collections.singletonList("#moderators"));
chat.setDefaultChannels(Arrays.asList("#foo", "#bar"));
chat.setClanChannelFormat("#clan_%s");
instance = new ChatService(nickCoreRepository, properties, clientService);
}
use of com.faforever.server.config.ServerProperties in project faf-java-server by FAForever.
the class UniqueIdServiceTest method setUp.
@Before
public void setUp() throws Exception {
player = newPlayer(51234);
properties = new ServerProperties();
properties.getUid().setEnabled(true);
properties.getUid().setPrivateKey(PRIVATE_KEY);
hardwareInformation = new HardwareInformation();
hardwareInformation.setPlayers(new HashSet<>());
when(hardwareInformationRepository.save(any(HardwareInformation.class))).thenAnswer(invocation -> invocation.getArgumentAt(0, HardwareInformation.class));
instance = new UniqueIdService(properties, new ObjectMapper(), hardwareInformationRepository);
}
use of com.faforever.server.config.ServerProperties in project faf-java-server by FAForever.
the class SchemaVersionVerifierTest method setUp.
@Before
public void setUp() throws Exception {
ServerProperties properties = new ServerProperties();
properties.getDatabase().setSchemaVersion("1337");
instance = new SchemaVersionVerifier(schemaVersionRepository, properties);
}
use of com.faforever.server.config.ServerProperties in project faf-java-server by FAForever.
the class DivisionServiceTest method setUp.
@Before
public void setUp() throws Exception {
serverProperties = new ServerProperties();
serverProperties.getLadder1v1().setSeason(1);
info1 = new PlayerDivisionInfo();
info1.setPlayer(player1);
info1.setSeason(serverProperties.getLadder1v1().getSeason());
info2 = new PlayerDivisionInfo();
info2.setPlayer(player2);
info2.setSeason(serverProperties.getLadder1v1().getSeason());
Division[] divisions = new Division[] { createDivision(1, "League 1 - Division A", 1, 10), createDivision(2, "League 1 - Division B", 1, 30), createDivision(3, "League 1 - Division C", 1, 50), createDivision(4, "League 2 - Division D", 2, 20), createDivision(5, "League 2 - Division E", 2, 60), createDivision(6, "League 2 - Division F", 2, 100), createDivision(7, "League 3 - Division G", 3, 100), createDivision(8, "League 3 - Division H", 3, 200), createDivision(9, "League 3 - Division I", 3, 9999) };
when(divisionRepository.findAllByOrderByLeagueAscThresholdAsc()).thenReturn(Arrays.asList(divisions));
instance = new DivisionService(serverProperties, divisionRepository, playerDivisionInfoRepository);
instance.init();
}
use of com.faforever.server.config.ServerProperties in project faf-java-server by FAForever.
the class MatchMakerServiceTest method setUp.
@Before
public void setUp() throws Exception {
properties = new ServerProperties();
FeaturedMod ladder1v1Mod = new FeaturedMod().setTechnicalName("faf");
when(modService.getFeaturedMod(ladder1v1Mod.getTechnicalName())).thenReturn(Optional.of(ladder1v1Mod));
when(modService.getLadder1v1()).thenReturn(Optional.of(ladder1v1Mod));
when(modService.isLadder1v1(ladder1v1Mod)).thenReturn(true);
when(mapService.getRandomLadderMap()).thenReturn(new MapVersion().setFilename("maps/SCMP_001.zip"));
when(gameService.createGame(any(), any(), any(), any(), any(), anyInt(), anyInt(), any())).thenReturn(CompletableFuture.completedFuture(new Game().setId(1)));
RatingService ratingService = new RatingService(properties);
instance = new MatchMakerService(modService, properties, ratingService, clientService, gameService, mapService, playerService);
}
Aggregations