From b8e26a2d3a610e938cffa9c61a265e8764a65850 Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Wed, 14 Jan 2015 11:55:34 +0100 Subject: [PATCH] Move support test classes to io.spring.initializr.test Previously, the Assert helpers were located in the support package that is also used by some support classes in the production code. Having both test helpers and tests in the same package is a bit confusing. Those test helpers are now relocated to a dedicated test package. --- ...faultInitializrMetadataProviderTests.groovy | 4 ++-- .../InitializrMetadataJsonMapperTests.groovy | 4 ++-- .../initializr/InitializrMetadataTests.groovy | 4 ++-- ...rojectGenerationMetricsListenerTests.groovy | 8 ++++---- .../initializr/ProjectGeneratorTests.groovy | 10 +++++----- .../initializr/ProjectRequestTests.groovy | 4 ++-- .../{support => test}/GradleBuildAssert.groovy | 4 ++-- .../InitializrMetadataBuilder.groovy | 4 ++-- .../{support => test}/MetricsAssert.groovy | 4 ++-- .../{support => test}/PomAssert.groovy | 4 ++-- .../{support => test}/ProjectAssert.groovy | 4 ++-- .../TestCounterService.groovy | 4 ++-- ...alizerControllerFormIntegrationTests.groovy | 6 +++--- ...InitializrControllerIntegrationTests.groovy | 4 ++-- ...inControllerDefaultsIntegrationTests.groovy | 18 +++++++++++++++++- .../web/MainControllerIntegrationTests.groovy | 4 ++-- 16 files changed, 53 insertions(+), 37 deletions(-) rename initializr/src/test/groovy/io/spring/initializr/{support => test}/GradleBuildAssert.groovy (95%) rename initializr/src/test/groovy/io/spring/initializr/{support => test}/InitializrMetadataBuilder.groovy (97%) rename initializr/src/test/groovy/io/spring/initializr/{support => test}/MetricsAssert.groovy (94%) rename initializr/src/test/groovy/io/spring/initializr/{support => test}/PomAssert.groovy (98%) rename initializr/src/test/groovy/io/spring/initializr/{support => test}/ProjectAssert.groovy (97%) rename initializr/src/test/groovy/io/spring/initializr/{support => test}/TestCounterService.groovy (93%) diff --git a/initializr/src/test/groovy/io/spring/initializr/DefaultInitializrMetadataProviderTests.groovy b/initializr/src/test/groovy/io/spring/initializr/DefaultInitializrMetadataProviderTests.groovy index c6fd4c66..aa4f50a9 100644 --- a/initializr/src/test/groovy/io/spring/initializr/DefaultInitializrMetadataProviderTests.groovy +++ b/initializr/src/test/groovy/io/spring/initializr/DefaultInitializrMetadataProviderTests.groovy @@ -1,5 +1,5 @@ /* - * Copyright 2012-2014 the original author or authors. + * Copyright 2012-2015 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,7 @@ package io.spring.initializr -import io.spring.initializr.support.InitializrMetadataBuilder +import io.spring.initializr.test.InitializrMetadataBuilder import org.junit.Test import static org.junit.Assert.* diff --git a/initializr/src/test/groovy/io/spring/initializr/InitializrMetadataJsonMapperTests.groovy b/initializr/src/test/groovy/io/spring/initializr/InitializrMetadataJsonMapperTests.groovy index c8c79ed2..23c8eb19 100644 --- a/initializr/src/test/groovy/io/spring/initializr/InitializrMetadataJsonMapperTests.groovy +++ b/initializr/src/test/groovy/io/spring/initializr/InitializrMetadataJsonMapperTests.groovy @@ -1,5 +1,5 @@ /* - * Copyright 2012-2014 the original author or authors. + * Copyright 2012-2015 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,7 +17,7 @@ package io.spring.initializr import groovy.json.JsonSlurper -import io.spring.initializr.support.InitializrMetadataBuilder +import io.spring.initializr.test.InitializrMetadataBuilder import org.junit.Test import static org.junit.Assert.assertEquals diff --git a/initializr/src/test/groovy/io/spring/initializr/InitializrMetadataTests.groovy b/initializr/src/test/groovy/io/spring/initializr/InitializrMetadataTests.groovy index 72079c76..3b266621 100644 --- a/initializr/src/test/groovy/io/spring/initializr/InitializrMetadataTests.groovy +++ b/initializr/src/test/groovy/io/spring/initializr/InitializrMetadataTests.groovy @@ -1,5 +1,5 @@ /* - * Copyright 2012-2014 the original author or authors. + * Copyright 2012-2015 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,7 @@ package io.spring.initializr -import io.spring.initializr.support.InitializrMetadataBuilder +import io.spring.initializr.test.InitializrMetadataBuilder import org.junit.Rule import org.junit.Test import org.junit.rules.ExpectedException diff --git a/initializr/src/test/groovy/io/spring/initializr/ProjectGenerationMetricsListenerTests.groovy b/initializr/src/test/groovy/io/spring/initializr/ProjectGenerationMetricsListenerTests.groovy index 1f61bd54..1423ec24 100644 --- a/initializr/src/test/groovy/io/spring/initializr/ProjectGenerationMetricsListenerTests.groovy +++ b/initializr/src/test/groovy/io/spring/initializr/ProjectGenerationMetricsListenerTests.groovy @@ -1,5 +1,5 @@ /* - * Copyright 2012-2014 the original author or authors. + * Copyright 2012-2015 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,9 +16,9 @@ package io.spring.initializr -import io.spring.initializr.support.InitializrMetadataBuilder -import io.spring.initializr.support.MetricsAssert -import io.spring.initializr.support.TestCounterService +import io.spring.initializr.test.InitializrMetadataBuilder +import io.spring.initializr.test.MetricsAssert +import io.spring.initializr.test.TestCounterService import org.junit.Before import org.junit.Test diff --git a/initializr/src/test/groovy/io/spring/initializr/ProjectGeneratorTests.groovy b/initializr/src/test/groovy/io/spring/initializr/ProjectGeneratorTests.groovy index 09738d3b..42bbc067 100644 --- a/initializr/src/test/groovy/io/spring/initializr/ProjectGeneratorTests.groovy +++ b/initializr/src/test/groovy/io/spring/initializr/ProjectGeneratorTests.groovy @@ -1,5 +1,5 @@ /* - * Copyright 2012-2014 the original author or authors. + * Copyright 2012-2015 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,10 +16,10 @@ package io.spring.initializr -import io.spring.initializr.support.GradleBuildAssert -import io.spring.initializr.support.InitializrMetadataBuilder -import io.spring.initializr.support.PomAssert -import io.spring.initializr.support.ProjectAssert +import io.spring.initializr.test.GradleBuildAssert +import io.spring.initializr.test.InitializrMetadataBuilder +import io.spring.initializr.test.PomAssert +import io.spring.initializr.test.ProjectAssert import org.junit.Before import org.junit.Rule import org.junit.Test diff --git a/initializr/src/test/groovy/io/spring/initializr/ProjectRequestTests.groovy b/initializr/src/test/groovy/io/spring/initializr/ProjectRequestTests.groovy index d4510e72..22d50736 100644 --- a/initializr/src/test/groovy/io/spring/initializr/ProjectRequestTests.groovy +++ b/initializr/src/test/groovy/io/spring/initializr/ProjectRequestTests.groovy @@ -1,5 +1,5 @@ /* - * Copyright 2012-2014 the original author or authors. + * Copyright 2012-2015 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,7 @@ package io.spring.initializr -import io.spring.initializr.support.InitializrMetadataBuilder +import io.spring.initializr.test.InitializrMetadataBuilder import org.junit.Rule import org.junit.Test import org.junit.rules.ExpectedException diff --git a/initializr/src/test/groovy/io/spring/initializr/support/GradleBuildAssert.groovy b/initializr/src/test/groovy/io/spring/initializr/test/GradleBuildAssert.groovy similarity index 95% rename from initializr/src/test/groovy/io/spring/initializr/support/GradleBuildAssert.groovy rename to initializr/src/test/groovy/io/spring/initializr/test/GradleBuildAssert.groovy index 8f01f7df..f7d96444 100644 --- a/initializr/src/test/groovy/io/spring/initializr/support/GradleBuildAssert.groovy +++ b/initializr/src/test/groovy/io/spring/initializr/test/GradleBuildAssert.groovy @@ -1,5 +1,5 @@ /* - * Copyright 2012-2014 the original author or authors. + * Copyright 2012-2015 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.spring.initializr.support +package io.spring.initializr.test import io.spring.initializr.ProjectRequest diff --git a/initializr/src/test/groovy/io/spring/initializr/support/InitializrMetadataBuilder.groovy b/initializr/src/test/groovy/io/spring/initializr/test/InitializrMetadataBuilder.groovy similarity index 97% rename from initializr/src/test/groovy/io/spring/initializr/support/InitializrMetadataBuilder.groovy rename to initializr/src/test/groovy/io/spring/initializr/test/InitializrMetadataBuilder.groovy index ec3bfbea..193804f9 100644 --- a/initializr/src/test/groovy/io/spring/initializr/support/InitializrMetadataBuilder.groovy +++ b/initializr/src/test/groovy/io/spring/initializr/test/InitializrMetadataBuilder.groovy @@ -1,5 +1,5 @@ /* - * Copyright 2012-2014 the original author or authors. + * Copyright 2012-2015 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.spring.initializr.support +package io.spring.initializr.test import io.spring.initializr.InitializrMetadata diff --git a/initializr/src/test/groovy/io/spring/initializr/support/MetricsAssert.groovy b/initializr/src/test/groovy/io/spring/initializr/test/MetricsAssert.groovy similarity index 94% rename from initializr/src/test/groovy/io/spring/initializr/support/MetricsAssert.groovy rename to initializr/src/test/groovy/io/spring/initializr/test/MetricsAssert.groovy index 71e6bddc..3987d2cd 100644 --- a/initializr/src/test/groovy/io/spring/initializr/support/MetricsAssert.groovy +++ b/initializr/src/test/groovy/io/spring/initializr/test/MetricsAssert.groovy @@ -1,5 +1,5 @@ /* - * Copyright 2012-2014 the original author or authors. + * Copyright 2012-2015 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.spring.initializr.support +package io.spring.initializr.test import static org.junit.Assert.assertEquals import static org.junit.Assert.fail diff --git a/initializr/src/test/groovy/io/spring/initializr/support/PomAssert.groovy b/initializr/src/test/groovy/io/spring/initializr/test/PomAssert.groovy similarity index 98% rename from initializr/src/test/groovy/io/spring/initializr/support/PomAssert.groovy rename to initializr/src/test/groovy/io/spring/initializr/test/PomAssert.groovy index 0ca4abf5..2ad3be56 100644 --- a/initializr/src/test/groovy/io/spring/initializr/support/PomAssert.groovy +++ b/initializr/src/test/groovy/io/spring/initializr/test/PomAssert.groovy @@ -1,5 +1,5 @@ /* - * Copyright 2012-2014 the original author or authors. + * Copyright 2012-2015 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.spring.initializr.support +package io.spring.initializr.test import io.spring.initializr.InitializrMetadata import io.spring.initializr.ProjectRequest diff --git a/initializr/src/test/groovy/io/spring/initializr/support/ProjectAssert.groovy b/initializr/src/test/groovy/io/spring/initializr/test/ProjectAssert.groovy similarity index 97% rename from initializr/src/test/groovy/io/spring/initializr/support/ProjectAssert.groovy rename to initializr/src/test/groovy/io/spring/initializr/test/ProjectAssert.groovy index 6c33b43f..b0de0d5b 100644 --- a/initializr/src/test/groovy/io/spring/initializr/support/ProjectAssert.groovy +++ b/initializr/src/test/groovy/io/spring/initializr/test/ProjectAssert.groovy @@ -1,5 +1,5 @@ /* - * Copyright 2012-2014 the original author or authors. + * Copyright 2012-2015 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.spring.initializr.support +package io.spring.initializr.test import io.spring.initializr.InitializrMetadata diff --git a/initializr/src/test/groovy/io/spring/initializr/support/TestCounterService.groovy b/initializr/src/test/groovy/io/spring/initializr/test/TestCounterService.groovy similarity index 93% rename from initializr/src/test/groovy/io/spring/initializr/support/TestCounterService.groovy rename to initializr/src/test/groovy/io/spring/initializr/test/TestCounterService.groovy index 9e1fc74e..7168bd49 100644 --- a/initializr/src/test/groovy/io/spring/initializr/support/TestCounterService.groovy +++ b/initializr/src/test/groovy/io/spring/initializr/test/TestCounterService.groovy @@ -1,5 +1,5 @@ /* - * Copyright 2012-2014 the original author or authors. + * Copyright 2012-2015 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.spring.initializr.support +package io.spring.initializr.test import org.springframework.boot.actuate.metrics.CounterService diff --git a/initializr/src/test/groovy/io/spring/initializr/web/AbstractInitializerControllerFormIntegrationTests.groovy b/initializr/src/test/groovy/io/spring/initializr/web/AbstractInitializerControllerFormIntegrationTests.groovy index 9434dd98..8ab10e8a 100644 --- a/initializr/src/test/groovy/io/spring/initializr/web/AbstractInitializerControllerFormIntegrationTests.groovy +++ b/initializr/src/test/groovy/io/spring/initializr/web/AbstractInitializerControllerFormIntegrationTests.groovy @@ -1,5 +1,5 @@ /* - * Copyright 2012-2014 the original author or authors. + * Copyright 2012-2015 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,8 +20,8 @@ import com.gargoylesoftware.htmlunit.WebClient import com.gargoylesoftware.htmlunit.WebRequest import com.gargoylesoftware.htmlunit.WebResponse import com.gargoylesoftware.htmlunit.html.HtmlPage -import io.spring.initializr.support.PomAssert -import io.spring.initializr.support.ProjectAssert +import io.spring.initializr.test.PomAssert +import io.spring.initializr.test.ProjectAssert import io.spring.initializr.web.support.HomePage import org.junit.After import org.junit.Before diff --git a/initializr/src/test/groovy/io/spring/initializr/web/AbstractInitializrControllerIntegrationTests.groovy b/initializr/src/test/groovy/io/spring/initializr/web/AbstractInitializrControllerIntegrationTests.groovy index dae97a8d..1f3ef128 100644 --- a/initializr/src/test/groovy/io/spring/initializr/web/AbstractInitializrControllerIntegrationTests.groovy +++ b/initializr/src/test/groovy/io/spring/initializr/web/AbstractInitializrControllerIntegrationTests.groovy @@ -1,5 +1,5 @@ /* - * Copyright 2012-2014 the original author or authors. + * Copyright 2012-2015 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,7 +19,7 @@ package io.spring.initializr.web import io.spring.initializr.DefaultInitializrMetadataProvider import io.spring.initializr.InitializrMetadata import io.spring.initializr.InitializrMetadataProvider -import io.spring.initializr.support.ProjectAssert +import io.spring.initializr.test.ProjectAssert import org.junit.Rule import org.junit.rules.TemporaryFolder import org.junit.runner.RunWith diff --git a/initializr/src/test/groovy/io/spring/initializr/web/MainControllerDefaultsIntegrationTests.groovy b/initializr/src/test/groovy/io/spring/initializr/web/MainControllerDefaultsIntegrationTests.groovy index 53692153..41eb28f0 100644 --- a/initializr/src/test/groovy/io/spring/initializr/web/MainControllerDefaultsIntegrationTests.groovy +++ b/initializr/src/test/groovy/io/spring/initializr/web/MainControllerDefaultsIntegrationTests.groovy @@ -1,6 +1,22 @@ +/* + * Copyright 2012-2015 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package io.spring.initializr.web -import io.spring.initializr.support.PomAssert +import io.spring.initializr.test.PomAssert import org.junit.Test import org.springframework.test.context.ActiveProfiles diff --git a/initializr/src/test/groovy/io/spring/initializr/web/MainControllerIntegrationTests.groovy b/initializr/src/test/groovy/io/spring/initializr/web/MainControllerIntegrationTests.groovy index acbadaae..df4c1a21 100644 --- a/initializr/src/test/groovy/io/spring/initializr/web/MainControllerIntegrationTests.groovy +++ b/initializr/src/test/groovy/io/spring/initializr/web/MainControllerIntegrationTests.groovy @@ -1,5 +1,5 @@ /* - * Copyright 2012-2014 the original author or authors. + * Copyright 2012-2015 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,7 +19,7 @@ package io.spring.initializr.web import java.nio.charset.Charset import groovy.json.JsonSlurper -import io.spring.initializr.support.ProjectAssert +import io.spring.initializr.test.ProjectAssert import org.json.JSONObject import org.junit.Test import org.skyscreamer.jsonassert.JSONAssert