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-17 15:21:00 +0100
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
d200139ac10207b0984806b5f5a59888fc59eb40
d200139a
1 parent
1ddbdf6e
Adaptation du code et des tests existants pour que ceux-ci soient à nouveau au vert.
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
11 deletions
src/main/java/org/legrog/entities/PublisherAction.java
src/main/java/org/legrog/entities/PublisherActionRepository.java
src/main/java/org/legrog/web/publisher/PublisherServiceSpring.java
src/test/java/org/legrog/web/publisher/PublisherServiceSpringTest.java
src/main/java/org/legrog/entities/PublisherAction.java
View file @
d200139
...
...
@@ -24,4 +24,11 @@ public class PublisherAction {
@ManyToOne
private
Publisher
publisher
;
public
void
setPublisherActionAuthor
(
User
publisherActionAuthor
)
{
this
.
publisherActionAuthor
=
publisherActionAuthor
;
}
public
void
setPublisherActionDatetime
(
Timestamp
publisherActionDatetime
)
{
this
.
publisherActionDatetime
=
publisherActionDatetime
;
}
}
...
...
src/main/java/org/legrog/entities/PublisherActionRepository.java
0 → 100644
View file @
d200139
package
org
.
legrog
.
entities
;
import
org.springframework.data.jpa.repository.JpaRepository
;
public
interface
PublisherActionRepository
extends
JpaRepository
<
PublisherAction
,
Integer
>
{
}
src/main/java/org/legrog/web/publisher/PublisherServiceSpring.java
View file @
d200139
package
org
.
legrog
.
web
.
publisher
;
import
org.legrog.entities.Publisher
;
import
org.legrog.entities.PublisherRepository
;
import
org.legrog.entities.PublisherVersion
;
import
org.legrog.entities.PublisherVersionRepository
;
import
org.legrog.entities.*
;
import
org.legrog.web.xyz.SharedService
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
@@ -27,14 +24,17 @@ public class PublisherServiceSpring implements PublisherService {
PublisherRepository
publisherRepository
;
PublisherVersionRepository
publisherVersionRepository
;
PublisherActionRepository
publisherActionRepository
;
SharedService
sharedService
;
@Inject
public
PublisherServiceSpring
(
PublisherRepository
publisherRepository
,
PublisherVersionRepository
publisherVersionRepository
,
PublisherActionRepository
publisherActionRepository
,
SharedService
sharedService
)
{
this
.
publisherRepository
=
publisherRepository
;
this
.
publisherVersionRepository
=
publisherVersionRepository
;
this
.
publisherActionRepository
=
publisherActionRepository
;
this
.
sharedService
=
sharedService
;
}
...
...
@@ -70,9 +70,11 @@ public class PublisherServiceSpring implements PublisherService {
public
void
validatePublisherVersion
(
PublisherVersion
publisherVersion
)
{
Publisher
publisher
=
publisherVersion
.
getPublisher
();
publisher
.
setValidatedVersion
(
publisherVersion
);
publisher
.
setValidator
(
sharedService
.
getCurrentUser
());
publisher
.
setValidationDateTime
(
new
Timestamp
(
new
Date
().
getTime
()));
PublisherAction
publisherAction
=
new
PublisherAction
();
publisherAction
.
setPublisherActionAuthor
(
sharedService
.
getCurrentUser
());
publisherAction
.
setPublisherActionDatetime
(
new
Timestamp
(
new
Date
().
getTime
()));
this
.
savePublisher
(
publisher
);
publisherActionRepository
.
save
(
publisherAction
);
}
protected
void
savePublisherVersion
(
PublisherVersion
publisherVersion
)
{
...
...
src/test/java/org/legrog/web/publisher/PublisherServiceSpringTest.java
View file @
d200139
...
...
@@ -6,10 +6,7 @@ import org.junit.jupiter.api.DisplayName;
import
org.junit.jupiter.api.extension.ExtendWith
;
import
org.junit.platform.runner.JUnitPlatform
;
import
org.junit.runner.RunWith
;
import
org.legrog.entities.Publisher
;
import
org.legrog.entities.PublisherRepository
;
import
org.legrog.entities.PublisherVersion
;
import
org.legrog.entities.PublisherVersionRepository
;
import
org.legrog.entities.*
;
import
org.legrog.test.MockitoExtension
;
import
org.legrog.web.xyz.SharedService
;
import
org.mockito.Mock
;
...
...
@@ -35,9 +32,10 @@ public class PublisherServiceSpringTest {
@BeforeEach
public
void
setUp
(
@Mock
PublisherRepository
publisherRepository
,
@Mock
PublisherVersionRepository
publisherVersionRepository
,
@Mock
PublisherActionRepository
publisherActionRepository
,
@Mock
SharedService
sharedService
)
throws
Exception
{
publisherServiceSpring
=
new
PublisherServiceSpring
(
publisherRepository
,
publisherVersionRepository
,
sharedService
);
publisherVersionRepository
,
publisherActionRepository
,
sharedService
);
publisherVersion
=
new
PublisherVersion
();
publisherVersion1
=
new
PublisherVersion
();
this
.
publisherRepository
=
publisherRepository
;
...
...
Please
register
or
login
to post a comment