Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
PA165 Formula One Team
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Diana Gulčíková
PA165 Formula One Team
Merge requests
!51
An error occurred while fetching the assigned milestone of the selected merge_request.
19 car tests
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
19 car tests
19_car_tests
into
milestone_2
Overview
0
Commits
15
Pipelines
7
Changes
3
Merged
Andrej Šimurka
requested to merge
19_car_tests
into
milestone_2
1 year ago
Overview
0
Commits
15
Pipelines
7
Changes
3
Expand
0
0
Merge request reports
Viewing commit
61ff3819
Prev
Next
Show latest version
3 files
+
22
−
26
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
3
Search (e.g. *.vue) (Ctrl+P)
61ff3819
Zelena je sexi
· 61ff3819
Andrej Šimurka
authored
1 year ago
car/src/test/java/cz/muni/pa165/car/rest/CarComponentPairControllerTest.java
+
20
−
9
Options
package
cz.muni.pa165.car.rest
;
import
static
org
.
mockito
.
BDDMockito
.
given
;
import
static
org
.
springframework
.
test
.
web
.
servlet
.
request
.
MockMvcRequestBuilders
.
get
;
import
static
org
.
springframework
.
test
.
web
.
servlet
.
request
.
MockMvcRequestBuilders
.
put
;
import
static
org
.
springframework
.
test
.
web
.
servlet
.
result
.
MockMvcResultMatchers
.
status
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
cz.muni.pa165.car.restemplate.DbGetter
;
import
cz.muni.pa165.car.service.CarComponentPairService
;
import
cz.muni.pa165.common_library.dtos.CarComponentResponseDto
;
import
cz.muni.pa165.common_library.dtos.CarResponseDto
;
import
java.math.BigDecimal
;
import
java.util.List
;
import
org.junit.jupiter.api.Assertions
;
import
org.junit.jupiter.api.BeforeEach
;
import
org.junit.jupiter.api.Test
;
import
static
org
.
mockito
.
BDDMockito
.
given
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest
;
import
org.springframework.boot.test.context.TestConfiguration
;
import
org.springframework.boot.test.mock.mockito.MockBean
;
import
org.springframework.context.annotation.
Import
;
import
org.springframework.context.annotation.
Bean
;
import
org.springframework.http.MediaType
;
import
org.springframework.test.web.servlet.MockMvc
;
import
static
org
.
springframework
.
test
.
web
.
servlet
.
request
.
MockMvcRequestBuilders
.
get
;
import
static
org
.
springframework
.
test
.
web
.
servlet
.
request
.
MockMvcRequestBuilders
.
put
;
import
static
org
.
springframework
.
test
.
web
.
servlet
.
result
.
MockMvcResultMatchers
.
status
;
import
java.math.BigDecimal
;
import
java.util.List
;
@WebMvcTest
(
CarComponentPairController
.
class
)
@Import
(
TestConfig
.
class
)
public
class
CarComponentPairControllerTest
{
private
static
CarResponseDto
carResponseDto
;
@@ -36,6 +37,16 @@ public class CarComponentPairControllerTest {
@Autowired
private
ObjectMapper
objectMapper
;
@TestConfiguration
static
class
TestConfig
{
@Bean
DbGetter
dbGetter
()
{
return
new
DbGetter
();
}
}
@BeforeEach
void
initializeTestObjects
()
{
Loading