Skip to content

Commit

Permalink
fixed condition and failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
arcuri82 committed Jun 1, 2017
1 parent 311332f commit f13ea40
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -226,10 +226,10 @@ class RestActionBuilder {
*/

if(! parameter?.getEnum()?.isEmpty()!! && type == "string") {
if(type == "string" && ! (parameter?.getEnum()?.isEmpty() ?: true) ) {
//TODO enum can be for any type, not just strings
//Besides the defined values, add one to test robustness
return EnumGene(name, parameter.getEnum().apply { add("EVOMASTER") })
return EnumGene(name, parameter!!.getEnum().apply { add("EVOMASTER") })
}

//first check for "optional" format
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import org.evomaster.clientJava.controllerApi.dto.SutInfoDto;
import org.junit.jupiter.api.Test;

import static io.restassured.RestAssured.baseURI;
import static io.restassured.RestAssured.given;
import static org.hamcrest.core.Is.is;
import static org.junit.jupiter.api.Assertions.assertEquals;
Expand All @@ -33,7 +32,7 @@ public void testSwaggerJSON() {
}

@Test
public void testEqualsFoo(){
public void testEqualsFoo() {

given().accept(ContentType.JSON)
.get(baseUrlOfSut + "/api/strings/equalsFoo/bar")
Expand All @@ -49,7 +48,7 @@ public void testEqualsFoo(){
}

@Test
public void testStartEnds(){
public void testStartEnds() {

given().accept(ContentType.JSON)
.get(baseUrlOfSut + "/api/strings/startEnds/foo")
Expand All @@ -70,14 +69,13 @@ public void testStartEnds(){
.body("valid", is(false));

given().accept(ContentType.JSON)
.get(baseUrlOfSut + "/api/strings/startEnds/foobar")
.get(baseUrlOfSut + "/api/strings/startEnds/X12Y")
.then()
.statusCode(200)
.body("valid", is(true));
}



@Test
public void testContains() {

Expand Down

0 comments on commit f13ea40

Please sign in to comment.