diff --git a/src/main/resources/archetype-resources/src/test/groovy/IndexTest.groovy b/src/main/resources/archetype-resources/src/test/groovy/IndexTest.groovy index 4cbb3d5..c5f31f2 100644 --- a/src/main/resources/archetype-resources/src/test/groovy/IndexTest.groovy +++ b/src/main/resources/archetype-resources/src/test/groovy/IndexTest.groovy @@ -52,7 +52,7 @@ class IndexTest extends Specification { #if( $nbParams != 0 )// Simulate a request with a value for each parameter #end #foreach($urlParameter in $params) - httpRequest.getParameter("$urlParameter") >> "aValue$velocityCount" + httpRequest.getParameter("$urlParameter") >> "aValue$foreach.count" #end when: "Invoking the REST API" @@ -62,7 +62,7 @@ class IndexTest extends Specification { def jsonResponse = new JsonSlurper().parseText(apiResponse.response) // Validate returned response apiResponse.httpStatus == 200 -#foreach($urlParameter in $params) jsonResponse.$urlParameter == "aValue$velocityCount" +#foreach($urlParameter in $params) jsonResponse.$urlParameter == "aValue$foreach.count" #end jsonResponse.myParameterKey == "testValue" jsonResponse.currentDate == LocalDate.now().toString() @@ -76,7 +76,7 @@ class IndexTest extends Specification { #if( $nbParams != 0 )// Other parameters return a valid value #end #foreach($p in $params)#if($p != $urlParameter) - httpRequest.getParameter("$p") >> "aValue$velocityCount" + httpRequest.getParameter("$p") >> "aValue$foreach.count" #end#end when: "Invoking the REST API" diff --git a/src/main/resources/archetype-resources/src/test/java/IndexTest.java b/src/main/resources/archetype-resources/src/test/java/IndexTest.java index e9717cd..c199a7b 100644 --- a/src/main/resources/archetype-resources/src/test/java/IndexTest.java +++ b/src/main/resources/archetype-resources/src/test/java/IndexTest.java @@ -88,7 +88,7 @@ void should_get_result_when_params_ok() { // Given #foreach ($urlParameter in $params) - String $urlParameter = "aValue$velocityCount"; + String $urlParameter = "aValue$foreach.count"; #end // When @@ -108,7 +108,7 @@ void should_return_a_json_representation_as_result() throws IOException { // Simulate a request with a value for each parameter #foreach($urlParameter in $params) - when(httpRequest.getParameter("$urlParameter")).thenReturn("aValue$velocityCount"); + when(httpRequest.getParameter("$urlParameter")).thenReturn("aValue$foreach.count"); #end // When "Invoking the REST API" @@ -128,7 +128,7 @@ void should_return_a_json_representation_as_result() throws IOException { // Given "a request without $urlParameter" when(httpRequest.getParameter("$urlParameter")).thenReturn(null); #foreach($p in $params)#if($p != $urlParameter) - when(httpRequest.getParameter("$p")).thenReturn("aValue$velocityCount"); + when(httpRequest.getParameter("$p")).thenReturn("aValue$foreach.count"); #end#end // When "Invoking the REST API" diff --git a/src/main/resources/archetype-resources/src/test/kotlin/IndexTest.kt b/src/main/resources/archetype-resources/src/test/kotlin/IndexTest.kt index 67f66b7..b172fd5 100644 --- a/src/main/resources/archetype-resources/src/test/kotlin/IndexTest.kt +++ b/src/main/resources/archetype-resources/src/test/kotlin/IndexTest.kt @@ -48,7 +48,7 @@ class IndexTest { #if( $nbParams != 0 ) // Simulate a request with a value for each parameter #end #foreach($urlParameter in $params) - every { httpRequest.getParameter("$urlParameter") } returns "aValue$velocityCount"; + every { httpRequest.getParameter("$urlParameter") } returns "aValue$foreach.count"; #end // When @@ -59,7 +59,7 @@ class IndexTest { // Validate returned response assertThat(apiResponse.httpStatus).isEqualTo(200) #foreach($urlParameter in $params) - assertThat(jsonResponse["$urlParameter"]).isEqualTo("aValue$velocityCount") + assertThat(jsonResponse["$urlParameter"]).isEqualTo("aValue$foreach.count") #end assertThat(jsonResponse["myParameterKey"]).isEqualTo("testValue") assertThat(jsonResponse["currentDate"]).isEqualTo(LocalDate.now().toString()) @@ -73,7 +73,7 @@ class IndexTest { #if( $nbParams != 0 ) // Other parameters return a valid value #end #foreach($p in $params)#if($p != $urlParameter) - every { httpRequest.getParameter("$p") } returns "aValue$velocityCount"; + every { httpRequest.getParameter("$p") } returns "aValue$foreach.count"; #end#end // When