From da9a17bcd59be1a3443579633ce02b5df0f11723 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 6 Dec 2014 18:34:20 -0300 Subject: [PATCH] Move Requestor Impl to service-domain project Requestor is independent of Delivery Layer --- .../requestor/impl}/InteractorFactoryImpl.java | 5 +---- .../requestor/impl}/RequestBuilderImpl.java | 5 +---- .../requestor/InteractorFactoryTest.java | 3 ++- .../requestor/RequestBuilderTest.java | 3 ++- .../org/reparationservice/rest/Application.java | 14 ++++++++++++++ 5 files changed, 20 insertions(+), 10 deletions(-) rename {web-interface/src/main/java/org/reparationservice/rest/requestor => service-domain/src/main/java/reparationservice/requestor/impl}/InteractorFactoryImpl.java (89%) rename {web-interface/src/main/java/org/reparationservice/rest/requestor => service-domain/src/main/java/reparationservice/requestor/impl}/RequestBuilderImpl.java (76%) rename {web-interface/src/test/java/org/reparationservice/rest => service-domain/src/test/java/reparationservice}/requestor/InteractorFactoryTest.java (93%) rename {web-interface/src/test/java/org/reparationservice/rest => service-domain/src/test/java/reparationservice}/requestor/RequestBuilderTest.java (87%) diff --git a/web-interface/src/main/java/org/reparationservice/rest/requestor/InteractorFactoryImpl.java b/service-domain/src/main/java/reparationservice/requestor/impl/InteractorFactoryImpl.java similarity index 89% rename from web-interface/src/main/java/org/reparationservice/rest/requestor/InteractorFactoryImpl.java rename to service-domain/src/main/java/reparationservice/requestor/impl/InteractorFactoryImpl.java index 82d2464..c19e633 100644 --- a/web-interface/src/main/java/org/reparationservice/rest/requestor/InteractorFactoryImpl.java +++ b/service-domain/src/main/java/reparationservice/requestor/impl/InteractorFactoryImpl.java @@ -1,6 +1,4 @@ -package org.reparationservice.rest.requestor; - -import org.springframework.stereotype.Component; +package reparationservice.requestor.impl; import reparationservice.entities.worker.WorkerGateway; import reparationservice.requestor.InteractorFactory; @@ -10,7 +8,6 @@ import reparationservice.usecases.worker.GetAllWorkerInteractor; import reparationservice.usecases.worker.GetAllWorkersResponder; -@Component public class InteractorFactoryImpl implements InteractorFactory { @Override public UseCaseActivator makeAddWorkerInteractor(WorkerGateway workers, UseCaseRequest request) { diff --git a/web-interface/src/main/java/org/reparationservice/rest/requestor/RequestBuilderImpl.java b/service-domain/src/main/java/reparationservice/requestor/impl/RequestBuilderImpl.java similarity index 76% rename from web-interface/src/main/java/org/reparationservice/rest/requestor/RequestBuilderImpl.java rename to service-domain/src/main/java/reparationservice/requestor/impl/RequestBuilderImpl.java index 224e327..b7b271c 100644 --- a/web-interface/src/main/java/org/reparationservice/rest/requestor/RequestBuilderImpl.java +++ b/service-domain/src/main/java/reparationservice/requestor/impl/RequestBuilderImpl.java @@ -1,12 +1,9 @@ -package org.reparationservice.rest.requestor; - -import org.springframework.stereotype.Component; +package reparationservice.requestor.impl; import reparationservice.requestor.RequestBuilder; import reparationservice.requestor.UseCaseRequest; import reparationservice.usecases.worker.AddWorkerRequest; -@Component public class RequestBuilderImpl implements RequestBuilder { @Override public UseCaseRequest buildAddWorkerRequest(String username) { diff --git a/web-interface/src/test/java/org/reparationservice/rest/requestor/InteractorFactoryTest.java b/service-domain/src/test/java/reparationservice/requestor/InteractorFactoryTest.java similarity index 93% rename from web-interface/src/test/java/org/reparationservice/rest/requestor/InteractorFactoryTest.java rename to service-domain/src/test/java/reparationservice/requestor/InteractorFactoryTest.java index 339025c..004ef46 100644 --- a/web-interface/src/test/java/org/reparationservice/rest/requestor/InteractorFactoryTest.java +++ b/service-domain/src/test/java/reparationservice/requestor/InteractorFactoryTest.java @@ -1,4 +1,4 @@ -package org.reparationservice.rest.requestor; +package reparationservice.requestor; import static org.assertj.core.api.Assertions.assertThat; @@ -10,6 +10,7 @@ import reparationservice.requestor.InteractorFactory; import reparationservice.requestor.UseCaseActivator; import reparationservice.requestor.UseCaseRequest; +import reparationservice.requestor.impl.InteractorFactoryImpl; import reparationservice.usecases.worker.AddWorkerInteractor; import reparationservice.usecases.worker.GetAllWorkerInteractor; import reparationservice.usecases.worker.GetAllWorkersResponderSpy; diff --git a/web-interface/src/test/java/org/reparationservice/rest/requestor/RequestBuilderTest.java b/service-domain/src/test/java/reparationservice/requestor/RequestBuilderTest.java similarity index 87% rename from web-interface/src/test/java/org/reparationservice/rest/requestor/RequestBuilderTest.java rename to service-domain/src/test/java/reparationservice/requestor/RequestBuilderTest.java index 59b47b0..5e92d24 100644 --- a/web-interface/src/test/java/org/reparationservice/rest/requestor/RequestBuilderTest.java +++ b/service-domain/src/test/java/reparationservice/requestor/RequestBuilderTest.java @@ -1,10 +1,11 @@ -package org.reparationservice.rest.requestor; +package reparationservice.requestor; import static org.assertj.core.api.Assertions.assertThat; import org.junit.Test; import reparationservice.requestor.UseCaseRequest; +import reparationservice.requestor.impl.RequestBuilderImpl; import reparationservice.usecases.worker.AddWorkerRequest; import reparationservice.usecases.worker.AddWorkerRequestBuilder; diff --git a/web-interface/src/main/java/org/reparationservice/rest/Application.java b/web-interface/src/main/java/org/reparationservice/rest/Application.java index 4be189c..7165d31 100644 --- a/web-interface/src/main/java/org/reparationservice/rest/Application.java +++ b/web-interface/src/main/java/org/reparationservice/rest/Application.java @@ -10,6 +10,10 @@ import reparationservice.entities.worker.WorkerGateway; import reparationservice.persistenceimpls.inmemory.InMemoryConfigurator; +import reparationservice.requestor.InteractorFactory; +import reparationservice.requestor.RequestBuilder; +import reparationservice.requestor.impl.InteractorFactoryImpl; +import reparationservice.requestor.impl.RequestBuilderImpl; @Configuration @ComponentScan @@ -24,6 +28,16 @@ WorkerGateway getWorkerGW() { return InMemoryConfigurator.getWorkerGateway(); } + @Bean + InteractorFactory getInteractorFactory() { + return new InteractorFactoryImpl(); + } + + @Bean + RequestBuilder getRequestBuilder() { + return new RequestBuilderImpl(); + } + @Configuration public static class DisableStaticResourceConfiguration extends WebMvcAutoConfigurationAdapter { @Override