Skip to content

Commit

Permalink
[branch sc46794] Upgrade to Spock 2 (#47)
Browse files Browse the repository at this point in the history
* Upgraded to Spock 2

* Upgraded to Spock 2

* Upgraded to Spock 2

* Upgraded to Spock 2

* migrated to JUnit 5

* fixed java tests in examples
  • Loading branch information
musketyr committed Nov 10, 2021
1 parent d2ae210 commit ac0d2cc
Show file tree
Hide file tree
Showing 9 changed files with 68 additions and 63 deletions.
4 changes: 4 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,10 @@ projects {
force = true
}
}

tasks.withType(Test) {
useJUnitPlatform()
}
}

dir ('examples') {
Expand Down
6 changes: 6 additions & 0 deletions examples/heist-spring-boot/heist-spring-boot.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,15 @@ dependencies {
implementation 'org.codehaus.groovy:groovy'

testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.1.0'
testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.1.0'

testCompile(project(':gru-spring'))
testCompile(project(':gru-http'))
testCompile("org.spockframework:spock-spring:$spockVersion")
testCompile("org.spockframework:spock-core:$spockVersion")
}

test {
useJUnitPlatform()
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,10 @@
*/
package com.agorapulse.gru.spring.heist

import org.junit.Test
import org.junit.runner.RunWith
import org.junit.jupiter.api.Test
import org.springframework.boot.test.context.SpringBootTest
import org.springframework.test.context.junit4.SpringRunner

@RunWith(SpringRunner)
// @RunWith(SpringRunner)
@SpringBootTest
class HeistApplicationTests {

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ groovyVersion=2.5.14
okHttpVersion=3.14.9
grailsTestingSupportVersion=2.1.3
jodaTimeVersion=2.9.9
spockVersion=1.3-groovy-2.5
spockVersion=2.0-groovy-2.5
jsonUnitVersion=2.25.0
xmlUnitVersion=2.8.2
jsoupVersion=1.13.1
Expand Down
1 change: 1 addition & 0 deletions libs/gru/gru.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,5 @@ dependencies {
testImplementation "joda-time:joda-time:${jodaTimeVersion}"
testImplementation 'com.fasterxml.jackson.core:jackson-databind:2.9.6'
testImplementation 'org.assertj:assertj-core:3.11.0'
testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.1.0'
}
3 changes: 0 additions & 3 deletions libs/gru/src/test/groovy/com/agorapulse/gru/GruSpec.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
*/
package com.agorapulse.gru

import org.junit.runner.Description
import org.junit.runners.model.Statement
import spock.lang.Specification

/**
Expand All @@ -29,7 +27,6 @@ class GruSpec extends Specification {
@SuppressWarnings('UnnecessaryGetter')
void 'expectations are verified'() {
given:
Description description = Description.createTestDescription(GruSpec, 'test is verified')
Client.Request request = Mock(Client.Request)
Client client = Mock(Client) {
getInitialSquad() >> []
Expand Down

0 comments on commit ac0d2cc

Please sign in to comment.