Jean-Francois Leveque

Refactoring création publisher avec version initiale.

...@@ -11,7 +11,7 @@ import java.util.List; ...@@ -11,7 +11,7 @@ import java.util.List;
11 */ 11 */
12 public interface PublisherService { 12 public interface PublisherService {
13 13
14 - void addPublisherWithVersion(Publisher publisher, PublisherVersion publisherVersion); 14 + void addNewPublisher(PublisherVersion publisherVersion);
15 15
16 void addVersionToPublisher(Publisher publisher, PublisherVersion publisherVersion); 16 void addVersionToPublisher(Publisher publisher, PublisherVersion publisherVersion);
17 17
......
...@@ -34,7 +34,8 @@ public class PublisherServiceSpring implements PublisherService { ...@@ -34,7 +34,8 @@ public class PublisherServiceSpring implements PublisherService {
34 @Inject 34 @Inject
35 SharedService sharedService; 35 SharedService sharedService;
36 36
37 - public void addPublisherWithVersion(Publisher publisher, PublisherVersion publisherVersion) { 37 + public void addNewPublisher(PublisherVersion publisherVersion) {
38 + Publisher publisher = new Publisher();
38 Set<PublisherVersion> publisherVersions = new HashSet<>(); 39 Set<PublisherVersion> publisherVersions = new HashSet<>();
39 publisherVersions.add(publisherVersion); 40 publisherVersions.add(publisherVersion);
40 publisher.setVersions(publisherVersions); 41 publisher.setVersions(publisherVersions);
...@@ -44,7 +45,6 @@ public class PublisherServiceSpring implements PublisherService { ...@@ -44,7 +45,6 @@ public class PublisherServiceSpring implements PublisherService {
44 this.savePublisherVersion(publisherVersion); 45 this.savePublisherVersion(publisherVersion);
45 this.savePublisher(publisher); 46 this.savePublisher(publisher);
46 } 47 }
47 -
48 public void addVersionToPublisher(Publisher publisher, PublisherVersion publisherVersion) { 48 public void addVersionToPublisher(Publisher publisher, PublisherVersion publisherVersion) {
49 logger.trace("debut addVersionToPublisher, publisherVersion = {}", publisherVersion); 49 logger.trace("debut addVersionToPublisher, publisherVersion = {}", publisherVersion);
50 Set<PublisherVersion> publisherVersionSet = publisher.getVersions(); 50 Set<PublisherVersion> publisherVersionSet = publisher.getVersions();
......