Skip to content

Commit

Permalink
Add caching back
Browse files Browse the repository at this point in the history
  • Loading branch information
Pelayori committed Apr 1, 2024
1 parent ea7c03b commit ad7e4a1
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/test/java/com/uniovi/Wiq_UnitTests.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.uniovi;

import com.uniovi.dto.PlayerDto;
import com.uniovi.entities.Player;
import com.uniovi.services.PlayerService;
import org.junit.jupiter.api.*;
Expand All @@ -16,14 +17,20 @@
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
@ActiveProfiles("test")
public class Wiq_UnitTests {

@Autowired
private PlayerService playerService;

@Test
@Order(1)
public void testPlayerService() {
Optional<Player> player = playerService.getUser(1L);
Assertions.assertTrue(player.isPresent());
PlayerDto dto = new PlayerDto();
dto.setUsername("test");
dto.setPassword("test");
dto.setEmail("[email protected]");
dto.setRoles(new String[]{"ROLE_USER"});
Player player = playerService.addNewPlayer(dto);
Assertions.assertNotNull(player);
Optional<Player> playerOptional = playerService.getUser(player.getId());
Assertions.assertTrue(playerOptional.isPresent());
}

}

0 comments on commit ad7e4a1

Please sign in to comment.