Skip to content
This repository has been archived by the owner on May 11, 2021. It is now read-only.

Commit

Permalink
[#51] Make Tomcat port in integration test random
Browse files Browse the repository at this point in the history
Acceptance GUI tests with Geb is a separate thing #52.
  • Loading branch information
Marcin Zajaczkowski committed Feb 25, 2015
1 parent 28570e7 commit 96fd81b
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 32 deletions.
Original file line number Diff line number Diff line change
@@ -1,19 +1,10 @@
package com.ofg.twitter.geb

import com.ofg.twitter.geb.pages.SwaggerUIHomePage
import com.ofg.twitter.Application
import geb.spock.GebSpec
import org.springframework.boot.test.IntegrationTest
import org.springframework.boot.test.SpringApplicationContextLoader
import org.springframework.test.context.ContextConfiguration
import org.springframework.test.context.web.WebAppConfiguration
import spock.lang.Stepwise

@ContextConfiguration(loader = SpringApplicationContextLoader.class, classes = Application)
@WebAppConfiguration
@IntegrationTest("spring.profiles.active:dev,stubrunner.skip-local-repo:true")
@Stepwise
class AcceptanceSwaggerUISpec extends GebSpec {
class AcceptanceSwaggerUISpec extends BaseBootGebSpec {

def "SwaggerUI home page should be visible"() {
when:
Expand Down
14 changes: 14 additions & 0 deletions src/test/groovy/com/ofg/twitter/geb/BaseBootGebSpec.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.ofg.twitter.geb

import com.ofg.twitter.Application
import geb.spock.GebSpec
import org.springframework.boot.test.IntegrationTest
import org.springframework.boot.test.SpringApplicationContextLoader
import org.springframework.test.context.ContextConfiguration
import org.springframework.test.context.web.WebAppConfiguration

@ContextConfiguration(loader = SpringApplicationContextLoader.class, classes = Application)
@WebAppConfiguration
@IntegrationTest("spring.profiles.active:dev")
abstract class BaseBootGebSpec extends GebSpec {
}
11 changes: 1 addition & 10 deletions src/test/groovy/com/ofg/twitter/geb/HealthEndpointUISpec.groovy
Original file line number Diff line number Diff line change
@@ -1,21 +1,12 @@
package com.ofg.twitter.geb

import com.ofg.twitter.geb.pages.SwaggerUIHomePage
import com.ofg.twitter.Application
import geb.spock.GebSpec
import org.springframework.boot.test.IntegrationTest
import org.springframework.boot.test.SpringApplicationContextLoader
import org.springframework.test.context.ContextConfiguration
import org.springframework.test.context.web.WebAppConfiguration
import spock.lang.Stepwise
import spock.lang.Unroll

@ContextConfiguration(loader = SpringApplicationContextLoader.class, classes = Application)
@WebAppConfiguration
@IntegrationTest("spring.profiles.active:dev,stubrunner.skip-local-repo:true")
@Stepwise
@Unroll
class HealthEndpointUISpec extends GebSpec {
class HealthEndpointUISpec extends BaseBootGebSpec {

def "Setup step"() {
when:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,11 @@
package com.ofg.twitter.geb

import com.ofg.twitter.Application
import com.ofg.twitter.geb.pages.SwaggerUIHomePage
import geb.spock.GebSpec
import groovy.json.JsonSlurper
import org.springframework.boot.test.IntegrationTest
import org.springframework.boot.test.SpringApplicationContextLoader
import org.springframework.test.context.ContextConfiguration
import org.springframework.test.context.web.WebAppConfiguration
import spock.lang.Stepwise

@ContextConfiguration(loader = SpringApplicationContextLoader.class, classes = Application)
@WebAppConfiguration
@IntegrationTest("spring.profiles.active:dev,stubrunner.skip-local-repo:true")
@Stepwise
class MicroserviceControllerUISpec extends GebSpec {
class MicroserviceControllerUISpec extends BaseBootGebSpec {

def "Microservice controller is visible on Swagger Page"() {
when:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import com.ofg.twitter.place.extractor.ColleratorClient
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.test.IntegrationTest

@IntegrationTest("stubrunner.use-microservice-definitions:true")
@IntegrationTest(["stubrunner.use-microservice-definitions:true", "server.port=0", "management.port=0"])
class DependencyFromServiceSpec extends MicroserviceMvcWiremockSpec {

@Autowired
Expand All @@ -18,4 +18,4 @@ class DependencyFromServiceSpec extends MicroserviceMvcWiremockSpec {
noExceptionThrown()

}
}
}

0 comments on commit 96fd81b

Please sign in to comment.