generated from Arquisoft/wiq_0
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Test coverage fix * Test coverage fix * Test coverage fix * Test coverage fix * Test coverage fix * Test coverage fix * Test coverage fix * Test coverage fix * Test coverage fix * Fix multiple cucumber scenarios. Persistent webdriver session * Test run integration tests * Test run integration tests * Test run integration tests * Test run integration tests * Test run integration tests * Test run integration tests * Test run integration tests * Test run integration tests * Test run integration tests * Test run integration tests * Test run integration tests * Test run integration tests * Test run integration tests * Test run integration tests * Test run integration tests * Test run integration tests * Test run integration tests * Test run integration tests * Test run integration tests * Test run integration tests * Test run integration tests * Test run integration tests * Add caching back * Add caching back * Add caching back * Add caching back * Add caching back * Add caching back * Add caching back * Add caching back * Add caching back * Add caching back * Add caching back * Fix some tests * Fix some tests * Fix some tests
- Loading branch information
Showing
5 changed files
with
55 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,6 +50,15 @@ public InsertSampleDataService(PlayerService playerService, QuestionService ques | |
@Transactional | ||
@EventListener(ApplicationReadyEvent.class) // Uncomment this line to insert sample data on startup | ||
public void insertSampleQuestions() { | ||
if (!playerService.getUserByEmail("[email protected]").isPresent()) { | ||
PlayerDto player = new PlayerDto(); | ||
player.setEmail("[email protected]"); | ||
player.setUsername("test"); | ||
player.setPassword("test"); | ||
player.setRoles(new String[]{"ROLE_USER"}); | ||
playerService.generateApiKey(playerService.addNewPlayer(player)); | ||
} | ||
|
||
if (Arrays.stream(environment.getActiveProfiles()).anyMatch(env -> (env.equalsIgnoreCase("test")))) { | ||
log.info("Test profile active, skipping sample data insertion"); | ||
return; | ||
|
@@ -60,14 +69,6 @@ public void insertSampleQuestions() { | |
|
||
@Transactional | ||
public void generateSampleData() { | ||
if (!playerService.getUserByEmail("[email protected]").isPresent()) { | ||
PlayerDto player = new PlayerDto(); | ||
player.setEmail("[email protected]"); | ||
player.setUsername("test"); | ||
player.setPassword("test"); | ||
player.setRoles(new String[]{"ROLE_USER"}); | ||
playerService.generateApiKey(playerService.addNewPlayer(player)); | ||
} | ||
|
||
questionRepository.deleteAll(); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters