Added more checks in tests.

This commit is contained in:
Olga Maciaszek-Sharma
2016-02-23 21:40:19 +01:00
parent 8f61701d7d
commit 9fa51611a1
3 changed files with 28 additions and 3 deletions

View File

@@ -20,7 +20,8 @@ class SingleTestGeneratorSpec extends Specification {
static List<String> jUnitClassStrings = ['package test;', 'import com.jayway.jsonpath.DocumentContext;', 'import com.jayway.jsonpath.JsonPath;',
'import org.junit.FixMethodOrder;', 'import org.junit.Ignore;', 'import org.junit.Test;', 'import org.junit.runners.MethodSorters;',
'import static com.blogspot.toomuchcoding.jsonassert.JsonAssertion.assertThatJson;', 'import static com.jayway.restassured.module.mockmvc.RestAssuredMockMvc.*;',
'@FixMethodOrder(MethodSorters.NAME_ASCENDING)', '@Test', '@Ignore']
'@FixMethodOrder(MethodSorters.NAME_ASCENDING)', '@Test', '@Ignore', 'mport com.jayway.restassured.module.mockmvc.specification.MockMvcRequestSpecification;',
'import com.jayway.restassured.response.ResponseOptions;', 'import static org.assertj.core.api.Assertions.assertThat;']
static List<String> spockClassStrings = ['package test', 'import com.jayway.jsonpath.DocumentContext', 'import com.jayway.jsonpath.JsonPath',
'import spock.lang.Ignore', 'import spock.lang.Specification', 'import spock.lang.Stepwise',

View File

@@ -4,18 +4,26 @@ import nebula.test.IntegrationSpec
import spock.lang.Stepwise
@Stepwise
class ScenarioProjectSpec extends IntegrationSpec {
class ScenarioProjectSpec extends AccurestIntegrationSpec {
void setup() {
copyResources("functionalTest/scenarioProject", "")
runTasksSuccessfully('clean') //delete accidental output when previously importing SimpleBoot into Idea to tweak it
}
def "should pass basic flow"() {
def "should pass basic flow for Spock"() {
given:
assert fileExists('build.gradle')
expect:
runTasksSuccessfully('check')
}
def "should pass basic flow for JUnit"() {
given:
assert fileExists('build.gradle')
expect:
switchToJunitTestFramework()
runTasksSuccessfully('check')
}
}

View File

@@ -0,0 +1,16 @@
package com.blogspot.toomuchcoding;
import com.jayway.restassured.module.mockmvc.RestAssuredMockMvc;
import org.junit.Before;
public class MvcTest {
@Before
public void setup() {
RestAssuredMockMvc.standaloneSetup(new com.blogspot.toomuchcoding.frauddetection.FraudDetectionController());
}
public void assertThatRejectionReasonIsNull(Object rejectionReason) {
assert rejectionReason == null;
}
}