Permalink
Browse files

added check for POST:/config/scoring.project in CatWatch

  • Loading branch information...
arcuri82 committed Nov 5, 2018
1 parent c3e3fd1 commit db2ddcca434d6c1e7b8418ed2e0f050d98e3e269
@@ -2,11 +2,14 @@ package org.evomaster.core.problem.rest.service
import io.swagger.parser.SwaggerParser
import org.evomaster.core.problem.rest.HttpVerb
import org.evomaster.core.problem.rest.RestAction
import org.evomaster.core.problem.rest.RestActionBuilder
import org.evomaster.core.problem.rest.RestCallAction
import org.evomaster.core.problem.rest.param.FormParam
import org.evomaster.core.search.Action
import org.junit.jupiter.api.Assertions.assertEquals
import org.evomaster.core.search.gene.OptionalGene
import org.evomaster.core.search.gene.StringGene
import org.junit.jupiter.api.Assertions.*
import org.junit.jupiter.api.Disabled
import org.junit.jupiter.api.Test
@@ -33,7 +36,14 @@ internal class RestActionBuilderTest {
@Test
fun testCatWatch() {
loadAndAssertActions("/swagger/catwatch.json", 23)
val map = loadAndAssertActions("/swagger/catwatch.json", 23)
val postScoring = map["POST:/config/scoring.project"] as RestAction
assertEquals(2, postScoring.seeGenes().size)
val bodyPostScoring = postScoring.seeGenes().find { it.name == "body" }
assertNotNull(bodyPostScoring)
assertTrue(bodyPostScoring is OptionalGene)
assertTrue((bodyPostScoring as OptionalGene).gene is StringGene)
}
@Test

0 comments on commit db2ddcc

Please sign in to comment.