Skip to content
Snippets Groups Projects
Commit 1661c671 authored by Diana Gulčíková's avatar Diana Gulčíková
Browse files

checkstyle fix

parent f61c0e38
No related branches found
No related tags found
2 merge requests!60Docker,!5221 race jpa tests
Pipeline #
This commit is part of merge request !52. Comments created here will be created in the context of that merge request.
package cz.muni.pa165.race.rest;
import static org.junit.jupiter.api.Assertions.assertEquals;
import cz.muni.pa165.race.data.model.Race;
import cz.muni.pa165.race.data.repository.RaceRepository;
import org.junit.jupiter.api.Assertions;
import static org.junit.jupiter.api.Assertions.assertEquals;
import org.junit.jupiter.api.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
import org.springframework.boot.test.autoconfigure.orm.jpa.TestEntityManager;
import org.springframework.test.context.junit4.SpringRunner;
@DataJpaTest
public class RaceRepositoryTest {
class RaceRepositoryTest {
@Autowired
private TestEntityManager entityManager;
......@@ -40,10 +39,12 @@ public class RaceRepositoryTest {
() -> assertEquals(found.getRaceInfo().getPrizePool(), race.getRaceInfo().getPrizePool()),
() -> assertEquals(found.getDriver1().getDriverId(), race.getDriver1().getDriverId()),
() -> assertEquals(found.getDriver1().getCarId(), race.getDriver1().getCarId()),
() -> assertEquals(found.getDriver1().getFinalPosition(), race.getDriver1().getFinalPosition()),
() -> assertEquals(found.getDriver1().getFinalPosition(),
race.getDriver1().getFinalPosition()),
() -> assertEquals(found.getDriver2().getDriverId(), race.getDriver2().getDriverId()),
() -> assertEquals(found.getDriver2().getCarId(), race.getDriver2().getCarId()),
() -> assertEquals(found.getDriver2().getFinalPosition(), race.getDriver2().getFinalPosition()));
() -> assertEquals(found.getDriver2().getFinalPosition(),
race.getDriver2().getFinalPosition()));
}
}
......@@ -39,6 +39,11 @@ public class RaceTestUtil {
.build();
}
/**
* Get dao race.
*
* @return dao race.
*/
public static RaceDto getDaoRaceDto() {
return RaceDto.builder()
.id(1L)
......
......@@ -3,7 +3,6 @@ package cz.muni.pa165.race.rest;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyLong;
import static org.mockito.BDDMockito.given;
import org.springframework.boot.test.context.SpringBootTest;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.delete;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.patch;
......@@ -22,6 +21,7 @@ import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.http.MediaType;
import org.springframework.test.web.servlet.MockMvc;
......@@ -31,7 +31,7 @@ import org.springframework.test.web.servlet.MockMvc;
*/
@SpringBootTest
@AutoConfigureMockMvc
public class SeasonControllerTest {
class SeasonControllerTest {
private String bodyContent = """
{
"id": 1,
......
package cz.muni.pa165.race.rest;
import static org.junit.jupiter.api.Assertions.assertEquals;
import cz.muni.pa165.race.data.model.Season;
import cz.muni.pa165.race.data.repository.SeasonRepository;
import org.junit.jupiter.api.Assertions;
import static org.junit.jupiter.api.Assertions.assertEquals;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
import org.springframework.boot.test.autoconfigure.orm.jpa.TestEntityManager;
@DataJpaTest
public class SeasonRepositoryTest {
class SeasonRepositoryTest {
@Autowired
private TestEntityManager entityManager;
......
......@@ -21,6 +21,11 @@ public class SeasonTestUtil {
.build();
}
/**
* get dao season.
*
* @return dao season.
*/
public static SeasonDto getDaoSeasonDto() {
return SeasonDto.builder()
.id(1L)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment