diff --git a/car/src/test/java/cz/muni/pa165/car/rest/unit/CarComponentPairControllerUnitTest.java b/car/src/test/java/cz/muni/pa165/car/rest/CarComponentPairControllerUnitTest.java similarity index 99% rename from car/src/test/java/cz/muni/pa165/car/rest/unit/CarComponentPairControllerUnitTest.java rename to car/src/test/java/cz/muni/pa165/car/rest/CarComponentPairControllerUnitTest.java index 54b7c2c096a9a49762d232268b4e26d7933b6584..0bd0bf413b6af33ef766cdf7a899b5624f6b2741 100644 --- a/car/src/test/java/cz/muni/pa165/car/rest/unit/CarComponentPairControllerUnitTest.java +++ b/car/src/test/java/cz/muni/pa165/car/rest/CarComponentPairControllerUnitTest.java @@ -1,4 +1,4 @@ -package cz.muni.pa165.car.rest.unit; +package cz.muni.pa165.car.rest; import com.fasterxml.jackson.databind.ObjectMapper; import cz.muni.pa165.car.rest.CarComponentPairController; diff --git a/car/src/test/java/cz/muni/pa165/car/rest/unit/CarControllerUnitTest.java b/car/src/test/java/cz/muni/pa165/car/rest/CarControllerUnitTest.java similarity index 99% rename from car/src/test/java/cz/muni/pa165/car/rest/unit/CarControllerUnitTest.java rename to car/src/test/java/cz/muni/pa165/car/rest/CarControllerUnitTest.java index 977915a6b4c7b7aa9e8c8838dc8d5d3d67d7d5e8..fbe3965312001ee5d1ab3487d4130decc518f23c 100644 --- a/car/src/test/java/cz/muni/pa165/car/rest/unit/CarControllerUnitTest.java +++ b/car/src/test/java/cz/muni/pa165/car/rest/CarControllerUnitTest.java @@ -1,4 +1,4 @@ -package cz.muni.pa165.car.rest.unit; +package cz.muni.pa165.car.rest; import com.fasterxml.jackson.databind.ObjectMapper; import cz.muni.pa165.car.rest.CarController; diff --git a/car/src/test/java/cz/muni/pa165/car/rest/unit/CarDriverPairControllerUnitTest.java b/car/src/test/java/cz/muni/pa165/car/rest/CarDriverPairControllerUnitTest.java similarity index 99% rename from car/src/test/java/cz/muni/pa165/car/rest/unit/CarDriverPairControllerUnitTest.java rename to car/src/test/java/cz/muni/pa165/car/rest/CarDriverPairControllerUnitTest.java index 55846cd1f0831ac6e6422c25f294f98ed69b88ba..56537924762f3a855fa504f746af384726e65eb6 100644 --- a/car/src/test/java/cz/muni/pa165/car/rest/unit/CarDriverPairControllerUnitTest.java +++ b/car/src/test/java/cz/muni/pa165/car/rest/CarDriverPairControllerUnitTest.java @@ -1,4 +1,4 @@ -package cz.muni.pa165.car.rest.unit; +package cz.muni.pa165.car.rest; import com.fasterxml.jackson.databind.ObjectMapper; import cz.muni.pa165.car.rest.CarDriverPairController; diff --git a/car/src/test/java/cz/muni/pa165/car/rest/integration/CarComponentPairControllerIntegrationTest.java b/car/src/test/java/cz/muni/pa165/car/rest/integration/CarComponentPairControllerIntegrationTest.java deleted file mode 100644 index d96f132e8dd7b2fbcf7e69d9cd43c7719dc92296..0000000000000000000000000000000000000000 --- a/car/src/test/java/cz/muni/pa165/car/rest/integration/CarComponentPairControllerIntegrationTest.java +++ /dev/null @@ -1,28 +0,0 @@ -package cz.muni.pa165.car.rest.integration; - -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; -import org.springframework.test.context.junit4.SpringRunner; - -@RunWith(SpringRunner.class) -@DataJpaTest -class CarComponentPairControllerIntegrationTest { - - @BeforeEach - void setUp() { - } - - @Test - void addComponent() { - } - - @Test - void removeComponent() { - } - - @Test - void getAllComponentsOfCar() { - } -} \ No newline at end of file diff --git a/car/src/test/java/cz/muni/pa165/car/rest/integration/CarDriverPairControllerIntegrationTest.java b/car/src/test/java/cz/muni/pa165/car/rest/integration/CarDriverPairControllerIntegrationTest.java deleted file mode 100644 index e69b0e82b333d3ccd144463391df8def8260dcfb..0000000000000000000000000000000000000000 --- a/car/src/test/java/cz/muni/pa165/car/rest/integration/CarDriverPairControllerIntegrationTest.java +++ /dev/null @@ -1,36 +0,0 @@ -package cz.muni.pa165.car.rest.integration; - -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; -import org.springframework.test.context.junit4.SpringRunner; - -@RunWith(SpringRunner.class) -@DataJpaTest -class CarDriverPairControllerIntegrationTest { - - @BeforeEach - void setUp() { - } - - @Test - void assignDriverToCar() { - } - - @Test - void unassignDriverFromCar() { - } - - @Test - void getAllDriversOfCar() { - } - - @Test - void setMainDriver() { - } - - @Test - void removeMainDriver() { - } -} \ No newline at end of file diff --git a/car/src/test/java/cz/muni/pa165/car/service/CarComponentPairServiceIntegrationTests.java b/car/src/test/java/cz/muni/pa165/car/service/CarComponentPairServiceIntegrationTests.java new file mode 100644 index 0000000000000000000000000000000000000000..43880e5149597f7a8d93b1aa87a4e63995723a8c --- /dev/null +++ b/car/src/test/java/cz/muni/pa165/car/service/CarComponentPairServiceIntegrationTests.java @@ -0,0 +1,41 @@ +package cz.muni.pa165.car.service; + +import com.fasterxml.jackson.databind.ObjectMapper; +import cz.muni.pa165.car.data.repository.CarRepository; +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.test.web.servlet.MockMvc; + +@SpringBootTest +@AutoConfigureMockMvc +public class CarComponentPairServiceIntegrationTests { + @Autowired + private MockMvc mockMvc; + + @Autowired + private ObjectMapper objectMapper; + + @MockBean + private CarRepository carRepository; + + @BeforeEach + void setUp() { + } + + @Test + void addComponent() { + } + + @Test + void removeComponent() { + } + + @Test + void getAllComponentsOfCar() { + } + +} diff --git a/car/src/test/java/cz/muni/pa165/car/service/CarDriverPairServiceIntegrationTests.java b/car/src/test/java/cz/muni/pa165/car/service/CarDriverPairServiceIntegrationTests.java new file mode 100644 index 0000000000000000000000000000000000000000..e5480adbf93cd490efa6e9642d2e934b28efeb95 --- /dev/null +++ b/car/src/test/java/cz/muni/pa165/car/service/CarDriverPairServiceIntegrationTests.java @@ -0,0 +1,49 @@ +package cz.muni.pa165.car.service; + +import com.fasterxml.jackson.databind.ObjectMapper; +import cz.muni.pa165.car.data.repository.CarRepository; +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.test.web.servlet.MockMvc; + +@SpringBootTest +@AutoConfigureMockMvc +public class CarDriverPairServiceIntegrationTests { + + @Autowired + private MockMvc mockMvc; + + @Autowired + private ObjectMapper objectMapper; + + @MockBean + private CarRepository carRepository; + + @BeforeEach + void setUp() { + } + + @Test + void assignDriverToCar() { + } + + @Test + void unassignDriverFromCar() { + } + + @Test + void getAllDriversOfCar() { + } + + @Test + void setMainDriver() { + } + + @Test + void removeMainDriver() { + } +} diff --git a/car/src/test/java/cz/muni/pa165/car/service/CarServiceIntegrationTests.java b/car/src/test/java/cz/muni/pa165/car/service/CarServiceIntegrationTests.java new file mode 100644 index 0000000000000000000000000000000000000000..46545a1b11caca49135ababa6a565ac676e18dd2 --- /dev/null +++ b/car/src/test/java/cz/muni/pa165/car/service/CarServiceIntegrationTests.java @@ -0,0 +1,45 @@ +package cz.muni.pa165.car.service; + +import com.fasterxml.jackson.databind.ObjectMapper; +import cz.muni.pa165.car.data.repository.CarRepository; +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.test.web.servlet.MockMvc; + +@SpringBootTest +@AutoConfigureMockMvc +public class CarServiceIntegrationTests { + + @Autowired + private MockMvc mockMvc; + + @Autowired + private ObjectMapper objectMapper; + + @MockBean + private CarRepository carRepository; + + @BeforeEach + void setUp() { + } + + @Test + void postCar() { + } + + @Test + void getCarById() { + } + + @Test + void getAllCars() { + } + + @Test + void deleteById() { + } +} diff --git a/car/src/test/java/cz/muni/pa165/car/service/unit/CarComponentPairServiceTest.java b/car/src/test/java/cz/muni/pa165/car/service/unit/CarComponentPairServiceTest.java deleted file mode 100644 index f1b6b2ebdd5054c8c670f9cbda931c150ef063b3..0000000000000000000000000000000000000000 --- a/car/src/test/java/cz/muni/pa165/car/service/unit/CarComponentPairServiceTest.java +++ /dev/null @@ -1,23 +0,0 @@ -package cz.muni.pa165.car.service.unit; - -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; - -class CarComponentPairServiceTest { - - @BeforeEach - void setUp() { - } - - @Test - void addComponent() { - } - - @Test - void removeComponent() { - } - - @Test - void getAllComponentsOfCar() { - } -} \ No newline at end of file diff --git a/car/src/test/java/cz/muni/pa165/car/service/unit/CarDriverPairServiceTest.java b/car/src/test/java/cz/muni/pa165/car/service/unit/CarDriverPairServiceTest.java deleted file mode 100644 index 428600546689d0d4e2ea7a76192e0d82617ad62f..0000000000000000000000000000000000000000 --- a/car/src/test/java/cz/muni/pa165/car/service/unit/CarDriverPairServiceTest.java +++ /dev/null @@ -1,31 +0,0 @@ -package cz.muni.pa165.car.service.unit; - -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; - -class CarDriverPairServiceTest { - - @BeforeEach - void setUp() { - } - - @Test - void assignDriverToCar() { - } - - @Test - void unassignDriverFromCar() { - } - - @Test - void getAllDriversOfCar() { - } - - @Test - void setMainDriver() { - } - - @Test - void removeMainDriver() { - } -} \ No newline at end of file diff --git a/car/src/test/java/cz/muni/pa165/car/service/unit/CarServiceTest.java b/car/src/test/java/cz/muni/pa165/car/service/unit/CarServiceTest.java deleted file mode 100644 index 1f724e1ceb367bf984b2bfae27fb02d6a929ea1c..0000000000000000000000000000000000000000 --- a/car/src/test/java/cz/muni/pa165/car/service/unit/CarServiceTest.java +++ /dev/null @@ -1,27 +0,0 @@ -package cz.muni.pa165.car.service.unit; - -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; - -class CarServiceTest { - - @BeforeEach - void setUp() { - } - - @Test - void postCar() { - } - - @Test - void getCarById() { - } - - @Test - void getAllCars() { - } - - @Test - void deleteById() { - } -} \ No newline at end of file