Toggle navigation
Toggle navigation
This project
Loading...
Sign in
grogv3
/
grog-cubi
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Jean-Francois Leveque
2017-02-27 16:21:06 +0100
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
5c55a7e1d457f9385a205486384ff8b00754f8d8
5c55a7e1
1 parent
98b1f8d1
Réorganisation des tests (Nested)
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
0 deletions
src/test/java/org/legrog/web/publisher/PublisherServiceDefaultTest.java
src/test/java/org/legrog/web/publisher/PublisherServiceDefaultTest.java
View file @
5c55a7e
package
org
.
legrog
.
web
.
publisher
;
import
org.junit.jupiter.api.Nested
;
import
org.junit.jupiter.api.Test
;
import
org.junit.jupiter.api.BeforeEach
;
import
org.junit.jupiter.api.DisplayName
;
...
...
@@ -57,6 +58,10 @@ public class PublisherServiceDefaultTest {
this
.
publisherRepository
=
publisherRepository
;
}
@Nested
@DisplayName
(
"addNewPublisher method"
)
class
AddNewPublisherTests
{
@DisplayName
(
"When a new publisher is added, both Publisher and PublisherVersion should be saved in the right state"
)
@Test
public
void
testAddNewPublisher
(
@Mock
PublisherVersionRepository
publisherVersionRepository
)
{
...
...
@@ -68,6 +73,12 @@ public class PublisherServiceDefaultTest {
verify
(
publisherVersionRepository
).
save
(
publisherVersion
);
}
}
@Nested
@DisplayName
(
"addVersionToPublisher method"
)
class
AddVersionToPublisherTests
{
@DisplayName
(
"When a new version of a publisher is added, setting it up, attaching it to publisher and saving both"
)
@Test
public
void
testAddVersionToPublisher
(
@Mock
PublisherRepository
publisherRepository
,
...
...
@@ -81,6 +92,12 @@ public class PublisherServiceDefaultTest {
verify
(
publisherVersionRepository
).
save
(
publisherVersion1
);
}
}
@Nested
@DisplayName
(
"addVersionToPublisher method"
)
class
ValidatePublisherVersionTests
{
@DisplayName
(
"When a PublisherVersion is validated, it should be the right one"
)
@Test
public
void
testValidateVersionRight
()
{
...
...
@@ -137,4 +154,6 @@ public class PublisherServiceDefaultTest {
assertThat
(
publisherAction
.
getActionType
()).
isEqualTo
(
actionType
);
}
}
}
...
...
Please
register
or
login
to post a comment