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
2016-11-28 10:46:32 +0100
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
dcb288db3d75b8d4534be98ed26d9dc66b74b359
dcb288db
1 parent
1209068b
Correction minimale du test avec l'ActionType.
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
src/test/java/org/legrog/web/publisher/PublisherServiceSpringTest.java
src/test/java/org/legrog/web/publisher/PublisherServiceSpringTest.java
View file @
dcb288d
...
...
@@ -80,24 +80,27 @@ public class PublisherServiceSpringTest {
@DisplayName
(
"Test validation version éditeur"
)
@Test
public
void
testValidateVersion
(
@Mock
PublisherActionRepository
publisherActionRepository
)
{
public
void
testValidateVersion
(
@Mock
PublisherActionRepository
publisherActionRepository
,
@Mock
ActionTypeRepository
actionTypeRepository
)
{
Set
<
PublisherVersion
>
publisherVersions
;
ActionType
actionType
=
new
ActionType
();
publisher
=
new
Publisher
();
publisherVersion
=
new
PublisherVersion
();
publisherVersions
=
new
HashSet
<
PublisherVersion
>();
publisherVersions
.
add
(
publisherVersion
);
publisherVersions
.
add
(
publisherVersionMock
);
when
(
publisherVersionMock
.
getPublisher
()).
thenReturn
(
publisher
);
when
(
actionTypeRepository
.
findByActionTypeName
(
"Validate"
)).
thenReturn
(
actionType
);
PublisherAction
publisherAction
;
publisherAction
=
publisherServiceSpring
.
validatePublisherVersion
(
publisherVersionMock
);
verify
(
publisherActionRepository
).
save
(
publisherAction
);
assertThat
(
publisherAction
.
getPublisherVersion
()).
isEqualTo
(
publisherVersionMock
);
assertThat
(
publisherAction
.
getPublisher
()).
isEqualTo
(
publisher
);
assertThat
(
publisherAction
.
getPublisher
().
getValidatedVersion
()).
isEqualTo
(
publisherVersionMock
);
// TODO Régler ce problème de NPE
// assertThat(publisherAction.getActionType()).isEqualTo(actionTypeRepository.findByActionTypeName("Validate"));
assertThat
(
publisherAction
.
getActionType
()).
isEqualTo
(
actionType
);
}
}
...
...
Please
register
or
login
to post a comment