Fix tests
This commit is contained in:
@@ -1,13 +1,14 @@
|
||||
apply plugin: 'org.flywaydb.flyway'
|
||||
|
||||
dependencies {
|
||||
testCompile project(':dbt-core')
|
||||
compile project(':dbt-core')
|
||||
|
||||
testCompile ratpack.dependency('h2')
|
||||
testCompile ratpack.dependency('jdbc-tx')
|
||||
runtime ratpack.dependency('handlebars')
|
||||
runtime ratpack.dependency('h2')
|
||||
runtime ratpack.dependency('jdbc-tx')
|
||||
|
||||
testCompile 'org.flywaydb:flyway-core:5.0.7'
|
||||
testRuntime 'org.slf4j:slf4j-simple:1.7.25'
|
||||
compile 'org.flywaydb:flyway-core:5.0.7'
|
||||
runtime 'org.slf4j:slf4j-simple:1.7.25'
|
||||
|
||||
testCompile ratpack.dependency('test')
|
||||
testCompile 'org.spockframework:spock-core:1.0-groovy-2.4'
|
||||
|
||||
@@ -18,8 +18,6 @@ ratpack {
|
||||
|
||||
bindings {
|
||||
|
||||
module SessionModule
|
||||
|
||||
module (DBTModule) {
|
||||
it.ledger.remoteUrl = 'http://localhost:8888/ledger'
|
||||
it.executor.remoteUrl = 'http://localhost:8888/executor'
|
||||
|
||||
@@ -18,7 +18,7 @@ class ExecutorSpec extends Specification {
|
||||
setup:
|
||||
def transaction = new BlockTransaction()
|
||||
transaction.execute("SELECT * FROM LOGS")
|
||||
transaction.end()
|
||||
transaction.commit()
|
||||
when:
|
||||
String json = aut.httpClient.requestSpec{ spec ->
|
||||
spec.body.text(mapper.writeValueAsString(transaction))
|
||||
|
||||
@@ -3,15 +3,8 @@ package com.devsoap.dbt
|
||||
import com.devsoap.dbt.data.BlockTransaction
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper
|
||||
import groovy.json.JsonSlurper
|
||||
import ratpack.groovy.test.GroovyRatpackMainApplicationUnderTest
|
||||
import ratpack.impose.Imposition
|
||||
import ratpack.impose.Impositions
|
||||
import ratpack.impose.ImpositionsSpec
|
||||
import ratpack.impose.ServerConfigImposition
|
||||
import ratpack.server.RatpackServer
|
||||
import spock.lang.AutoCleanup
|
||||
import spock.lang.Shared
|
||||
import spock.lang.Specification
|
||||
|
||||
class LedgerSpec extends Specification {
|
||||
@@ -41,7 +34,7 @@ class LedgerSpec extends Specification {
|
||||
setup:
|
||||
def transaction = new BlockTransaction()
|
||||
transaction.execute("SELECT * FROM LOGS")
|
||||
transaction.end()
|
||||
transaction.commit()
|
||||
when:
|
||||
String json = aut.httpClient.requestSpec{ spec ->
|
||||
spec.body.text(mapper.writeValueAsString(transaction))
|
||||
@@ -56,7 +49,7 @@ class LedgerSpec extends Specification {
|
||||
setup:
|
||||
def transaction = new BlockTransaction()
|
||||
transaction.execute("SELECT * FROM LOGS")
|
||||
transaction.end()
|
||||
transaction.commit()
|
||||
when:
|
||||
def response = mapper.readValue(aut.httpClient.requestSpec { spec ->
|
||||
spec.body.text(mapper.writeValueAsString(transaction))
|
||||
@@ -73,7 +66,7 @@ class LedgerSpec extends Specification {
|
||||
def transaction = new BlockTransaction()
|
||||
transaction.execute("INSERT INTO LOGS(LOG_ID,LOG_VALUE) VALUES (1, 'HELLO')")
|
||||
transaction.execute("SELECT * FROM LOGS")
|
||||
transaction.end()
|
||||
transaction.commit()
|
||||
when:
|
||||
String json = aut.httpClient.requestSpec{ spec ->
|
||||
spec.body.text(mapper.writeValueAsString(transaction))
|
||||
|
||||
Reference in New Issue
Block a user