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
Commits
563fcc64
There was an error fetching the commit references. Please try again later.
Commit
563fcc64
authored
1 year ago
by
Diana Gulčíková
Browse files
Options
Downloads
Patches
Plain Diff
basic test
parent
9aac265a
No related branches found
No related tags found
2 merge requests
!60
Docker
,
!38
Client to call endpoints
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
driver/pom.xml
+6
-0
6 additions, 0 deletions
driver/pom.xml
driver/src/test/java/cz/muni/pa165/driver/rest/DriverControllerItTest.java
+39
-0
39 additions, 0 deletions
...ava/cz/muni/pa165/driver/rest/DriverControllerItTest.java
with
45 additions
and
0 deletions
driver/pom.xml
+
6
−
0
View file @
563fcc64
...
...
@@ -51,6 +51,12 @@
<version>
0.0.1-SNAPSHOT
</version>
<scope>
compile
</scope>
</dependency>
<dependency>
<groupId>
junit
</groupId>
<artifactId>
junit
</artifactId>
<version>
4.12
</version>
<scope>
test
</scope>
</dependency>
</dependencies>
<properties>
...
...
This diff is collapsed.
Click to expand it.
driver/src/test/java/cz/muni/pa165/driver/rest/DriverControllerItTest.java
0 → 100644
+
39
−
0
View file @
563fcc64
package
cz.muni.pa165.driver.rest
;
import
cz.muni.pa165.driver.data.model.Driver
;
import
cz.muni.pa165.driver.data.repository.DriverRepository
;
import
java.util.Map
;
import
org.junit.jupiter.api.Assertions
;
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
;
@RunWith
(
SpringRunner
.
class
)
@DataJpaTest
class
DriverControllerItTest
{
@Autowired
private
TestEntityManager
entityManager
;
@Autowired
private
DriverRepository
driverRepository
;
@Test
public
void
testSave
()
{
// Create a new instance of MyEntity
Driver
driver
=
Driver
.
builder
()
.
name
(
"name"
)
.
surname
(
"surname"
)
.
nationality
(
"nationality"
)
.
characteristics
(
Map
.
of
()).
build
();
Driver
savedDriver
=
driverRepository
.
save
(
driver
);
Assertions
.
assertEquals
(
savedDriver
,
driver
);
Assertions
.
assertEquals
(
entityManager
.
find
(
Driver
.
class
,
1L
).
getId
(),
1
);
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment