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-06 10:39:37 +0100
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
e0d8c33cf16d4364e90a654214396562706b163f
e0d8c33c
1 parent
c7f49b41
Tour des tests pour when/should.
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
9 deletions
src/test/java/org/legrog/web/publisher/ListPublisherActionsViewTest.java
src/test/java/org/legrog/web/publisher/ListPublisherVersionsViewTest.java
src/test/java/org/legrog/web/xyz/AddCountryViewTest.java
src/test/java/org/legrog/web/publisher/ListPublisherActionsViewTest.java
View file @
e0d8c33
...
...
@@ -47,7 +47,7 @@ public class ListPublisherActionsViewTest {
}
@Test
@DisplayName
(
"
should show all
"
)
@DisplayName
(
"
when publisher is not set, should be in all actions no filter state
"
)
public
void
showAll
(
@Mock
PublisherService
publisherServiceMock
)
{
listPublisherActionsView
.
setPublisherId
(
null
);
listPublisherActionsView
.
setViewAll
(
false
);
...
...
@@ -58,7 +58,7 @@ public class ListPublisherActionsViewTest {
}
@Test
@DisplayName
(
"
should show filtered
"
)
@DisplayName
(
"
when publisher is set, should be in filtered not all actions state
"
)
public
void
showFiltered
(
@Mock
PublisherService
publisherServiceMock
)
{
listPublisherActionsView
.
setPublisherId
(
1
);
listPublisherActionsView
.
setViewAll
(
true
);
...
...
@@ -70,7 +70,7 @@ public class ListPublisherActionsViewTest {
}
@Test
@DisplayName
(
"
filterId should filter
"
)
@DisplayName
(
"
when publisher is set, should show only its actions
"
)
public
void
testFilter
(
@Mock
PublisherService
publisherServiceMock
)
{
List
<
PublisherAction
>
publisherActions
=
new
ArrayList
<
PublisherAction
>();
...
...
src/test/java/org/legrog/web/publisher/ListPublisherVersionsViewTest.java
View file @
e0d8c33
...
...
@@ -76,7 +76,7 @@ public class ListPublisherVersionsViewTest {
}
@Test
@DisplayName
(
"
List of
all versions"
)
@DisplayName
(
"
when publisher is not set, should list
all versions"
)
public
void
testSetViewAll
()
{
listPublisherVersionsView
.
setPublisherId
(
null
);
listPublisherVersionsView
.
setView
();
...
...
@@ -86,7 +86,7 @@ public class ListPublisherVersionsViewTest {
}
@Test
@DisplayName
(
"
List of a
pulisher's versions"
)
@DisplayName
(
"
when publisher is set, should list
pulisher's versions"
)
public
void
testSetViewNotAllAlsoTestingFilterOnId
()
{
listPublisherVersionsView
.
setPublisherId
(
1
);
listPublisherVersionsView
.
setView
();
...
...
@@ -96,7 +96,7 @@ public class ListPublisherVersionsViewTest {
}
@Test
@DisplayName
(
"
Validates a publisher version using service
"
)
@DisplayName
(
"
when validating a publisher version, should call service method
"
)
public
void
testValidate
()
{
listPublisherVersionsView
.
setPublisherId
(
0
);
listPublisherVersionsView
.
validate
(
publisherVersion2
);
...
...
@@ -104,13 +104,13 @@ public class ListPublisherVersionsViewTest {
}
@Test
@DisplayName
(
"
Gets last validate for a publisher
"
)
@DisplayName
(
"
when requested the last validate for a publisher, should call service method
"
)
public
void
testGetLastValidate
()
{
assertThat
(
listPublisherVersionsView
.
getLastValidate
(
publisher
)).
isEqualTo
(
publisherAction
);
}
@Test
@DisplayName
(
"
Returns null when publisher has no validate action
"
)
@DisplayName
(
"
when requested the last validate for a publisher that has none, should get null
"
)
public
void
testGetLastValidateNull
()
{
assertThat
(
listPublisherVersionsView
.
getLastValidate
(
publisher1
)).
isNull
();
}
...
...
src/test/java/org/legrog/web/xyz/AddCountryViewTest.java
View file @
e0d8c33
...
...
@@ -37,7 +37,7 @@ public class AddCountryViewTest {
}
@Test
@DisplayName
(
"
uses the SharedService add with right argument
"
)
@DisplayName
(
"
should use the SharedService with right argument when a country is added
"
)
public
void
testSharedServiceAdd
(
@Mock
SharedService
sharedServiceMock
)
{
Mockito
.
verify
(
sharedServiceMock
).
addCountry
(
countryArgumentCaptor
.
capture
());
Country
country
=
countryArgumentCaptor
.
getValue
();
...
...
Please
register
or
login
to post a comment