#set( $symbol_pound = '#' )
#set( $symbol_dollar = '$' )
#set( $symbol_escape = '\' )
package ${package}.${subpackage}.client;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.Before;
import com.google.gwtmockito.GwtMockitoTestRunner;

import com.progressoft.brix.domino.api.client.annotations.ClientModule;
import com.progressoft.brix.domino.test.api.client.DominoTestClient;
import com.progressoft.brix.domino.test.api.client.ClientContext;
import ${package}.${subpackage}.client.presenters.${module}Presenter;
import ${package}.${subpackage}.client.requests.${module}RequestsFactory;
import ${package}.${subpackage}.shared.request.${module}Request;
import ${package}.${subpackage}.shared.response.${module}Response;
import ${package}.${subpackage}.client.presenters.${module}PresenterSpy;
import ${package}.${subpackage}.client.views.Fake${module}View;

import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.fail;

@ClientModule(name="Test${module}")
@RunWith(GwtMockitoTestRunner.class)
public class ${module}ClientModuleTest{

    private ${module}PresenterSpy presenterSpy;
    private Fake${module}View fakeView;
    private ClientContext clientContext;

    @Before
    public void setUp() {
        presenterSpy = new ${module}PresenterSpy();
        DominoTestClient.useModules(new ${module}ModuleConfiguration(), new Test${module}ModuleConfiguration())
        .replacePresenter(${module}Presenter.class, presenterSpy)
        .viewOf(${module}Presenter.class, view -> fakeView= (Fake${module}View) view)
        .onStartCompleted(clientContext -> this.clientContext = clientContext)
        .start();
    }

    @Test
    public void given${module}Module_whenContributingToMainExtensionPoint_thenShouldReceiveMainContext() {
        assertThat(presenterSpy.getMainContext()).isNotNull();
    }

    @Test
    public void given${module}ClientModule_when${module}ServerRequestIsSent_thenServerMessageShouldBeRecieved() {
        clientContext.forRequest(${module}RequestsFactory.${module}Requests_request.class)
        .returnResponse(new ${module}Response("Server message"));

        ${module}RequestsFactory.INSTANCE.request(new ${module}Request("client message")).onSuccess(response -> assertThat(response.getServerMessage()).isEqualTo("Server message"))
        .onFailed(failedResponse -> fail(failedResponse.getError().getMessage()))
        .send();
    }
}

@@ -121,16 +121,68 @@
 lient;%0A%0A
+import com.google.gwtmockito.GwtMockitoTestRunner;%0A%0A
 import o
@@ -257,59 +257,8 @@
 ore;
-%0Aimport com.google.gwtmockito.GwtMockitoTestRunner;
 %0A%0Aim
@@ -987,16 +987,17 @@
 .fail;%0A%0A
+%0A
 @ClientM
@@ -1434,16 +1434,24 @@
 tion())%0A
+        
         
@@ -1516,16 +1516,24 @@
         
+     
+   
 .viewOf(
@@ -1602,16 +1602,24 @@
 ) view)%0A
+        
         
@@ -1697,16 +1697,24 @@
         
+ 
+       
 .start()
@@ -1836,16 +1836,33 @@
 ontext()
+ throws Exception
  %7B%0A     

change the generated module request to use RequestFactory