problem: Kotlin class mocking randomly fails
solution: upgrade testing libs, and open the class
This commit is contained in:
@@ -107,12 +107,11 @@ dependencies {
|
||||
|
||||
|
||||
testCompile "org.codehaus.groovy:groovy:$groovyVersion"
|
||||
testCompile 'cglib:cglib-nodep:3.2.12'
|
||||
testCompile 'cglib:cglib-nodep:3.3.0'
|
||||
testCompile "org.spockframework:spock-core:$spockVersion"
|
||||
testCompile 'de.jodamob.kotlin:kotlin-runner-spock:0.3.1'
|
||||
testCompile "io.grpc:grpc-testing:${grpcVersion}"
|
||||
testCompile "io.projectreactor:reactor-test:$reactorVersion"
|
||||
testCompile 'org.objenesis:objenesis:3.0.1'
|
||||
testCompile 'org.objenesis:objenesis:3.1'
|
||||
testCompile 'org.mock-server:mockserver-netty:5.10'
|
||||
}
|
||||
|
||||
|
||||
@@ -18,5 +18,5 @@ reactorVersion=3.3.3.RELEASE
|
||||
etherjarVersion=0.9.1
|
||||
|
||||
# Testing
|
||||
spockVersion=1.2-groovy-2.5
|
||||
spockVersion=1.3-groovy-2.5
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ import reactor.netty.http.client.HttpClient
|
||||
import java.util.*
|
||||
import java.util.function.Consumer
|
||||
|
||||
class BitcoinRpcClient(
|
||||
open class BitcoinRpcClient(
|
||||
private val target: String,
|
||||
basicAuth: AuthConfig.ClientBasicAuth?
|
||||
) {
|
||||
|
||||
@@ -1,22 +1,14 @@
|
||||
package io.emeraldpay.dshackle.upstream.bitcoin
|
||||
|
||||
import de.jodamob.kotlin.testrunner.OpenedClasses
|
||||
import de.jodamob.kotlin.testrunner.SpotlinTestRunner
|
||||
import io.emeraldpay.dshackle.test.TestingCommons
|
||||
import org.junit.runner.RunWith
|
||||
import org.mockserver.integration.ClientAndServer
|
||||
import reactor.core.publisher.Mono
|
||||
import reactor.test.StepVerifier
|
||||
import spock.lang.Specification
|
||||
|
||||
import java.time.Duration
|
||||
|
||||
@RunWith(SpotlinTestRunner)
|
||||
@OpenedClasses(BitcoinApi)
|
||||
class BitcoinRpcHeadSpec extends Specification {
|
||||
|
||||
ClientAndServer mockServer
|
||||
|
||||
def "Follow 2 blocks created over 3 requests"() {
|
||||
setup:
|
||||
String hash1 = "0000000000000000000cf5a5d4dfc4347c0c1a863ec5fdb429b02b2162e50001"
|
||||
|
||||
Reference in New Issue
Block a user