From 853a3953092d996d60cb0e35aeb410c28ab4ef0b Mon Sep 17 00:00:00 2001 From: Olga Maciaszek-Sharma Date: Mon, 22 Feb 2016 16:23:01 +0100 Subject: [PATCH] Fixed JaxrsClient method builder spec naming. --- .../accurest/SingleTestGeneratorSpec.groovy | 24 ++++++++++++++++++- ...vy => JaxRsClientMethodBuilderSpec.groovy} | 10 ++++---- 2 files changed, 28 insertions(+), 6 deletions(-) rename accurest-core/src/test/groovy/io/codearte/accurest/builder/{JaxRsClientSpockMethodBuilderSpec.groovy => JaxRsClientMethodBuilderSpec.groovy} (98%) diff --git a/accurest-core/src/test/groovy/io/codearte/accurest/SingleTestGeneratorSpec.groovy b/accurest-core/src/test/groovy/io/codearte/accurest/SingleTestGeneratorSpec.groovy index 7a9d560c9b..7d2254e27c 100644 --- a/accurest-core/src/test/groovy/io/codearte/accurest/SingleTestGeneratorSpec.groovy +++ b/accurest-core/src/test/groovy/io/codearte/accurest/SingleTestGeneratorSpec.groovy @@ -42,7 +42,29 @@ class SingleTestGeneratorSpec extends Specification { } @Unroll - def "should build test class for #testFramework"() { + def "should build MockMvc test class for #testFramework"() { + given: + AccurestConfigProperties properties = new AccurestConfigProperties(); + properties.targetFramework = testFramework + Contract contract = new Contract(file.toPath(), true, 1, 2) + contract.ignored >> true + contract.order >> 2 + SingleTestGenerator testGenerator = new SingleTestGenerator(properties) + + when: + String clazz = testGenerator.buildClass([contract], "test", "test") + + then: + classStrings.forEach({ clazz.contains(it) }) + + where: + testFramework | classStrings + JUNIT | jUnitClassStrings + SPOCK | spockClassStrings + } + + @Unroll + def "should build JaxRs test class for #testFramework"() { given: AccurestConfigProperties properties = new AccurestConfigProperties(); properties.targetFramework = testFramework diff --git a/accurest-core/src/test/groovy/io/codearte/accurest/builder/JaxRsClientSpockMethodBuilderSpec.groovy b/accurest-core/src/test/groovy/io/codearte/accurest/builder/JaxRsClientMethodBuilderSpec.groovy similarity index 98% rename from accurest-core/src/test/groovy/io/codearte/accurest/builder/JaxRsClientSpockMethodBuilderSpec.groovy rename to accurest-core/src/test/groovy/io/codearte/accurest/builder/JaxRsClientMethodBuilderSpec.groovy index e2fdca8146..f659c0bab5 100644 --- a/accurest-core/src/test/groovy/io/codearte/accurest/builder/JaxRsClientSpockMethodBuilderSpec.groovy +++ b/accurest-core/src/test/groovy/io/codearte/accurest/builder/JaxRsClientMethodBuilderSpec.groovy @@ -8,7 +8,7 @@ import spock.lang.Issue import spock.lang.Specification import spock.lang.Unroll -class JaxRsClientSpockMethodBuilderSpec extends Specification implements WireMockStubVerifier { +class JaxRsClientMethodBuilderSpec extends Specification implements WireMockStubVerifier { @Unroll def "should generate assertions for simple response body with #methodBuilderName"() { @@ -535,9 +535,9 @@ class JaxRsClientSpockMethodBuilderSpec extends Specification implements WireMoc BlockBuilder blockBuilder = new BlockBuilder(" ") when: builder.appendTo(blockBuilder) - def spockTest = blockBuilder.toString() + def test = blockBuilder.toString() then: - spockTest.contains(bodyString) + test.contains(bodyString) and: stubMappingIsValidWireMockStub(contractDsl) where: @@ -598,9 +598,9 @@ class JaxRsClientSpockMethodBuilderSpec extends Specification implements WireMoc BlockBuilder blockBuilder = new BlockBuilder(" ") when: builder.appendTo(blockBuilder) - def spockTest = blockBuilder.toString() + def test = blockBuilder.toString() then: - spockTest.contains(methodString) + test.contains(methodString) and: stubMappingIsValidWireMockStub(contractDsl) where: