diff --git a/core-tests/e2e-tests/spring/spring-rest-bb/src/test/kotlin/org/evomaster/e2etests/spring/rest/bb/headerassertions/BBHeaderAssertionsEMTest.kt b/core-tests/e2e-tests/spring/spring-rest-bb/src/test/kotlin/org/evomaster/e2etests/spring/rest/bb/headerassertions/BBHeaderAssertionsEMTest.kt index 0b96483a1c..73307fc04f 100644 --- a/core-tests/e2e-tests/spring/spring-rest-bb/src/test/kotlin/org/evomaster/e2etests/spring/rest/bb/headerassertions/BBHeaderAssertionsEMTest.kt +++ b/core-tests/e2e-tests/spring/spring-rest-bb/src/test/kotlin/org/evomaster/e2etests/spring/rest/bb/headerassertions/BBHeaderAssertionsEMTest.kt @@ -1,6 +1,7 @@ package org.evomaster.e2etests.spring.rest.bb.headerassertions import com.foo.rest.examples.bb.headerassertions.BBHeaderAssertionsController +import com.webfuzzing.commons.faults.DefinedFaultCategory import org.evomaster.core.output.OutputFormat import org.evomaster.core.problem.enterprise.DetectedFaultUtils import org.evomaster.core.problem.enterprise.ExperimentalFaultCategory @@ -60,24 +61,24 @@ class BBHeaderAssertionsEMTest : SpringTestBase() { assertTrue(faults.none{ it.operationId == "GET:$prefix/ok/401" - && it.category == ExperimentalFaultCategory.HTTP_STATUS_NO_401_IF_NO_WWW_AUTHENTICATE }) + && it.category == DefinedFaultCategory.HTTP_STATUS_NO_401_IF_NO_WWW_AUTHENTICATE }) assertTrue(faults.any{ it.operationId == "GET:$prefix/fail/401" - && it.category == ExperimentalFaultCategory.HTTP_STATUS_NO_401_IF_NO_WWW_AUTHENTICATE }) + && it.category == DefinedFaultCategory.HTTP_STATUS_NO_401_IF_NO_WWW_AUTHENTICATE }) assertTrue(faults.none{ it.operationId == "GET:$prefix/ok/405" - && it.category == ExperimentalFaultCategory.HTTP_STATUS_NO_405_IF_NO_ALLOW }) + && it.category == DefinedFaultCategory.HTTP_STATUS_NO_405_IF_NO_ALLOW }) assertTrue(faults.any{ it.operationId == "GET:$prefix/fail/405" - && it.category == ExperimentalFaultCategory.HTTP_STATUS_NO_405_IF_NO_ALLOW }) + && it.category == DefinedFaultCategory.HTTP_STATUS_NO_405_IF_NO_ALLOW }) assertTrue(faults.none{ it.operationId == "GET:$prefix/ok/426" - && it.category == ExperimentalFaultCategory.HTTP_STATUS_NO_426_IF_NO_UPGRADE }) + && it.category == DefinedFaultCategory.HTTP_STATUS_NO_426_IF_NO_UPGRADE }) assertTrue(faults.any{ it.operationId == "GET:$prefix/fail/426" - && it.category == ExperimentalFaultCategory.HTTP_STATUS_NO_426_IF_NO_UPGRADE }) + && it.category == DefinedFaultCategory.HTTP_STATUS_NO_426_IF_NO_UPGRADE }) } } } diff --git a/core-tests/e2e-tests/spring/spring-rest-bb/src/test/kotlin/org/evomaster/e2etests/spring/rest/bb/sqli/BBSQLiEMTest.kt b/core-tests/e2e-tests/spring/spring-rest-bb/src/test/kotlin/org/evomaster/e2etests/spring/rest/bb/sqli/BBSQLiEMTest.kt index a528e5fd94..81ad2744e8 100644 --- a/core-tests/e2e-tests/spring/spring-rest-bb/src/test/kotlin/org/evomaster/e2etests/spring/rest/bb/sqli/BBSQLiEMTest.kt +++ b/core-tests/e2e-tests/spring/spring-rest-bb/src/test/kotlin/org/evomaster/e2etests/spring/rest/bb/sqli/BBSQLiEMTest.kt @@ -47,7 +47,7 @@ class BBSQLiEMTest : SpringTestBase() { val faultCategories = DetectedFaultUtils.getDetectedFaultCategories(solution) assertTrue(solution.individuals.size >= 1) - assertTrue({ DefinedFaultCategory.SQL_INJECTION in faultCategories }) + assertTrue({ DefinedFaultCategory.SECURITY_SQL_INJECTION in faultCategories }) } } } diff --git a/core-tests/e2e-tests/spring/spring-rest-mysql/src/test/kotlin/org/evomaster/e2etests/spring/rest/sqli/SQLiMySQLBodyEMTest.kt b/core-tests/e2e-tests/spring/spring-rest-mysql/src/test/kotlin/org/evomaster/e2etests/spring/rest/sqli/SQLiMySQLBodyEMTest.kt index 51a62acda6..de4739a9be 100644 --- a/core-tests/e2e-tests/spring/spring-rest-mysql/src/test/kotlin/org/evomaster/e2etests/spring/rest/sqli/SQLiMySQLBodyEMTest.kt +++ b/core-tests/e2e-tests/spring/spring-rest-mysql/src/test/kotlin/org/evomaster/e2etests/spring/rest/sqli/SQLiMySQLBodyEMTest.kt @@ -40,15 +40,15 @@ class SQLiMySQLBodyEMTest : SpringTestBase() { val faultCategories = DetectedFaultUtils.getDetectedFaultCategories(solution) - assertTrue({ DefinedFaultCategory.SQL_INJECTION in faultCategories }) + assertTrue({ DefinedFaultCategory.SECURITY_SQL_INJECTION in faultCategories }) assertTrue(faults.any { - it.category == DefinedFaultCategory.SQL_INJECTION + it.category == DefinedFaultCategory.SECURITY_SQL_INJECTION && it.operationId == "POST:/api/sqli/body/vulnerable" }) assertFalse(faults.any { - it.category == DefinedFaultCategory.SQL_INJECTION + it.category == DefinedFaultCategory.SECURITY_SQL_INJECTION && it.operationId == "GET:/api/sqli/body/safe" }) diff --git a/core-tests/e2e-tests/spring/spring-rest-mysql/src/test/kotlin/org/evomaster/e2etests/spring/rest/sqli/SQLiMySQLPathEMTest.kt b/core-tests/e2e-tests/spring/spring-rest-mysql/src/test/kotlin/org/evomaster/e2etests/spring/rest/sqli/SQLiMySQLPathEMTest.kt index 806f631807..86e140e91d 100644 --- a/core-tests/e2e-tests/spring/spring-rest-mysql/src/test/kotlin/org/evomaster/e2etests/spring/rest/sqli/SQLiMySQLPathEMTest.kt +++ b/core-tests/e2e-tests/spring/spring-rest-mysql/src/test/kotlin/org/evomaster/e2etests/spring/rest/sqli/SQLiMySQLPathEMTest.kt @@ -36,15 +36,15 @@ class SQLiMySQLPathEMTest : SpringTestBase() { val faultCategories = DetectedFaultUtils.getDetectedFaultCategories(solution) - assertTrue({ DefinedFaultCategory.SQL_INJECTION in faultCategories }) + assertTrue({ DefinedFaultCategory.SECURITY_SQL_INJECTION in faultCategories }) assertTrue(faults.any { - it.category == DefinedFaultCategory.SQL_INJECTION + it.category == DefinedFaultCategory.SECURITY_SQL_INJECTION && it.operationId == "GET:/api/sqli/path/vulnerable/{id}" }) assertFalse(faults.any { - it.category == DefinedFaultCategory.SQL_INJECTION + it.category == DefinedFaultCategory.SECURITY_SQL_INJECTION && it.operationId == "GET:/api/sqli/path/safe" }) diff --git a/core-tests/e2e-tests/spring/spring-rest-mysql/src/test/kotlin/org/evomaster/e2etests/spring/rest/sqli/SQLiMySQLQueryEMTest.kt b/core-tests/e2e-tests/spring/spring-rest-mysql/src/test/kotlin/org/evomaster/e2etests/spring/rest/sqli/SQLiMySQLQueryEMTest.kt index be34064f50..538b895040 100644 --- a/core-tests/e2e-tests/spring/spring-rest-mysql/src/test/kotlin/org/evomaster/e2etests/spring/rest/sqli/SQLiMySQLQueryEMTest.kt +++ b/core-tests/e2e-tests/spring/spring-rest-mysql/src/test/kotlin/org/evomaster/e2etests/spring/rest/sqli/SQLiMySQLQueryEMTest.kt @@ -38,15 +38,15 @@ class SQLiMySQLQueryEMTest : SpringTestBase() { val faultCategories = DetectedFaultUtils.getDetectedFaultCategories(solution) - assertTrue({ DefinedFaultCategory.SQL_INJECTION in faultCategories }) + assertTrue({ DefinedFaultCategory.SECURITY_SQL_INJECTION in faultCategories }) assertTrue(faults.any { - it.category == DefinedFaultCategory.SQL_INJECTION + it.category == DefinedFaultCategory.SECURITY_SQL_INJECTION && it.operationId == "GET:/api/sqli/query/vulnerable" }) assertFalse(faults.any { - it.category == DefinedFaultCategory.SQL_INJECTION + it.category == DefinedFaultCategory.SECURITY_SQL_INJECTION && it.operationId == "GET:/api/sqli/query/safe" }) diff --git a/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/delete/HttpOracleDeleteEMTest.kt b/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/delete/HttpOracleDeleteEMTest.kt index c122203cd8..fcac92a6c1 100644 --- a/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/delete/HttpOracleDeleteEMTest.kt +++ b/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/delete/HttpOracleDeleteEMTest.kt @@ -48,7 +48,7 @@ class HttpOracleDeleteEMTest : SpringTestBase(){ val faults = DetectedFaultUtils.getDetectedFaultCategories(solution) - assertTrue({ ExperimentalFaultCategory.HTTP_NONWORKING_DELETE in faults }) + assertTrue({ DefinedFaultCategory.HTTP_NONWORKING_DELETE in faults }) } } diff --git a/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/failmodification/FailModificationEMTest.kt b/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/failmodification/FailModificationEMTest.kt index a395cc8df2..20127b6b29 100644 --- a/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/failmodification/FailModificationEMTest.kt +++ b/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/failmodification/FailModificationEMTest.kt @@ -1,6 +1,7 @@ package org.evomaster.e2etests.spring.openapi.v3.httporacle.failmodification import com.foo.rest.examples.spring.openapi.v3.httporacle.failmodification.FailModificationController +import com.webfuzzing.commons.faults.DefinedFaultCategory import org.evomaster.core.problem.enterprise.DetectedFaultUtils import org.evomaster.core.problem.enterprise.ExperimentalFaultCategory import org.evomaster.core.problem.rest.data.HttpVerb @@ -39,7 +40,7 @@ class FailModificationEMTest : SpringTestBase(){ val faults = DetectedFaultUtils.getDetectedFaults(solution) - val found = faults.filter { it.category == ExperimentalFaultCategory.HTTP_SIDE_EFFECTS_FAILED_MODIFICATION} + val found = faults.filter { it.category == DefinedFaultCategory.HTTP_SIDE_EFFECTS_FAILED_MODIFICATION} assertEquals(2, found.size) } diff --git a/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/failmodification/FailModificationForbiddenEMTest.kt b/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/failmodification/FailModificationForbiddenEMTest.kt index 06bfc208db..480a8a7f1f 100644 --- a/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/failmodification/FailModificationForbiddenEMTest.kt +++ b/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/failmodification/FailModificationForbiddenEMTest.kt @@ -1,6 +1,7 @@ package org.evomaster.e2etests.spring.openapi.v3.httporacle.failmodification import com.foo.rest.examples.spring.openapi.v3.httporacle.failmodification.FailModificationForbiddenController +import com.webfuzzing.commons.faults.DefinedFaultCategory import org.evomaster.core.problem.enterprise.DetectedFaultUtils import org.evomaster.core.problem.enterprise.ExperimentalFaultCategory import org.evomaster.e2etests.spring.openapi.v3.SpringTestBase @@ -38,7 +39,7 @@ class FailModificationForbiddenEMTest : SpringTestBase(){ assertTrue(solution.individuals.size >= 1) val faults = DetectedFaultUtils.getDetectedFaults(solution) - .filter { it.category == ExperimentalFaultCategory.HTTP_SIDE_EFFECTS_FAILED_MODIFICATION} + .filter { it.category == DefinedFaultCategory.HTTP_SIDE_EFFECTS_FAILED_MODIFICATION} assertEquals(1, faults.size) } diff --git a/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/failmodification/FailModificationNotFoundEMTest.kt b/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/failmodification/FailModificationNotFoundEMTest.kt index 3d908ba5cd..598075fad5 100644 --- a/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/failmodification/FailModificationNotFoundEMTest.kt +++ b/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/failmodification/FailModificationNotFoundEMTest.kt @@ -2,6 +2,7 @@ package org.evomaster.e2etests.spring.openapi.v3.httporacle.failmodification import com.foo.rest.examples.spring.openapi.v3.httporacle.failmodification.FailModificationForbiddenController import com.foo.rest.examples.spring.openapi.v3.httporacle.failmodification.FailModificationNotFoundController +import com.webfuzzing.commons.faults.DefinedFaultCategory import org.evomaster.core.problem.enterprise.DetectedFaultUtils import org.evomaster.core.problem.enterprise.ExperimentalFaultCategory import org.evomaster.e2etests.spring.openapi.v3.SpringTestBase @@ -38,7 +39,7 @@ class FailModificationNotFoundEMTest : SpringTestBase(){ assertTrue(solution.individuals.size >= 1) val faultsCategories = DetectedFaultUtils.getDetectedFaultCategories(solution) - assertTrue(ExperimentalFaultCategory.HTTP_SIDE_EFFECTS_FAILED_MODIFICATION in faultsCategories) + assertTrue(DefinedFaultCategory.HTTP_SIDE_EFFECTS_FAILED_MODIFICATION in faultsCategories) } } } diff --git a/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/failmodification/URLEncodedFailModificationEMTest.kt b/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/failmodification/URLEncodedFailModificationEMTest.kt index b08f92c1b2..e6f5243015 100644 --- a/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/failmodification/URLEncodedFailModificationEMTest.kt +++ b/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/failmodification/URLEncodedFailModificationEMTest.kt @@ -1,6 +1,7 @@ package org.evomaster.e2etests.spring.openapi.v3.httporacle.failmodification import com.foo.rest.examples.spring.openapi.v3.httporacle.failmodification.FailModificationURLEncodedController +import com.webfuzzing.commons.faults.DefinedFaultCategory import org.evomaster.core.problem.enterprise.DetectedFaultUtils import org.evomaster.core.problem.enterprise.ExperimentalFaultCategory import org.evomaster.e2etests.spring.openapi.v3.SpringTestBase @@ -39,7 +40,7 @@ class URLEncodedFailModificationEMTest : SpringTestBase(){ val faults = DetectedFaultUtils.getDetectedFaults(solution) assertEquals(1, faults.size) - assertEquals(ExperimentalFaultCategory.HTTP_SIDE_EFFECTS_FAILED_MODIFICATION, faults.first().category) + assertEquals(DefinedFaultCategory.HTTP_SIDE_EFFECTS_FAILED_MODIFICATION, faults.first().category) } } } diff --git a/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/failmodification/XMLFailModificationEMTest.kt b/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/failmodification/XMLFailModificationEMTest.kt index e75935fe00..dd59fd6125 100644 --- a/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/failmodification/XMLFailModificationEMTest.kt +++ b/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/failmodification/XMLFailModificationEMTest.kt @@ -2,6 +2,7 @@ package org.evomaster.e2etests.spring.openapi.v3.httporacle.failmodification import com.foo.rest.examples.spring.openapi.v3.httporacle.failmodification.FailModificationController import com.foo.rest.examples.spring.openapi.v3.httporacle.failmodification.FailModificationXMLController +import com.webfuzzing.commons.faults.DefinedFaultCategory import org.evomaster.core.problem.enterprise.DetectedFaultUtils import org.evomaster.core.problem.enterprise.ExperimentalFaultCategory import org.evomaster.core.problem.rest.data.HttpVerb @@ -42,7 +43,7 @@ class XMLFailModificationEMTest : SpringTestBase(){ val faults = DetectedFaultUtils.getDetectedFaults(solution) assertEquals(2, faults.size) - assertEquals(ExperimentalFaultCategory.HTTP_SIDE_EFFECTS_FAILED_MODIFICATION, faults.first().category) + assertEquals(DefinedFaultCategory.HTTP_SIDE_EFFECTS_FAILED_MODIFICATION, faults.first().category) } } } diff --git a/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/invalidallow/HttpInvalidAllowAuthEMTest.kt b/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/invalidallow/HttpInvalidAllowAuthEMTest.kt index 2b9faeb1e3..883ac59556 100644 --- a/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/invalidallow/HttpInvalidAllowAuthEMTest.kt +++ b/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/invalidallow/HttpInvalidAllowAuthEMTest.kt @@ -1,6 +1,7 @@ package org.evomaster.e2etests.spring.openapi.v3.httporacle.invalidallow import com.foo.rest.examples.spring.openapi.v3.httporacle.invalidallow.auth.HttpInvalidAllowAuthController +import com.webfuzzing.commons.faults.DefinedFaultCategory import org.evomaster.core.problem.enterprise.DetectedFaultUtils import org.evomaster.core.problem.enterprise.ExperimentalFaultCategory import org.evomaster.e2etests.spring.openapi.v3.SpringTestBase @@ -39,10 +40,10 @@ class HttpInvalidAllowAuthEMTest : SpringTestBase() { // OPTIONS is 401 without auth: the fault is only found once the oracle // retries with an authenticated user and reads the 2xx Allow header. val faults = DetectedFaultUtils.getDetectedFaultCategories(solution) - assertTrue({ ExperimentalFaultCategory.HTTP_INVALID_ALLOW in faults }) + assertTrue({ DefinedFaultCategory.SCHEMA_INVALID_ALLOW in faults }) val allowFaults = DetectedFaultUtils.getDetectedFaults(solution) - .filter { it.category == ExperimentalFaultCategory.HTTP_INVALID_ALLOW } + .filter { it.category == DefinedFaultCategory.SCHEMA_INVALID_ALLOW } assertTrue(allowFaults.any { it.operationId.contains("/api/products/") }) assertTrue(allowFaults.none { it.operationId.contains("/api/orders/") }) diff --git a/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/invalidallow/HttpInvalidAllowEMTest.kt b/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/invalidallow/HttpInvalidAllowEMTest.kt index 87ed9d94f7..6de22cb514 100644 --- a/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/invalidallow/HttpInvalidAllowEMTest.kt +++ b/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/invalidallow/HttpInvalidAllowEMTest.kt @@ -1,6 +1,7 @@ package org.evomaster.e2etests.spring.openapi.v3.httporacle.invalidallow import com.foo.rest.examples.spring.openapi.v3.httporacle.invalidallow.HttpInvalidAllowController +import com.webfuzzing.commons.faults.DefinedFaultCategory import org.evomaster.core.problem.enterprise.DetectedFaultUtils import org.evomaster.core.problem.enterprise.ExperimentalFaultCategory import org.evomaster.e2etests.spring.openapi.v3.SpringTestBase @@ -37,10 +38,10 @@ class HttpInvalidAllowEMTest : SpringTestBase() { assertTrue(solution.individuals.size >= 1) val faults = DetectedFaultUtils.getDetectedFaultCategories(solution) - assertTrue({ ExperimentalFaultCategory.HTTP_INVALID_ALLOW in faults }) + assertTrue({ DefinedFaultCategory.SCHEMA_INVALID_ALLOW in faults }) val allowFaults = DetectedFaultUtils.getDetectedFaults(solution) - .filter { it.category == ExperimentalFaultCategory.HTTP_INVALID_ALLOW } + .filter { it.category == DefinedFaultCategory.SCHEMA_INVALID_ALLOW } assertTrue(allowFaults.any { it.operationId.contains("/api/products/") }) assertTrue(allowFaults.none { it.operationId.contains("/api/orders/") }) diff --git a/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/invalidallow/HttpMissingAllowEMTest.kt b/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/invalidallow/HttpMissingAllowEMTest.kt index b40f0e016a..a117c2bcdf 100644 --- a/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/invalidallow/HttpMissingAllowEMTest.kt +++ b/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/invalidallow/HttpMissingAllowEMTest.kt @@ -1,6 +1,7 @@ package org.evomaster.e2etests.spring.openapi.v3.httporacle.invalidallow import com.foo.rest.examples.spring.openapi.v3.httporacle.invalidallow.missing.HttpMissingAllowController +import com.webfuzzing.commons.faults.DefinedFaultCategory import org.evomaster.core.problem.enterprise.DetectedFaultUtils import org.evomaster.core.problem.enterprise.ExperimentalFaultCategory import org.evomaster.e2etests.spring.openapi.v3.SpringTestBase @@ -37,10 +38,10 @@ class HttpMissingAllowEMTest : SpringTestBase() { assertTrue(solution.individuals.size >= 1) val faults = DetectedFaultUtils.getDetectedFaultCategories(solution) - assertTrue(ExperimentalFaultCategory.HTTP_INVALID_ALLOW in faults) + assertTrue(DefinedFaultCategory.SCHEMA_INVALID_ALLOW in faults) val allowFaults = DetectedFaultUtils.getDetectedFaults(solution) - .filter { it.category == ExperimentalFaultCategory.HTTP_INVALID_ALLOW } + .filter { it.category == DefinedFaultCategory.SCHEMA_INVALID_ALLOW } assertTrue(allowFaults.any { it.operationId.contains("/api/products/") }) assertTrue(allowFaults.none { it.operationId.contains("/api/orders/") }) diff --git a/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/invalidlocation/HttpInvalidLocationDeleteOnlyEMTest.kt b/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/invalidlocation/HttpInvalidLocationDeleteOnlyEMTest.kt index ffaa8ba244..e157e025c8 100644 --- a/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/invalidlocation/HttpInvalidLocationDeleteOnlyEMTest.kt +++ b/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/invalidlocation/HttpInvalidLocationDeleteOnlyEMTest.kt @@ -1,6 +1,7 @@ package org.evomaster.e2etests.spring.openapi.v3.httporacle.invalidlocation import com.foo.rest.examples.spring.openapi.v3.httporacle.invalidlocation.deleteonly.HttpInvalidLocationDeleteOnlyController +import com.webfuzzing.commons.faults.DefinedFaultCategory import org.evomaster.core.problem.enterprise.DetectedFaultUtils import org.evomaster.core.problem.enterprise.ExperimentalFaultCategory import org.evomaster.e2etests.spring.openapi.v3.SpringTestBase @@ -39,10 +40,10 @@ class HttpInvalidLocationDeleteOnlyEMTest : SpringTestBase() { // The Location points to a resource declared only for DELETE (no GET), so a GET // would be 405. The oracle must probe with DELETE and flag the 404 it returns. val faults = DetectedFaultUtils.getDetectedFaultCategories(solution) - assertTrue(ExperimentalFaultCategory.HTTP_INVALID_LOCATION in faults) + assertTrue(DefinedFaultCategory.HTTP_INVALID_LOCATION in faults) val locationFaults = DetectedFaultUtils.getDetectedFaults(solution) - .filter { it.category == ExperimentalFaultCategory.HTTP_INVALID_LOCATION } + .filter { it.category == DefinedFaultCategory.HTTP_INVALID_LOCATION } assertTrue(locationFaults.any { it.operationId.contains("/api/products/") }) } } diff --git a/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/invalidlocation/HttpInvalidLocationEMTest.kt b/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/invalidlocation/HttpInvalidLocationEMTest.kt index c021f85d61..456d23d20f 100644 --- a/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/invalidlocation/HttpInvalidLocationEMTest.kt +++ b/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/invalidlocation/HttpInvalidLocationEMTest.kt @@ -1,6 +1,7 @@ package org.evomaster.e2etests.spring.openapi.v3.httporacle.invalidlocation import com.foo.rest.examples.spring.openapi.v3.httporacle.invalidlocation.HttpInvalidLocationController +import com.webfuzzing.commons.faults.DefinedFaultCategory import org.evomaster.core.problem.enterprise.DetectedFaultUtils import org.evomaster.core.problem.enterprise.ExperimentalFaultCategory import org.evomaster.e2etests.spring.openapi.v3.SpringTestBase @@ -38,7 +39,7 @@ class HttpInvalidLocationEMTest : SpringTestBase(){ assertTrue(solution.individuals.size >= 1) val faults = DetectedFaultUtils.getDetectedFaultCategories(solution) - assertTrue({ ExperimentalFaultCategory.HTTP_INVALID_LOCATION in faults }) + assertTrue({ DefinedFaultCategory.HTTP_INVALID_LOCATION in faults }) } } } diff --git a/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/invalidlocation/HttpInvalidLocationFullPathEMTest.kt b/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/invalidlocation/HttpInvalidLocationFullPathEMTest.kt index 0af2da58c9..633ee0ea32 100644 --- a/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/invalidlocation/HttpInvalidLocationFullPathEMTest.kt +++ b/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/invalidlocation/HttpInvalidLocationFullPathEMTest.kt @@ -1,6 +1,7 @@ package org.evomaster.e2etests.spring.openapi.v3.httporacle.invalidlocation import com.foo.rest.examples.spring.openapi.v3.httporacle.invalidlocation.fullpath.HttpInvalidLocationFullPathController +import com.webfuzzing.commons.faults.DefinedFaultCategory import org.evomaster.core.problem.enterprise.DetectedFaultUtils import org.evomaster.core.problem.enterprise.ExperimentalFaultCategory import org.evomaster.e2etests.spring.openapi.v3.SpringTestBase @@ -37,7 +38,7 @@ class HttpInvalidLocationFullPathEMTest : SpringTestBase(){ assertTrue(solution.individuals.size >= 1) val faults = DetectedFaultUtils.getDetectedFaultCategories(solution) - assertTrue({ ExperimentalFaultCategory.HTTP_INVALID_LOCATION in faults }) + assertTrue({ DefinedFaultCategory.HTTP_INVALID_LOCATION in faults }) } } } diff --git a/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/invalidlocation/HttpInvalidLocationGetEMTest.kt b/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/invalidlocation/HttpInvalidLocationGetEMTest.kt index 3d46d088d4..be1fe9834f 100644 --- a/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/invalidlocation/HttpInvalidLocationGetEMTest.kt +++ b/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/invalidlocation/HttpInvalidLocationGetEMTest.kt @@ -1,6 +1,7 @@ package org.evomaster.e2etests.spring.openapi.v3.httporacle.invalidlocation import com.foo.rest.examples.spring.openapi.v3.httporacle.invalidlocation.locationget.HttpInvalidLocationGetController +import com.webfuzzing.commons.faults.DefinedFaultCategory import org.evomaster.core.problem.enterprise.DetectedFaultUtils import org.evomaster.core.problem.enterprise.ExperimentalFaultCategory import org.evomaster.e2etests.spring.openapi.v3.SpringTestBase @@ -43,7 +44,7 @@ class HttpInvalidLocationGetEMTest : SpringTestBase(){ assertTrue(solution.individuals.size >= 1) val faults = DetectedFaultUtils.getDetectedFaultCategories(solution) - assertTrue({ ExperimentalFaultCategory.HTTP_INVALID_LOCATION in faults }) + assertTrue({ DefinedFaultCategory.HTTP_INVALID_LOCATION in faults }) } } } diff --git a/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/invalidlocation/HttpInvalidLocationNotValidEMTest.kt b/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/invalidlocation/HttpInvalidLocationNotValidEMTest.kt index fd931aea06..24bff259f5 100644 --- a/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/invalidlocation/HttpInvalidLocationNotValidEMTest.kt +++ b/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/invalidlocation/HttpInvalidLocationNotValidEMTest.kt @@ -1,6 +1,7 @@ package org.evomaster.e2etests.spring.openapi.v3.httporacle.invalidlocation import com.foo.rest.examples.spring.openapi.v3.httporacle.invalidlocation.notvalidpath.HttpInvalidLocationNotValidController +import com.webfuzzing.commons.faults.DefinedFaultCategory import org.evomaster.core.problem.enterprise.DetectedFaultUtils import org.evomaster.core.problem.enterprise.ExperimentalFaultCategory import org.evomaster.e2etests.spring.openapi.v3.SpringTestBase @@ -37,7 +38,7 @@ class HttpInvalidLocationNotValidEMTest : SpringTestBase(){ assertTrue(solution.individuals.size >= 1) val faults = DetectedFaultUtils.getDetectedFaultCategories(solution) - assertTrue({ ExperimentalFaultCategory.HTTP_INVALID_LOCATION in faults }) + assertTrue({ DefinedFaultCategory.HTTP_INVALID_LOCATION in faults }) } } } diff --git a/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/invalidlocation/HttpInvalidLocationVerbSelectionEMTest.kt b/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/invalidlocation/HttpInvalidLocationVerbSelectionEMTest.kt index 1a9af0c8bc..a209aa4b55 100644 --- a/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/invalidlocation/HttpInvalidLocationVerbSelectionEMTest.kt +++ b/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/invalidlocation/HttpInvalidLocationVerbSelectionEMTest.kt @@ -1,6 +1,7 @@ package org.evomaster.e2etests.spring.openapi.v3.httporacle.invalidlocation import com.foo.rest.examples.spring.openapi.v3.httporacle.invalidlocation.verbselection.HttpInvalidLocationVerbSelectionController +import com.webfuzzing.commons.faults.DefinedFaultCategory import org.evomaster.core.problem.enterprise.DetectedFaultUtils import org.evomaster.core.problem.enterprise.ExperimentalFaultCategory import org.evomaster.core.problem.rest.data.HttpVerb @@ -38,7 +39,7 @@ class HttpInvalidLocationVerbSelectionEMTest : SpringTestBase() { assertTrue(solution.individuals.size >= 1) val faults = DetectedFaultUtils.getDetectedFaults(solution) - .filter { it.category == ExperimentalFaultCategory.HTTP_INVALID_LOCATION } + .filter { it.category == DefinedFaultCategory.HTTP_INVALID_LOCATION } // Family A: Location -> declared GET returning 500. A fault here can only come from // the 500 status, proving 500 is part of the invalid-location status set. diff --git a/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/invalidmergepatch/HttpInvalidMergePatchEMTest.kt b/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/invalidmergepatch/HttpInvalidMergePatchEMTest.kt index 132ae6916b..f20a1c7b69 100644 --- a/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/invalidmergepatch/HttpInvalidMergePatchEMTest.kt +++ b/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/invalidmergepatch/HttpInvalidMergePatchEMTest.kt @@ -1,6 +1,7 @@ package org.evomaster.e2etests.spring.openapi.v3.httporacle.invalidmergepatch import com.foo.rest.examples.spring.openapi.v3.httporacle.invalidmergepatch.InvalidMergePatchController +import com.webfuzzing.commons.faults.DefinedFaultCategory import org.evomaster.core.problem.enterprise.DetectedFaultUtils import org.evomaster.core.problem.enterprise.ExperimentalFaultCategory import org.evomaster.core.problem.rest.data.HttpVerb @@ -42,10 +43,10 @@ class HttpInvalidMergePatchEMTest : SpringTestBase(){ assertHasAtLeastOne(solution, HttpVerb.PATCH, 200, "/api/mergepatch/correct/{id}", null) val faults = DetectedFaultUtils.getDetectedFaultCategories(solution) - assertTrue(faults.contains(ExperimentalFaultCategory.HTTP_INVALID_MERGE_PATCH)) + assertTrue(faults.contains(DefinedFaultCategory.HTTP_INVALID_MERGE_PATCH)) val mergePatchFaults = DetectedFaultUtils.getDetectedFaults(solution) - .filter { it.category == ExperimentalFaultCategory.HTTP_INVALID_MERGE_PATCH } + .filter { it.category == DefinedFaultCategory.HTTP_INVALID_MERGE_PATCH } // the buggy resource must be flagged... assertTrue(mergePatchFaults.any { it.operationId.contains("/api/mergepatch/buggy/") }) // ...and the correct resource must NOT be flagged diff --git a/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/misleadingcreateput/MisleadingCreatePutEMTest.kt b/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/misleadingcreateput/MisleadingCreatePutEMTest.kt index a0ea0fd034..8a150c2cef 100644 --- a/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/misleadingcreateput/MisleadingCreatePutEMTest.kt +++ b/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/misleadingcreateput/MisleadingCreatePutEMTest.kt @@ -2,6 +2,7 @@ package org.evomaster.e2etests.spring.openapi.v3.httporacle.misleadingcreateput import com.foo.rest.examples.spring.openapi.v3.httporacle.misleadingcreateput.HttpMisleadingCreatePutController import com.foo.rest.examples.spring.openapi.v3.httporacle.partialupdateput.HttpPartialUpdatePutController +import com.webfuzzing.commons.faults.DefinedFaultCategory import org.evomaster.core.problem.enterprise.DetectedFaultUtils import org.evomaster.core.problem.enterprise.ExperimentalFaultCategory import org.evomaster.core.problem.rest.data.HttpVerb @@ -42,7 +43,7 @@ class MisleadingCreatePutEMTest : SpringTestBase(){ assertHasAtLeastOne(solution, HttpVerb.PUT, 201, "/api/resources/{id}", null) val faultsCategories = DetectedFaultUtils.getDetectedFaultCategories(solution) - assertTrue(ExperimentalFaultCategory.HTTP_MISLEADING_CREATE_PUT in faultsCategories) + assertTrue(DefinedFaultCategory.HTTP_MISLEADING_CREATE_PUT in faultsCategories) } } diff --git a/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/nonidempotentput/HttpNonIdempotentPutArrayEMTest.kt b/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/nonidempotentput/HttpNonIdempotentPutArrayEMTest.kt index a4d5b94c2b..5397e44285 100644 --- a/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/nonidempotentput/HttpNonIdempotentPutArrayEMTest.kt +++ b/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/nonidempotentput/HttpNonIdempotentPutArrayEMTest.kt @@ -1,6 +1,7 @@ package org.evomaster.e2etests.spring.openapi.v3.httporacle.nonidempotentput import com.foo.rest.examples.spring.openapi.v3.httporacle.nonidempotentput.array.HttpNonIdempotentPutArrayController +import com.webfuzzing.commons.faults.DefinedFaultCategory import org.evomaster.core.problem.enterprise.DetectedFaultUtils import org.evomaster.core.problem.enterprise.ExperimentalFaultCategory import org.evomaster.e2etests.spring.openapi.v3.SpringTestBase @@ -39,7 +40,7 @@ class HttpNonIdempotentPutArrayEMTest : SpringTestBase(){ val faults = DetectedFaultUtils.getDetectedFaultCategories(solution) assertEquals(1, faults.size) - assertEquals(ExperimentalFaultCategory.HTTP_NON_IDEMPOTENT_PUT, faults.first()) + assertEquals(DefinedFaultCategory.HTTP_NON_IDEMPOTENT_PUT, faults.first()) } } } diff --git a/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/nonidempotentput/HttpNonIdempotentPutEMTest.kt b/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/nonidempotentput/HttpNonIdempotentPutEMTest.kt index 39fb101130..da7ccc2bda 100644 --- a/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/nonidempotentput/HttpNonIdempotentPutEMTest.kt +++ b/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/nonidempotentput/HttpNonIdempotentPutEMTest.kt @@ -1,6 +1,7 @@ package org.evomaster.e2etests.spring.openapi.v3.httporacle.nonidempotentput import com.foo.rest.examples.spring.openapi.v3.httporacle.nonidempotentput.json.HttpNonIdempotentPutController +import com.webfuzzing.commons.faults.DefinedFaultCategory import org.evomaster.core.problem.enterprise.DetectedFaultUtils import org.evomaster.core.problem.enterprise.ExperimentalFaultCategory import org.evomaster.e2etests.spring.openapi.v3.SpringTestBase @@ -39,7 +40,7 @@ class HttpNonIdempotentPutEMTest : SpringTestBase(){ val faults = DetectedFaultUtils.getDetectedFaultCategories(solution) assertEquals(1, faults.size) - assertEquals(ExperimentalFaultCategory.HTTP_NON_IDEMPOTENT_PUT, faults.first()) + assertEquals(DefinedFaultCategory.HTTP_NON_IDEMPOTENT_PUT, faults.first()) } } } \ No newline at end of file diff --git a/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/nonidempotentput/HttpNonIdempotentPutUrlencodedEMTest.kt b/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/nonidempotentput/HttpNonIdempotentPutUrlencodedEMTest.kt index fecfa38240..fdfe691db6 100644 --- a/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/nonidempotentput/HttpNonIdempotentPutUrlencodedEMTest.kt +++ b/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/nonidempotentput/HttpNonIdempotentPutUrlencodedEMTest.kt @@ -3,6 +3,7 @@ package org.evomaster.e2etests.spring.openapi.v3.httporacle.nonidempotentput import com.foo.rest.examples.spring.openapi.v3.httporacle.nonidempotentput.json.HttpNonIdempotentPutController import com.foo.rest.examples.spring.openapi.v3.httporacle.nonidempotentput.urlencoded.HttpNonIdempotentPutUrlencodedController import com.foo.rest.examples.spring.openapi.v3.httporacle.nonidempotentput.xml.HttpNonIdempotentPutXMLController +import com.webfuzzing.commons.faults.DefinedFaultCategory import org.evomaster.core.problem.enterprise.DetectedFaultUtils import org.evomaster.core.problem.enterprise.ExperimentalFaultCategory import org.evomaster.e2etests.spring.openapi.v3.SpringTestBase @@ -41,7 +42,7 @@ class HttpNonIdempotentPutUrlencodedEMTest : SpringTestBase(){ val faults = DetectedFaultUtils.getDetectedFaultCategories(solution) assertEquals(1, faults.size) - assertEquals(ExperimentalFaultCategory.HTTP_NON_IDEMPOTENT_PUT, faults.first()) + assertEquals(DefinedFaultCategory.HTTP_NON_IDEMPOTENT_PUT, faults.first()) } } } \ No newline at end of file diff --git a/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/nonidempotentput/HttpNonIdempotentPutXMLEMTest.kt b/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/nonidempotentput/HttpNonIdempotentPutXMLEMTest.kt index e70b128c16..f82396bf63 100644 --- a/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/nonidempotentput/HttpNonIdempotentPutXMLEMTest.kt +++ b/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/nonidempotentput/HttpNonIdempotentPutXMLEMTest.kt @@ -2,6 +2,7 @@ package org.evomaster.e2etests.spring.openapi.v3.httporacle.nonidempotentput import com.foo.rest.examples.spring.openapi.v3.httporacle.nonidempotentput.json.HttpNonIdempotentPutController import com.foo.rest.examples.spring.openapi.v3.httporacle.nonidempotentput.xml.HttpNonIdempotentPutXMLController +import com.webfuzzing.commons.faults.DefinedFaultCategory import org.evomaster.core.problem.enterprise.DetectedFaultUtils import org.evomaster.core.problem.enterprise.ExperimentalFaultCategory import org.evomaster.e2etests.spring.openapi.v3.SpringTestBase @@ -41,7 +42,7 @@ class HttpNonIdempotentPutXMLEMTest : SpringTestBase(){ val faults = DetectedFaultUtils.getDetectedFaultCategories(solution) assertEquals(1, faults.size) - assertEquals(ExperimentalFaultCategory.HTTP_NON_IDEMPOTENT_PUT, faults.first()) + assertEquals(DefinedFaultCategory.HTTP_NON_IDEMPOTENT_PUT, faults.first()) } } } \ No newline at end of file diff --git a/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/partialupdateput/HttpPartialUpdatePutEMTest.kt b/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/partialupdateput/HttpPartialUpdatePutEMTest.kt index aca3e5a24d..a97babc3a4 100644 --- a/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/partialupdateput/HttpPartialUpdatePutEMTest.kt +++ b/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/partialupdateput/HttpPartialUpdatePutEMTest.kt @@ -1,6 +1,7 @@ package org.evomaster.e2etests.spring.openapi.v3.httporacle.partialupdateput import com.foo.rest.examples.spring.openapi.v3.httporacle.partialupdateput.HttpPartialUpdatePutController +import com.webfuzzing.commons.faults.DefinedFaultCategory import org.evomaster.core.problem.enterprise.DetectedFaultUtils import org.evomaster.core.problem.enterprise.ExperimentalFaultCategory import org.evomaster.core.problem.rest.data.HttpVerb @@ -42,7 +43,7 @@ class HttpPartialUpdatePutEMTest : SpringTestBase(){ val faults = DetectedFaultUtils.getDetectedFaultCategories(solution) assertEquals(1, faults.size) - assertEquals(ExperimentalFaultCategory.HTTP_PARTIAL_UPDATE_PUT, faults.first()) + assertEquals(DefinedFaultCategory.HTTP_PARTIAL_UPDATE_PUT, faults.first()) } } } diff --git a/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/partialupdateput/HttpPartialUpdatePutURLEncodedEMTest.kt b/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/partialupdateput/HttpPartialUpdatePutURLEncodedEMTest.kt index d7b2e28435..08103fa2c0 100644 --- a/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/partialupdateput/HttpPartialUpdatePutURLEncodedEMTest.kt +++ b/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/partialupdateput/HttpPartialUpdatePutURLEncodedEMTest.kt @@ -1,6 +1,7 @@ package org.evomaster.e2etests.spring.openapi.v3.httporacle.partialupdateput import com.foo.rest.examples.spring.openapi.v3.httporacle.partialupdateput.HttpPartialUpdatePutURLEncodedController +import com.webfuzzing.commons.faults.DefinedFaultCategory import org.evomaster.core.problem.enterprise.DetectedFaultUtils import org.evomaster.core.problem.enterprise.ExperimentalFaultCategory import org.evomaster.core.problem.rest.data.HttpVerb @@ -42,7 +43,7 @@ class HttpPartialUpdatePutURLEncodedEMTest : SpringTestBase(){ val faults = DetectedFaultUtils.getDetectedFaultCategories(solution) assertEquals(1, faults.size) - assertEquals(ExperimentalFaultCategory.HTTP_PARTIAL_UPDATE_PUT, faults.first()) + assertEquals(DefinedFaultCategory.HTTP_PARTIAL_UPDATE_PUT, faults.first()) } } } diff --git a/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/partialupdateput/HttpPartialUpdatePutXMLEMTest.kt b/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/partialupdateput/HttpPartialUpdatePutXMLEMTest.kt index cad26d41c6..5cc874a823 100644 --- a/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/partialupdateput/HttpPartialUpdatePutXMLEMTest.kt +++ b/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/partialupdateput/HttpPartialUpdatePutXMLEMTest.kt @@ -1,6 +1,7 @@ package org.evomaster.e2etests.spring.openapi.v3.httporacle.partialupdateput import com.foo.rest.examples.spring.openapi.v3.httporacle.partialupdateput.HttpPartialUpdatePutXMLController +import com.webfuzzing.commons.faults.DefinedFaultCategory import org.evomaster.core.problem.enterprise.DetectedFaultUtils import org.evomaster.core.problem.enterprise.ExperimentalFaultCategory import org.evomaster.core.problem.rest.data.HttpVerb @@ -43,7 +44,7 @@ class HttpPartialUpdatePutXMLEMTest : SpringTestBase(){ val faults = DetectedFaultUtils.getDetectedFaultCategories(solution) assertEquals(1, faults.size) - assertEquals(ExperimentalFaultCategory.HTTP_PARTIAL_UPDATE_PUT, faults.first()) + assertEquals(DefinedFaultCategory.HTTP_PARTIAL_UPDATE_PUT, faults.first()) } } } diff --git a/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/repeatedput/HttpOracleRepeatedPutEMTest.kt b/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/repeatedput/HttpOracleRepeatedPutEMTest.kt index 7c958eda60..6cfe74582c 100644 --- a/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/repeatedput/HttpOracleRepeatedPutEMTest.kt +++ b/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/httporacle/repeatedput/HttpOracleRepeatedPutEMTest.kt @@ -1,6 +1,7 @@ package org.evomaster.e2etests.spring.openapi.v3.httporacle.repeatedput import com.foo.rest.examples.spring.openapi.v3.httporacle.repeatedput.HttpOracleRepeatedPutController +import com.webfuzzing.commons.faults.DefinedFaultCategory import com.webfuzzing.commons.faults.FaultCategory import org.evomaster.core.problem.enterprise.DetectedFaultUtils import org.evomaster.core.problem.enterprise.ExperimentalFaultCategory @@ -43,7 +44,7 @@ class HttpOracleRepeatedPutEMTest : SpringTestBase(){ val faults = DetectedFaultUtils.getDetectedFaultCategories(solution) assertEquals(1, faults.size) - assertEquals(ExperimentalFaultCategory.HTTP_REPEATED_CREATE_PUT, faults.first()) + assertEquals(DefinedFaultCategory.HTTP_REPEATED_CREATE_PUT, faults.first()) } } } \ No newline at end of file diff --git a/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/oracledisable/SSRFBaseDisableEMTest.kt b/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/oracledisable/SSRFBaseDisableEMTest.kt index 9740ff7db4..88ac321f5a 100644 --- a/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/oracledisable/SSRFBaseDisableEMTest.kt +++ b/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/oracledisable/SSRFBaseDisableEMTest.kt @@ -37,7 +37,7 @@ class SSRFBaseDisableEMTest : SpringTestBase() { setOption(args, "llm", "false") setOption(args, "schemaOracles", "false") - setOption(args, "disabledOracleCodes", DefinedFaultCategory.SSRF.code.toString()) + setOption(args, "disabledOracleCodes", DefinedFaultCategory.SECURITY_SSRF.code.toString()) val solution = initAndRun(args) diff --git a/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/security/xss/reflected/html/XSSReflectedEMTest.kt b/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/security/xss/reflected/html/XSSReflectedEMTest.kt index 124b2f4cf9..8fa0d32bdf 100644 --- a/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/security/xss/reflected/html/XSSReflectedEMTest.kt +++ b/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/security/xss/reflected/html/XSSReflectedEMTest.kt @@ -39,20 +39,20 @@ class XSSReflectedEMTest : SpringTestBase() { val faultsCategories = DetectedFaultUtils.getDetectedFaultCategories(solution) val faults = DetectedFaultUtils.getDetectedFaults(solution) - Assertions.assertTrue(DefinedFaultCategory.XSS in faultsCategories) + Assertions.assertTrue(DefinedFaultCategory.SECURITY_XSS in faultsCategories) Assertions.assertTrue(faults.any { - it.category == DefinedFaultCategory.XSS + it.category == DefinedFaultCategory.SECURITY_XSS && it.operationId == "POST:/api/reflected/comment" }) Assertions.assertTrue(faults.any { - it.category == DefinedFaultCategory.XSS + it.category == DefinedFaultCategory.SECURITY_XSS && it.operationId == "GET:/api/reflected/search" }) Assertions.assertTrue(faults.any { - it.category == DefinedFaultCategory.XSS + it.category == DefinedFaultCategory.SECURITY_XSS && it.operationId == "GET:/api/reflected/user/{username}" }) } diff --git a/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/security/xss/reflected/json/XSSReflectedJSONEMTest.kt b/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/security/xss/reflected/json/XSSReflectedJSONEMTest.kt index 2e59463297..bf59785ad8 100644 --- a/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/security/xss/reflected/json/XSSReflectedJSONEMTest.kt +++ b/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/security/xss/reflected/json/XSSReflectedJSONEMTest.kt @@ -39,20 +39,20 @@ class XSSReflectedJSONEMTest : SpringTestBase() { val faultsCategories = DetectedFaultUtils.getDetectedFaultCategories(solution) val faults = DetectedFaultUtils.getDetectedFaults(solution) - assertTrue(DefinedFaultCategory.XSS in faultsCategories) + assertTrue(DefinedFaultCategory.SECURITY_XSS in faultsCategories) assertTrue(faults.any { - it.category == DefinedFaultCategory.XSS + it.category == DefinedFaultCategory.SECURITY_XSS && it.operationId == "POST:/api/reflected/json/comment" }) assertTrue(faults.any { - it.category == DefinedFaultCategory.XSS + it.category == DefinedFaultCategory.SECURITY_XSS && it.operationId == "GET:/api/reflected/json/search" }) assertTrue(faults.any { - it.category == DefinedFaultCategory.XSS + it.category == DefinedFaultCategory.SECURITY_XSS && it.operationId == "GET:/api/reflected/json/user/{username}" }) } diff --git a/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/security/xss/stored/html/XSSStoredEMTest.kt b/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/security/xss/stored/html/XSSStoredEMTest.kt index 3991b88714..8bf5a87984 100644 --- a/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/security/xss/stored/html/XSSStoredEMTest.kt +++ b/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/security/xss/stored/html/XSSStoredEMTest.kt @@ -42,20 +42,20 @@ class XSSStoredEMTest : SpringTestBase() { val faultCategories = DetectedFaultUtils.getDetectedFaultCategories(solution) - Assertions.assertTrue({ DefinedFaultCategory.XSS in faultCategories }) + Assertions.assertTrue({ DefinedFaultCategory.SECURITY_XSS in faultCategories }) Assertions.assertTrue(faults.any { - it.category == DefinedFaultCategory.XSS + it.category == DefinedFaultCategory.SECURITY_XSS && it.operationId == "GET:/api/stored/comments" }) Assertions.assertTrue(faults.any { - it.category == DefinedFaultCategory.XSS + it.category == DefinedFaultCategory.SECURITY_XSS && it.operationId == "GET:/api/stored/guestbook" }) Assertions.assertTrue(faults.any { - it.category == DefinedFaultCategory.XSS + it.category == DefinedFaultCategory.SECURITY_XSS && it.operationId == "GET:/api/stored/user/{username}" }) } diff --git a/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/security/xss/stored/json/XSSStoredJSONEMTest.kt b/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/security/xss/stored/json/XSSStoredJSONEMTest.kt index 24f57e188a..1da268d0cb 100644 --- a/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/security/xss/stored/json/XSSStoredJSONEMTest.kt +++ b/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/security/xss/stored/json/XSSStoredJSONEMTest.kt @@ -42,20 +42,20 @@ class XSSStoredJSONEMTest : SpringTestBase() { val faultCategories = DetectedFaultUtils.getDetectedFaultCategories(solution) - Assertions.assertTrue({ DefinedFaultCategory.XSS in faultCategories }) + Assertions.assertTrue({ DefinedFaultCategory.SECURITY_XSS in faultCategories }) Assertions.assertTrue(faults.any { - it.category == DefinedFaultCategory.XSS + it.category == DefinedFaultCategory.SECURITY_XSS && it.operationId == "GET:/api/stored/json/comments" }) Assertions.assertTrue(faults.any { - it.category == DefinedFaultCategory.XSS + it.category == DefinedFaultCategory.SECURITY_XSS && it.operationId == "GET:/api/stored/json/guestbook" }) Assertions.assertTrue(faults.any { - it.category == DefinedFaultCategory.XSS + it.category == DefinedFaultCategory.SECURITY_XSS && it.operationId == "GET:/api/stored/json/user/{username}" }) } diff --git a/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/statusoracle/StatusOracleEMTest.kt b/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/statusoracle/StatusOracleEMTest.kt index 3fee6a2c8a..a2ba1d42bc 100644 --- a/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/statusoracle/StatusOracleEMTest.kt +++ b/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/test/kotlin/org/evomaster/e2etests/spring/openapi/v3/statusoracle/StatusOracleEMTest.kt @@ -1,6 +1,7 @@ package org.evomaster.e2etests.spring.openapi.v3.statusoracle import com.foo.rest.examples.spring.openapi.v3.statusoracle.StatusOracleController +import com.webfuzzing.commons.faults.DefinedFaultCategory import org.evomaster.core.problem.enterprise.DetectedFaultUtils import org.evomaster.core.problem.enterprise.ExperimentalFaultCategory import org.evomaster.core.problem.rest.data.HttpVerb @@ -43,58 +44,58 @@ class StatusOracleEMTest : SpringTestBase(){ assertHasAtLeastOne(solution, HttpVerb.GET, 42, "/api/statusoracle/no-non-standard-codes/42", null) assertHasAtLeastOne(solution, HttpVerb.GET, 912, "/api/statusoracle/no-non-standard-codes/912", null) assertHasAtLeastOne(solution, HttpVerb.GET, 1024, "/api/statusoracle/no-non-standard-codes/1024", null) - assertTrue(faultsCategories.any { it == ExperimentalFaultCategory.HTTP_STATUS_NO_NON_STANDARD_CODES }) + assertTrue(faultsCategories.any { it == DefinedFaultCategory.HTTP_STATUS_NO_NON_STANDARD_CODES }) //201 assertHasAtLeastOne(solution, HttpVerb.GET, 201, "/api/statusoracle/no-201-if-get", null) assertHasAtLeastOne(solution, HttpVerb.DELETE, 201, "/api/statusoracle/no-201-if-delete", null) assertHasAtLeastOne(solution, HttpVerb.PATCH, 201, "/api/statusoracle/no-201-if-patch", null) - assertTrue(faultsCategories.any { it == ExperimentalFaultCategory.HTTP_STATUS_NO_201_IF_DELETE }) - assertTrue(faultsCategories.any { it == ExperimentalFaultCategory.HTTP_STATUS_NO_201_IF_PATCH }) + assertTrue(faultsCategories.any { it == DefinedFaultCategory.HTTP_STATUS_NO_201_IF_DELETE }) + assertTrue(faultsCategories.any { it == DefinedFaultCategory.HTTP_STATUS_NO_201_IF_PATCH }) //204 //Unfortunately, we cannot test this, at least in SpringBoot, as HTTP server will automatically // strip the body if status is 204. it seems this cannot be configured //assertHasAtLeastOne(solution, HttpVerb.GET, 204, "/api/statusoracle/no-204-if-content", "Hello") - //assertTrue(faultsCategories.any { it == ExperimentalFaultCategory.HTTP_STATUS_NO_204_IF_CONTENT }) + //assertTrue(faultsCategories.any { it == DefinedFaultCategory.HTTP_STATUS_NO_204_IF_CONTENT }) //205 //Same issue as 204 //assertHasAtLeastOne(solution, HttpVerb.GET, 205, "/api/statusoracle/no-205-if-content", "Hello") - //assertTrue(faultsCategories.any { it == ExperimentalFaultCategory.HTTP_STATUS_NO_205_IF_CONTENT }) + //assertTrue(faultsCategories.any { it == DefinedFaultCategory.HTTP_STATUS_NO_205_IF_CONTENT }) //304 assertHasAtLeastOne(solution, HttpVerb.POST, 304, "/api/statusoracle/no-304-if-no-get-or-head", null) - assertTrue(faultsCategories.any { it == ExperimentalFaultCategory.HTTP_STATUS_NO_304_IF_NO_GET_OR_HEAD }) + assertTrue(faultsCategories.any { it == DefinedFaultCategory.HTTP_STATUS_NO_304_IF_NO_GET_OR_HEAD }) //401 and 403 assertHasAtLeastOne(solution, HttpVerb.GET, 401, "/api/statusoracle/no-401-if-no-auth", null) assertHasAtLeastOne(solution, HttpVerb.GET, 403, "/api/statusoracle/no-403-if-no-401", null) - assertTrue(faultsCategories.any { it == ExperimentalFaultCategory.HTTP_STATUS_NO_401_IF_NO_AUTH }) - assertTrue(faultsCategories.any { it == ExperimentalFaultCategory.HTTP_STATUS_NO_403_IF_NO_401 }) - assertTrue(faultsCategories.any { it == ExperimentalFaultCategory.HTTP_STATUS_NO_401_IF_NO_WWW_AUTHENTICATE }) + assertTrue(faultsCategories.any { it == DefinedFaultCategory.SCHEMA_STATUS_NO_401_IF_NO_AUTH }) + assertTrue(faultsCategories.any { it == DefinedFaultCategory.SCHEMA_STATUS_NO_403_IF_NO_401 }) + assertTrue(faultsCategories.any { it == DefinedFaultCategory.HTTP_STATUS_NO_401_IF_NO_WWW_AUTHENTICATE }) //405 assertHasAtLeastOne(solution, HttpVerb.GET, 405, "/api/statusoracle/no-405-if-no-allow", null) - assertTrue(faultsCategories.any{ it == ExperimentalFaultCategory.HTTP_STATUS_NO_405_IF_NO_ALLOW}) + assertTrue(faultsCategories.any{ it == DefinedFaultCategory.HTTP_STATUS_NO_405_IF_NO_ALLOW}) //406 assertHasAtLeastOne(solution, HttpVerb.POST, 406, "/api/statusoracle/has-406-if-accept", null) - assertTrue(faultsCategories.any { it == ExperimentalFaultCategory.HTTP_STATUS_HAS_406_IF_ACCEPT }) + assertTrue(faultsCategories.any { it == DefinedFaultCategory.SCHEMA_STATUS_HAS_406_IF_ACCEPT }) //413, 415 assertHasAtLeastOne(solution, HttpVerb.POST, 413, "/api/statusoracle/no-413-if-no-payload", null) assertHasAtLeastOne(solution, HttpVerb.POST, 415, "/api/statusoracle/no-415-if-no-payload", null) - assertTrue(faultsCategories.any { it == ExperimentalFaultCategory.HTTP_STATUS_NO_413_IF_NO_PAYLOAD }) - assertTrue(faultsCategories.any { it == ExperimentalFaultCategory.HTTP_STATUS_NO_415_IF_NO_PAYLOAD }) + assertTrue(faultsCategories.any { it == DefinedFaultCategory.HTTP_STATUS_NO_413_IF_NO_PAYLOAD }) + assertTrue(faultsCategories.any { it == DefinedFaultCategory.HTTP_STATUS_NO_415_IF_NO_PAYLOAD }) //426 assertHasAtLeastOne(solution, HttpVerb.GET, 426, "/api/statusoracle/no-426-if-no-upgrade", null) - assertTrue(faultsCategories.any { it == ExperimentalFaultCategory.HTTP_STATUS_NO_426_IF_NO_UPGRADE }) + assertTrue(faultsCategories.any { it == DefinedFaultCategory.HTTP_STATUS_NO_426_IF_NO_UPGRADE }) //501 assertHasAtLeastOne(solution, HttpVerb.GET, 501, "/api/statusoracle/no-501-if-implemented", null) - assertTrue(faultsCategories.any { it == ExperimentalFaultCategory.HTTP_STATUS_NO_501_IF_IMPLEMENTED }) + assertTrue(faultsCategories.any { it == DefinedFaultCategory.SCHEMA_STATUS_NO_501_IF_IMPLEMENTED }) } } } \ No newline at end of file diff --git a/core-tests/e2e-tests/spring/spring-rest-postgres/src/test/kotlin/org/evomaster/e2etests/spring/rest/postgres/sqli/SQLiPostgresBodyEMTest.kt b/core-tests/e2e-tests/spring/spring-rest-postgres/src/test/kotlin/org/evomaster/e2etests/spring/rest/postgres/sqli/SQLiPostgresBodyEMTest.kt index 470bf6a18c..abcab037a6 100644 --- a/core-tests/e2e-tests/spring/spring-rest-postgres/src/test/kotlin/org/evomaster/e2etests/spring/rest/postgres/sqli/SQLiPostgresBodyEMTest.kt +++ b/core-tests/e2e-tests/spring/spring-rest-postgres/src/test/kotlin/org/evomaster/e2etests/spring/rest/postgres/sqli/SQLiPostgresBodyEMTest.kt @@ -38,15 +38,15 @@ class SQLiPostgresBodyEMTest : SpringRestPostgresTestBase() { val faultCategories = DetectedFaultUtils.getDetectedFaultCategories(solution) - assertTrue({ DefinedFaultCategory.SQL_INJECTION in faultCategories }) + assertTrue({ DefinedFaultCategory.SECURITY_SQL_INJECTION in faultCategories }) assertTrue(faults.any { - it.category == DefinedFaultCategory.SQL_INJECTION + it.category == DefinedFaultCategory.SECURITY_SQL_INJECTION && it.operationId == "POST:/api/sqli/body/vulnerable" }) assertFalse(faults.any { - it.category == DefinedFaultCategory.SQL_INJECTION + it.category == DefinedFaultCategory.SECURITY_SQL_INJECTION && it.operationId == "GET:/api/sqli/body/safe" }) diff --git a/core-tests/e2e-tests/spring/spring-rest-postgres/src/test/kotlin/org/evomaster/e2etests/spring/rest/postgres/sqli/SQLiPostgresPathEMTest.kt b/core-tests/e2e-tests/spring/spring-rest-postgres/src/test/kotlin/org/evomaster/e2etests/spring/rest/postgres/sqli/SQLiPostgresPathEMTest.kt index 6f8aa0a739..7a0fe0cf17 100644 --- a/core-tests/e2e-tests/spring/spring-rest-postgres/src/test/kotlin/org/evomaster/e2etests/spring/rest/postgres/sqli/SQLiPostgresPathEMTest.kt +++ b/core-tests/e2e-tests/spring/spring-rest-postgres/src/test/kotlin/org/evomaster/e2etests/spring/rest/postgres/sqli/SQLiPostgresPathEMTest.kt @@ -38,15 +38,15 @@ class SQLiPostgresPathEMTest : SpringRestPostgresTestBase() { val faultCategories = DetectedFaultUtils.getDetectedFaultCategories(solution) - assertTrue({ DefinedFaultCategory.SQL_INJECTION in faultCategories }) + assertTrue({ DefinedFaultCategory.SECURITY_SQL_INJECTION in faultCategories }) assertTrue(faults.any { - it.category == DefinedFaultCategory.SQL_INJECTION + it.category == DefinedFaultCategory.SECURITY_SQL_INJECTION && it.operationId == "GET:/api/sqli/path/vulnerable/{id}" }) assertFalse(faults.any { - it.category == DefinedFaultCategory.SQL_INJECTION + it.category == DefinedFaultCategory.SECURITY_SQL_INJECTION && it.operationId == "GET:/api/sqli/path/safe" }) diff --git a/core-tests/e2e-tests/spring/spring-rest-postgres/src/test/kotlin/org/evomaster/e2etests/spring/rest/postgres/sqli/SQLiPostgresQueryEMTest.kt b/core-tests/e2e-tests/spring/spring-rest-postgres/src/test/kotlin/org/evomaster/e2etests/spring/rest/postgres/sqli/SQLiPostgresQueryEMTest.kt index 1a14f0ac0d..ee2bda71e1 100644 --- a/core-tests/e2e-tests/spring/spring-rest-postgres/src/test/kotlin/org/evomaster/e2etests/spring/rest/postgres/sqli/SQLiPostgresQueryEMTest.kt +++ b/core-tests/e2e-tests/spring/spring-rest-postgres/src/test/kotlin/org/evomaster/e2etests/spring/rest/postgres/sqli/SQLiPostgresQueryEMTest.kt @@ -38,15 +38,15 @@ class SQLiPostgresQueryEMTest : SpringRestPostgresTestBase() { val faultCategories = DetectedFaultUtils.getDetectedFaultCategories(solution) - assertTrue({ DefinedFaultCategory.SQL_INJECTION in faultCategories }) + assertTrue({ DefinedFaultCategory.SECURITY_SQL_INJECTION in faultCategories }) assertTrue(faults.any { - it.category == DefinedFaultCategory.SQL_INJECTION + it.category == DefinedFaultCategory.SECURITY_SQL_INJECTION && it.operationId == "GET:/api/sqli/query/vulnerable" }) assertFalse(faults.any { - it.category == DefinedFaultCategory.SQL_INJECTION + it.category == DefinedFaultCategory.SECURITY_SQL_INJECTION && it.operationId == "GET:/api/sqli/query/safe" }) diff --git a/core-tests/integration-tests/core-it/src/test/kotlin/org/evomaster/core/problem/rest/nonworkingdelete/NonWorkingDeleteTest.kt b/core-tests/integration-tests/core-it/src/test/kotlin/org/evomaster/core/problem/rest/nonworkingdelete/NonWorkingDeleteTest.kt index 49f96fbf4d..62cc0d1918 100644 --- a/core-tests/integration-tests/core-it/src/test/kotlin/org/evomaster/core/problem/rest/nonworkingdelete/NonWorkingDeleteTest.kt +++ b/core-tests/integration-tests/core-it/src/test/kotlin/org/evomaster/core/problem/rest/nonworkingdelete/NonWorkingDeleteTest.kt @@ -2,6 +2,7 @@ package org.evomaster.core.problem.rest.nonworkingdelete import bar.examples.it.spring.nonworkingdelete.NonWorkingDeleteApplication import bar.examples.it.spring.nonworkingdelete.NonWorkingDeleteController +import com.webfuzzing.commons.faults.DefinedFaultCategory import com.webfuzzing.commons.faults.FaultCategory import org.evomaster.core.problem.enterprise.ExperimentalFaultCategory import org.evomaster.core.problem.enterprise.SampleType @@ -63,6 +64,6 @@ class NonWorkingDeleteTest: IntegrationTestRestBase() { val ar = y.evaluatedMainActions()[2].result as RestCallResult assertEquals(1, ar.getFaults().size) - assertEquals(ExperimentalFaultCategory.HTTP_NONWORKING_DELETE, ar.getFaults()[0].category) + assertEquals(DefinedFaultCategory.HTTP_NONWORKING_DELETE, ar.getFaults()[0].category) } } \ No newline at end of file diff --git a/core/src/main/kotlin/org/evomaster/core/EMConfig.kt b/core/src/main/kotlin/org/evomaster/core/EMConfig.kt index d1ab4acd2f..b4aa6d39eb 100644 --- a/core/src/main/kotlin/org/evomaster/core/EMConfig.kt +++ b/core/src/main/kotlin/org/evomaster/core/EMConfig.kt @@ -3520,15 +3520,15 @@ class EMConfig { * Some might be experimental, while others might be explicitly excluded by the user */ fun isEnabledFaultCategory(category: FaultCategory) : Boolean{ - if(category == DefinedFaultCategory.XSS && (!xss || !security)){ + if(category == DefinedFaultCategory.SECURITY_XSS && (!xss || !security)){ return false } - if(category == DefinedFaultCategory.SQL_INJECTION && (!sqli || !security)){ + if(category == DefinedFaultCategory.SECURITY_SQL_INJECTION && (!sqli || !security)){ return false } - if(category == DefinedFaultCategory.SSRF && (!ssrf || !security)){ + if(category == DefinedFaultCategory.SECURITY_SSRF && (!ssrf || !security)){ return false } diff --git a/core/src/main/kotlin/org/evomaster/core/problem/enterprise/ExperimentalFaultCategory.kt b/core/src/main/kotlin/org/evomaster/core/problem/enterprise/ExperimentalFaultCategory.kt index 672c4dbbd0..ad4b452e90 100644 --- a/core/src/main/kotlin/org/evomaster/core/problem/enterprise/ExperimentalFaultCategory.kt +++ b/core/src/main/kotlin/org/evomaster/core/problem/enterprise/ExperimentalFaultCategory.kt @@ -11,46 +11,9 @@ enum class ExperimentalFaultCategory( //9xx for experimental, work-in-progress oracles - HTTP_NONWORKING_DELETE(900,"Resource Still Accessible After Successful DELETE", "deleteDoesNotWork", - "If a resource is deleted, and the API responds that such request was successful, then such" + - " resource should no longer being available." + - " New requests to access it should fail." + - " Otherwise, if it is still possible to access the resource, then it was not really deleted." + - " Then, as such, it means that the delete operation is faulty."), - HTTP_SIDE_EFFECTS_FAILED_MODIFICATION(901, "A Failed PUT or PATCH Must Not Change The Resource", "sideEffectsFailedModification", - "TODO"), - HTTP_REPEATED_CREATE_PUT(902, "Repeated PUT Creates Resource With 201 Instead of Updating", "repeatedCreatePut", - "TODO"), - HTTP_MISLEADING_CREATE_PUT(903, "Misleading PUT 201 Creates When Resource Already Exists", "misleadingCreatePut", - "TODO"), - HTTP_PARTIAL_UPDATE_PUT(904, "The Verb PUT Must Make a Full Replacement", "partialUpdatePut", - "TODO"), - HTTP_NON_IDEMPOTENT_PUT(905, "PUT Implementation Must be Idempotent", "nonIdempotentPut", - "TODO"), - HTTP_INVALID_MERGE_PATCH(906, "Invalid JSON Merge Patch", "invalidMergePatch", - "TODO"), - HTTP_INVALID_LOCATION(907, "Invalid Location HTTP Header", "returnsInvalidLocationHeader", - "TODO"), - HTTP_INVALID_ALLOW(908, "Invalid Allow HTTP Header", "invalidAllow", - "TODO"), - HTTP_TIMEOUT(909, "Request Timeout", "requestTimeout", "TODO"), - - HTTP_STATUS_NO_NON_STANDARD_CODES(950, "HTTP/REST-Design Violation: no-non-standard-codes", "invalidStatusCode", "TODO"), - HTTP_STATUS_NO_201_IF_DELETE(951, "HTTP/REST-Design Violation: no-201-if-delete", "201OnDelete", "TODO"), - HTTP_STATUS_NO_201_IF_GET(952, "HTTP/REST-Design Violation: no-201-if-get", "201OnGet", "TODO"), - HTTP_STATUS_NO_201_IF_PATCH(953, "HTTP/REST-Design Violation: no-201-if-patch", "201OnPatch", "TODO"), - HTTP_STATUS_NO_204_IF_CONTENT(954, "HTTP/REST-Design Violation: no-204-if-content", "204WhenContent", "TODO"), - HTTP_STATUS_NO_413_IF_NO_PAYLOAD(955, "HTTP/REST-Design Violation: no-413-if-no-payload", "413WhenNoPayload", "TODO"), - HTTP_STATUS_NO_415_IF_NO_PAYLOAD(956, "HTTP/REST-Design Violation: no-415-if-no-payload", "415WhenNoPayload", "TODO"), - HTTP_STATUS_NO_401_IF_NO_AUTH(957, "HTTP/REST-Design Violation: no-401-if-no-auth", "401WhenNoAuth", "TODO"), - HTTP_STATUS_NO_403_IF_NO_401(958, "HTTP/REST-Design Violation: no-403-if-no-401", "403WhenNo401", "TODO"), - HTTP_STATUS_HAS_406_IF_ACCEPT(959, "HTTP/REST-Design Violation: has-406-if-accept", "406WhenValid", "TODO"), - HTTP_STATUS_NO_304_IF_NO_GET_OR_HEAD(960, "HTTP/REST-Design Violation: no-304-if-no-get-or-head", "304OnWrongVerb", "TODO"), - HTTP_STATUS_NO_401_IF_NO_WWW_AUTHENTICATE(961, "HTTP/REST-Design Violation: no-401-if-no-authenticate", "401MissingWwwAuthenticate", "TODO"), - HTTP_STATUS_NO_405_IF_NO_ALLOW(962, "HTTP/REST-Design Violation: no-405-if-no-allow", "405MissingAllow", "TODO"), - HTTP_STATUS_NO_501_IF_IMPLEMENTED(963, "HTTP/REST-Design Violation: no-501-if-implemented", "501OnDeclaredEndpoint", "TODO"), - HTTP_STATUS_NO_205_IF_CONTENT(964,"HTTP/REST-Design Violation: no-205-if-content","205WhenContent", "TODO"), - HTTP_STATUS_NO_426_IF_NO_UPGRADE(965,"HTTP/REST-Design Violation: no-426-if-no-upgrade","426MissingUpgrade", "TODO"), + + //Implemented + HTTP_TIMEOUT(960, "Request Timeout", "requestTimeout", "TODO"), /* @@ -58,34 +21,36 @@ enum class ExperimentalFaultCategory( old comment was: syntactically invalid response (eg, non-quoted text when expecting JSON. this happens in pet-clinic for example) */ - HTTP_INVALID_PAYLOAD_SYNTAX(929, "Invalid Payload Syntax", "rejectedWithInvalidPayloadSyntax", + HTTP_INVALID_PAYLOAD_SYNTAX(961, "Invalid Payload Syntax", "rejectedWithInvalidPayloadSyntax", "TODO"), - //3xx: GraphQL - GQL_ERROR_FIELD(930, "Error Field", "returnedErrors", - "TODO"), - //4xx: RPC + //RPC // RPC internal error, eg thrift application internal error exception - RPC_INTERNAL_ERROR(940, "Internal Error", "causesInternalError", + RPC_INTERNAL_ERROR(970, "Internal Error", "causesInternalError", "TODO"), // RPC service error which is customized by user - RPC_SERVICE_ERROR(941, "Service Error", "causesServiceError", + RPC_SERVICE_ERROR(971, "Service Error", "causesServiceError", "TODO"), // exception for RPC - RPC_DECLARED_EXCEPTION(942, "Declared Exception", "throwsExpectedException", + RPC_DECLARED_EXCEPTION(972, "Declared Exception", "throwsExpectedException", "TODO"), // unexpected exception for RPC - RPC_UNEXPECTED_EXCEPTION(943,"Unexpected Exception", "throwsUnexpectedException", + RPC_UNEXPECTED_EXCEPTION(973,"Unexpected Exception", "throwsUnexpectedException", "TODO"), // an RPC call which fails to achieve a successful business logic - RPC_HANDLED_ERROR(944,"Business Logic Error", "failsToExecuteCall", + RPC_HANDLED_ERROR(974,"Business Logic Error", "failsToExecuteCall", "TODO"), - //5xx: Web Frontend + //Web Frontend WEB_BROKEN_LINK(980, "Broken Link", "returnsBrokenLink", "TODO"), - //6xx: mobile + + //mobile + + //GraphQL + GQL_ERROR_FIELD(990, "Error Field", "returnedErrors", + "TODO"), ; diff --git a/core/src/main/kotlin/org/evomaster/core/problem/rest/oracle/HttpStatusOracle.kt b/core/src/main/kotlin/org/evomaster/core/problem/rest/oracle/HttpStatusOracle.kt index b1540301c8..4cd39fb311 100644 --- a/core/src/main/kotlin/org/evomaster/core/problem/rest/oracle/HttpStatusOracle.kt +++ b/core/src/main/kotlin/org/evomaster/core/problem/rest/oracle/HttpStatusOracle.kt @@ -1,5 +1,6 @@ package org.evomaster.core.problem.rest.oracle +import com.webfuzzing.commons.faults.DefinedFaultCategory import com.webfuzzing.commons.faults.FaultCategory import org.evomaster.core.problem.enterprise.ExperimentalFaultCategory import org.evomaster.core.problem.rest.data.HttpVerb @@ -52,26 +53,26 @@ object HttpStatusOracle { ?: return faults // all oracles depend on checking the status code if(status !in 100..599){ - faults.add(ExperimentalFaultCategory.HTTP_STATUS_NO_NON_STANDARD_CODES) + faults.add(DefinedFaultCategory.HTTP_STATUS_NO_NON_STANDARD_CODES) } val verb = call.verb if(status == 201){ when(verb){ - HttpVerb.GET -> faults.add(ExperimentalFaultCategory.HTTP_STATUS_NO_201_IF_GET) - HttpVerb.DELETE -> faults.add(ExperimentalFaultCategory.HTTP_STATUS_NO_201_IF_DELETE) - HttpVerb.PATCH -> faults.add(ExperimentalFaultCategory.HTTP_STATUS_NO_201_IF_PATCH) + HttpVerb.GET -> faults.add(DefinedFaultCategory.HTTP_STATUS_NO_201_IF_GET) + HttpVerb.DELETE -> faults.add(DefinedFaultCategory.HTTP_STATUS_NO_201_IF_DELETE) + HttpVerb.PATCH -> faults.add(DefinedFaultCategory.HTTP_STATUS_NO_201_IF_PATCH) else -> {} } } if(status == 204 && result.hasBody()){ - faults.add(ExperimentalFaultCategory.HTTP_STATUS_NO_204_IF_CONTENT) + faults.add(DefinedFaultCategory.HTTP_STATUS_NO_204_IF_CONTENT) } if(status == 205 && result.hasBody()){ - faults.add(ExperimentalFaultCategory.HTTP_STATUS_NO_205_IF_CONTENT) + faults.add(DefinedFaultCategory.HTTP_STATUS_NO_205_IF_CONTENT) } val bodyParam = call.parameters.filterIsInstance() @@ -80,43 +81,43 @@ object HttpStatusOracle { val hasBody = bodyParam != null && bodyParam.primaryGene().getValueAsRawString().isNotEmpty() if(status == 304 && (verb != HttpVerb.GET && verb != HttpVerb.HEAD)){ - faults.add(ExperimentalFaultCategory.HTTP_STATUS_NO_304_IF_NO_GET_OR_HEAD) + faults.add(DefinedFaultCategory.HTTP_STATUS_NO_304_IF_NO_GET_OR_HEAD) } if(status == 401 && !SchemaUtils.hasAuthDefinition(schema)){ - faults.add(ExperimentalFaultCategory.HTTP_STATUS_NO_401_IF_NO_AUTH) + faults.add(DefinedFaultCategory.SCHEMA_STATUS_NO_401_IF_NO_AUTH) } if(status == 401 && result.getHeader("www-authenticate").isNullOrEmpty()){ - faults.add(ExperimentalFaultCategory.HTTP_STATUS_NO_401_IF_NO_WWW_AUTHENTICATE) + faults.add(DefinedFaultCategory.HTTP_STATUS_NO_401_IF_NO_WWW_AUTHENTICATE) } if(status == 403 && !SchemaUtils.getDeclaredStatusInResponse(call.endpoint, schema).contains(401)){ - faults.add(ExperimentalFaultCategory.HTTP_STATUS_NO_403_IF_NO_401) + faults.add(DefinedFaultCategory.SCHEMA_STATUS_NO_403_IF_NO_401) } if(status == 405 && result.getHeader("allow").isNullOrEmpty()){ - faults.add(ExperimentalFaultCategory.HTTP_STATUS_NO_405_IF_NO_ALLOW) + faults.add(DefinedFaultCategory.HTTP_STATUS_NO_405_IF_NO_ALLOW) } if(status == 406 && !call.isForRobustnessTesting()){ - faults.add(ExperimentalFaultCategory.HTTP_STATUS_HAS_406_IF_ACCEPT) + faults.add(DefinedFaultCategory.SCHEMA_STATUS_HAS_406_IF_ACCEPT) } if(status == 413 && !hasBody){ - faults.add(ExperimentalFaultCategory.HTTP_STATUS_NO_413_IF_NO_PAYLOAD) + faults.add(DefinedFaultCategory.HTTP_STATUS_NO_413_IF_NO_PAYLOAD) } if(status == 415 && !hasBody){ - faults.add(ExperimentalFaultCategory.HTTP_STATUS_NO_415_IF_NO_PAYLOAD) + faults.add(DefinedFaultCategory.HTTP_STATUS_NO_415_IF_NO_PAYLOAD) } if(status == 426 && result.getHeader("upgrade").isNullOrEmpty()){ - faults.add(ExperimentalFaultCategory.HTTP_STATUS_NO_426_IF_NO_UPGRADE) + faults.add(DefinedFaultCategory.HTTP_STATUS_NO_426_IF_NO_UPGRADE) } if(status == 501){ - faults.add(ExperimentalFaultCategory.HTTP_STATUS_NO_501_IF_IMPLEMENTED) + faults.add(DefinedFaultCategory.SCHEMA_STATUS_NO_501_IF_IMPLEMENTED) } return faults diff --git a/core/src/main/kotlin/org/evomaster/core/problem/rest/oracle/RestSecurityOracle.kt b/core/src/main/kotlin/org/evomaster/core/problem/rest/oracle/RestSecurityOracle.kt index 6223cc2ff1..0b878e9c72 100644 --- a/core/src/main/kotlin/org/evomaster/core/problem/rest/oracle/RestSecurityOracle.kt +++ b/core/src/main/kotlin/org/evomaster/core/problem/rest/oracle/RestSecurityOracle.kt @@ -118,7 +118,7 @@ class RestSecurityOracle { actionResults: List, fv: FitnessValue ) { - if (!config.isEnabledFaultCategory(DefinedFaultCategory.SSRF)) { + if (!config.isEnabledFaultCategory(DefinedFaultCategory.SECURITY_SSRF)) { return } @@ -127,12 +127,12 @@ class RestSecurityOracle { if (ar != null) { if (ar.getResultValue(HttpWsCallResult.VULNERABLE_SSRF).toBoolean()) { val scenarioId = idMapper.handleLocalTarget( - idMapper.getFaultDescriptiveId(DefinedFaultCategory.SSRF, it.getName()) + idMapper.getFaultDescriptiveId(DefinedFaultCategory.SECURITY_SSRF, it.getName()) ) fv.updateTarget(scenarioId, 1.0, it.positionAmongMainActions()) val paramName = ssrfAnalyser.getVulnerableParameterName(it) - ar.addFault(DetectedFault(DefinedFaultCategory.SSRF, it.getName(), paramName)) + ar.addFault(DetectedFault(DefinedFaultCategory.SECURITY_SSRF, it.getName(), paramName)) } } } @@ -219,7 +219,7 @@ class RestSecurityOracle { actionResults: List, fv: FitnessValue ) { - if (!config.isEnabledFaultCategory(DefinedFaultCategory.SQL_INJECTION)) { + if (!config.isEnabledFaultCategory(DefinedFaultCategory.SECURITY_SQL_INJECTION)) { return } @@ -273,10 +273,10 @@ class RestSecurityOracle { } val scenarioId = idMapper.handleLocalTarget( - idMapper.getFaultDescriptiveId(DefinedFaultCategory.SQL_INJECTION, actionWithPayload.getName()) + idMapper.getFaultDescriptiveId(DefinedFaultCategory.SECURITY_SQL_INJECTION, actionWithPayload.getName()) ) fv.updateTarget(scenarioId, 1.0, index) - injectedResult.addFault(DetectedFault(DefinedFaultCategory.SQL_INJECTION, actionWithPayload.getName(), null)) + injectedResult.addFault(DetectedFault(DefinedFaultCategory.SECURITY_SQL_INJECTION, actionWithPayload.getName(), null)) injectedResult.setVulnerableForSQLI(true) } @@ -397,7 +397,7 @@ class RestSecurityOracle { actionResults: List, fv: FitnessValue ) { - if(!config.isEnabledFaultCategory(DefinedFaultCategory.XSS)){ + if(!config.isEnabledFaultCategory(DefinedFaultCategory.SECURITY_XSS)){ return } @@ -422,10 +422,10 @@ class RestSecurityOracle { for(payload in XSS_PAYLOADS){ if(responseBody.contains(payload, ignoreCase = false)){ val scenarioId = idMapper.handleLocalTarget( - idMapper.getFaultDescriptiveId(DefinedFaultCategory.XSS, a.getName()) + idMapper.getFaultDescriptiveId(DefinedFaultCategory.SECURITY_XSS, a.getName()) ) fv.updateTarget(scenarioId, 1.0, index) - r.addFault(DetectedFault(DefinedFaultCategory.XSS, a.getName(), null)) + r.addFault(DetectedFault(DefinedFaultCategory.SECURITY_XSS, a.getName(), null)) break // Only add one fault per action } } diff --git a/core/src/main/kotlin/org/evomaster/core/problem/rest/service/HttpSemanticsService.kt b/core/src/main/kotlin/org/evomaster/core/problem/rest/service/HttpSemanticsService.kt index b51056160d..9df0f92945 100644 --- a/core/src/main/kotlin/org/evomaster/core/problem/rest/service/HttpSemanticsService.kt +++ b/core/src/main/kotlin/org/evomaster/core/problem/rest/service/HttpSemanticsService.kt @@ -1,6 +1,7 @@ package org.evomaster.core.problem.rest.service import com.google.inject.Inject +import com.webfuzzing.commons.faults.DefinedFaultCategory import org.evomaster.core.Lazy import org.evomaster.core.problem.enterprise.DetectedFaultUtils import org.evomaster.core.problem.enterprise.ExperimentalFaultCategory @@ -580,7 +581,7 @@ class HttpSemanticsService : TimeBoxedPhase{ val ei = prepareEvaluateAndSave(ind) if (ei != null && DetectedFaultUtils.getDetectedFaultCategories(ei) - .contains(ExperimentalFaultCategory.HTTP_INVALID_MERGE_PATCH)) { + .contains(DefinedFaultCategory.HTTP_INVALID_MERGE_PATCH)) { return@forEach } } diff --git a/core/src/main/kotlin/org/evomaster/core/problem/rest/service/RestSecurityBuilder.kt b/core/src/main/kotlin/org/evomaster/core/problem/rest/service/RestSecurityBuilder.kt index f971edc087..27aa251997 100644 --- a/core/src/main/kotlin/org/evomaster/core/problem/rest/service/RestSecurityBuilder.kt +++ b/core/src/main/kotlin/org/evomaster/core/problem/rest/service/RestSecurityBuilder.kt @@ -295,14 +295,14 @@ class RestSecurityBuilder : TimeBoxedPhase { private fun addForInjections() { - if (!config.isEnabledFaultCategory(DefinedFaultCategory.XSS)) { + if (!config.isEnabledFaultCategory(DefinedFaultCategory.SECURITY_XSS)) { log.debug("Skipping security test for XSS as disabled in configuration") } else { if(hasPhaseTimedOut()) return handleXSSCheck() } - if (!config.isEnabledFaultCategory(DefinedFaultCategory.SQL_INJECTION)) { + if (!config.isEnabledFaultCategory(DefinedFaultCategory.SECURITY_SQL_INJECTION)) { log.debug("Skipping experimental security test for sql injection as disabled in configuration") } else { if(config.blackBox || sampler.isSUTUsingASQLDatabase()) { @@ -313,7 +313,7 @@ class RestSecurityBuilder : TimeBoxedPhase { } } - if (config.isEnabledFaultCategory(DefinedFaultCategory.SSRF)) { + if (config.isEnabledFaultCategory(DefinedFaultCategory.SECURITY_SSRF)) { if(hasPhaseTimedOut()) return ssrfAnalyser.apply() } @@ -487,7 +487,7 @@ class RestSecurityBuilder : TimeBoxedPhase { val faultsCategories = DetectedFaultUtils.getDetectedFaultCategories(evaluatedIndividual) - if(DefinedFaultCategory.SQL_INJECTION in faultsCategories){ + if(DefinedFaultCategory.SECURITY_SQL_INJECTION in faultsCategories){ val added = archive.addIfNeeded(evaluatedIndividual) assert(added) continue@mainloop @@ -1322,7 +1322,7 @@ class RestSecurityBuilder : TimeBoxedPhase { val faultsCategories = DetectedFaultUtils.getDetectedFaultCategories(evaluatedIndividual) - if(DefinedFaultCategory.XSS in faultsCategories){ + if(DefinedFaultCategory.SECURITY_XSS in faultsCategories){ archive.addIfNeeded(evaluatedIndividual) continue@mainloop } diff --git a/core/src/main/kotlin/org/evomaster/core/problem/rest/service/fitness/AbstractRestFitness.kt b/core/src/main/kotlin/org/evomaster/core/problem/rest/service/fitness/AbstractRestFitness.kt index 6013d22e9b..092842c542 100644 --- a/core/src/main/kotlin/org/evomaster/core/problem/rest/service/fitness/AbstractRestFitness.kt +++ b/core/src/main/kotlin/org/evomaster/core/problem/rest/service/fitness/AbstractRestFitness.kt @@ -892,7 +892,7 @@ abstract class AbstractRestFitness : HttpWsFitness() { responseClassifier.updateModel(a, rcr) } - if (config.isEnabledFaultCategory(DefinedFaultCategory.SSRF)) { + if (config.isEnabledFaultCategory(DefinedFaultCategory.SECURITY_SSRF)) { if (ssrfAnalyser.anyCallsMadeToHTTPVerifier(a)) { rcr.setVulnerableForSSRF(true) } @@ -1345,39 +1345,39 @@ abstract class AbstractRestFitness : HttpWsFitness() { } private fun analyzeHttpSemantics(individual: RestIndividual, actionResults: List, fv: FitnessValue) { - if(config.isEnabledFaultCategory(ExperimentalFaultCategory.HTTP_NONWORKING_DELETE)) { + if(config.isEnabledFaultCategory(DefinedFaultCategory.HTTP_NONWORKING_DELETE)) { handleDeleteShouldDelete(individual, actionResults, fv) } - if(config.isEnabledFaultCategory(ExperimentalFaultCategory.HTTP_REPEATED_CREATE_PUT)) { + if(config.isEnabledFaultCategory(DefinedFaultCategory.HTTP_REPEATED_CREATE_PUT)) { handleRepeatedCreatePut(individual, actionResults, fv) } - if(config.isEnabledFaultCategory(ExperimentalFaultCategory.HTTP_SIDE_EFFECTS_FAILED_MODIFICATION)) { + if(config.isEnabledFaultCategory(DefinedFaultCategory.HTTP_SIDE_EFFECTS_FAILED_MODIFICATION)) { handleFailedModification(individual, actionResults, fv) } - if(config.isEnabledFaultCategory(ExperimentalFaultCategory.HTTP_PARTIAL_UPDATE_PUT)) { + if(config.isEnabledFaultCategory(DefinedFaultCategory.HTTP_PARTIAL_UPDATE_PUT)) { handlePartialUpdatePut(individual, actionResults, fv) } - if(config.isEnabledFaultCategory(ExperimentalFaultCategory.HTTP_MISLEADING_CREATE_PUT)) { + if(config.isEnabledFaultCategory(DefinedFaultCategory.HTTP_MISLEADING_CREATE_PUT)) { handleMisleadingCreatePut(individual, actionResults, fv) } - if(config.isEnabledFaultCategory(ExperimentalFaultCategory.HTTP_NON_IDEMPOTENT_PUT)) { + if(config.isEnabledFaultCategory(DefinedFaultCategory.HTTP_NON_IDEMPOTENT_PUT)) { handleNonIdempotentPut(individual, actionResults, fv) } - if(config.isEnabledFaultCategory(ExperimentalFaultCategory.HTTP_INVALID_LOCATION)) { + if(config.isEnabledFaultCategory(DefinedFaultCategory.HTTP_INVALID_LOCATION)) { handleInvalidLocation(individual, actionResults, fv) } - if(config.isEnabledFaultCategory(ExperimentalFaultCategory.HTTP_INVALID_ALLOW)) { + if(config.isEnabledFaultCategory(DefinedFaultCategory.SCHEMA_INVALID_ALLOW)) { handleInvalidAllow(individual, actionResults, fv) } - if(config.isEnabledFaultCategory(ExperimentalFaultCategory.HTTP_INVALID_MERGE_PATCH)) { + if(config.isEnabledFaultCategory(DefinedFaultCategory.HTTP_INVALID_MERGE_PATCH)) { handleInvalidMergePatch(individual, actionResults, fv) } } @@ -1419,7 +1419,7 @@ abstract class AbstractRestFitness : HttpWsFitness() { } if (extra.isEmpty() && missing.isEmpty()) continue - val category = ExperimentalFaultCategory.HTTP_INVALID_ALLOW + val category = DefinedFaultCategory.SCHEMA_INVALID_ALLOW val scenarioId = idMapper.handleLocalTarget(idMapper.getFaultDescriptiveId(category, a.getName())) fv.updateTarget(scenarioId, 1.0, index) val localMessage = listOfNotNull( @@ -1448,7 +1448,7 @@ abstract class AbstractRestFitness : HttpWsFitness() { it.verb == HttpVerb.PUT || it.verb == HttpVerb.PATCH }.last() - val category = ExperimentalFaultCategory.HTTP_SIDE_EFFECTS_FAILED_MODIFICATION + val category = DefinedFaultCategory.HTTP_SIDE_EFFECTS_FAILED_MODIFICATION val scenarioId = idMapper.handleLocalTarget(idMapper.getFaultDescriptiveId(category, putOrPatch.getName())) fv.updateTarget(scenarioId, 1.0, individual.seeMainExecutableActions().lastIndex) @@ -1470,7 +1470,7 @@ abstract class AbstractRestFitness : HttpWsFitness() { val put = individual.seeMainExecutableActions().last() - val category = ExperimentalFaultCategory.HTTP_REPEATED_CREATE_PUT + val category = DefinedFaultCategory.HTTP_REPEATED_CREATE_PUT val scenarioId = idMapper.handleLocalTarget(idMapper.getFaultDescriptiveId(category, put.getName()) ) fv.updateTarget(scenarioId, 1.0, individual.seeMainExecutableActions().lastIndex) @@ -1494,7 +1494,7 @@ abstract class AbstractRestFitness : HttpWsFitness() { } if(res.nonWorking) { - val category = ExperimentalFaultCategory.HTTP_NONWORKING_DELETE + val category = DefinedFaultCategory.HTTP_NONWORKING_DELETE val scenarioId = idMapper.handleLocalTarget( idMapper.getFaultDescriptiveId(category, res.name) ) @@ -1518,7 +1518,7 @@ abstract class AbstractRestFitness : HttpWsFitness() { val put = individual.seeMainExecutableActions().filter { it.verb == HttpVerb.PUT }.last() - val category = ExperimentalFaultCategory.HTTP_PARTIAL_UPDATE_PUT + val category = DefinedFaultCategory.HTTP_PARTIAL_UPDATE_PUT val scenarioId = idMapper.handleLocalTarget(idMapper.getFaultDescriptiveId(category, put.getName())) fv.updateTarget(scenarioId, 1.0, individual.seeMainExecutableActions().lastIndex) @@ -1535,7 +1535,7 @@ abstract class AbstractRestFitness : HttpWsFitness() { val patch = individual.seeMainExecutableActions().filter { it.verb == HttpVerb.PATCH }.last() - val category = ExperimentalFaultCategory.HTTP_INVALID_MERGE_PATCH + val category = DefinedFaultCategory.HTTP_INVALID_MERGE_PATCH val scenarioId = idMapper.handleLocalTarget(idMapper.getFaultDescriptiveId(category, patch.getName())) fv.updateTarget(scenarioId, 1.0, individual.seeMainExecutableActions().lastIndex) @@ -1552,7 +1552,7 @@ abstract class AbstractRestFitness : HttpWsFitness() { val put = individual.seeMainExecutableActions().last() - val category = ExperimentalFaultCategory.HTTP_MISLEADING_CREATE_PUT + val category = DefinedFaultCategory.HTTP_MISLEADING_CREATE_PUT val scenarioId = idMapper.handleLocalTarget(idMapper.getFaultDescriptiveId(category, put.getName())) fv.updateTarget(scenarioId, 1.0, individual.seeMainExecutableActions().lastIndex) @@ -1571,7 +1571,7 @@ abstract class AbstractRestFitness : HttpWsFitness() { // sequence ends with: PUT, GET, PUT, GET — flag the 2nd PUT as the offending action val secondPut = actions[actions.size - 2] - val category = ExperimentalFaultCategory.HTTP_NON_IDEMPOTENT_PUT + val category = DefinedFaultCategory.HTTP_NON_IDEMPOTENT_PUT val scenarioId = idMapper.handleLocalTarget(idMapper.getFaultDescriptiveId(category, secondPut.getName())) fv.updateTarget(scenarioId, 1.0, actions.size - 2) @@ -1589,7 +1589,7 @@ abstract class AbstractRestFitness : HttpWsFitness() { val actions = individual.seeMainExecutableActions() val creator = actions[actions.size - 2] - val category = ExperimentalFaultCategory.HTTP_INVALID_LOCATION + val category = DefinedFaultCategory.HTTP_INVALID_LOCATION val scenarioId = idMapper.handleLocalTarget(idMapper.getFaultDescriptiveId(category, creator.getName())) fv.updateTarget(scenarioId, 1.0, actions.size - 2) diff --git a/core/src/main/kotlin/org/evomaster/core/problem/security/data/InputFaultMapping.kt b/core/src/main/kotlin/org/evomaster/core/problem/security/data/InputFaultMapping.kt index 8a37ce801b..d6bef2d793 100644 --- a/core/src/main/kotlin/org/evomaster/core/problem/security/data/InputFaultMapping.kt +++ b/core/src/main/kotlin/org/evomaster/core/problem/security/data/InputFaultMapping.kt @@ -18,6 +18,6 @@ class InputFaultMapping( } fun hasSSRFFaults(): Boolean { - return securityFaults.contains(DefinedFaultCategory.SSRF) + return securityFaults.contains(DefinedFaultCategory.SECURITY_SSRF) } } diff --git a/core/src/main/kotlin/org/evomaster/core/problem/security/service/SSRFAnalyser.kt b/core/src/main/kotlin/org/evomaster/core/problem/security/service/SSRFAnalyser.kt index 1bb03b84ed..9353d8d206 100644 --- a/core/src/main/kotlin/org/evomaster/core/problem/security/service/SSRFAnalyser.kt +++ b/core/src/main/kotlin/org/evomaster/core/problem/security/service/SSRFAnalyser.kt @@ -173,8 +173,8 @@ class SSRFAnalyser { } if (answer) { - paramMapping.addSecurityFaultCategory(DefinedFaultCategory.SSRF) - actionFaultMapping.addSecurityFaultCategory(DefinedFaultCategory.SSRF) + paramMapping.addSecurityFaultCategory(DefinedFaultCategory.SECURITY_SSRF) + actionFaultMapping.addSecurityFaultCategory(DefinedFaultCategory.SECURITY_SSRF) actionFaultMapping.isVulnerable = true } } @@ -323,7 +323,7 @@ class SSRFAnalyser { val result = httpCallbackVerifier.verify(action.getName()) if (result) { val actionMapping = actionVulnerabilityMapping.getValue(action.getName()) - actionMapping.addSecurityFaultCategory(DefinedFaultCategory.SSRF) + actionMapping.addSecurityFaultCategory(DefinedFaultCategory.SECURITY_SSRF) // Create a testing target archive.addIfNeeded(executedIndividual) } @@ -333,7 +333,7 @@ class SSRFAnalyser { if (actionVulnerabilityMapping.containsKey(actionName)) { val g = actionVulnerabilityMapping[actionName]!!.params[gene.name] if (g != null) { - if (g.securityFaults.contains(DefinedFaultCategory.SSRF)) { + if (g.securityFaults.contains(DefinedFaultCategory.SECURITY_SSRF)) { // Only change the param marked for SSRF // This updates the children also recursively gene.setFromStringValue(callBackUrl) diff --git a/core/src/main/kotlin/org/evomaster/core/search/Solution.kt b/core/src/main/kotlin/org/evomaster/core/search/Solution.kt index 0e51e89118..21a1ac5150 100644 --- a/core/src/main/kotlin/org/evomaster/core/search/Solution.kt +++ b/core/src/main/kotlin/org/evomaster/core/search/Solution.kt @@ -63,7 +63,7 @@ where T : Individual { fun hasSsrfFaults(): Boolean { return DetectedFaultUtils.getDetectedFaultCategories(this).any { - it == DefinedFaultCategory.SSRF + it == DefinedFaultCategory.SECURITY_SSRF } } diff --git a/core/src/test/kotlin/org/evomaster/core/output/naming/RestActionNamingStrategyTest.kt b/core/src/test/kotlin/org/evomaster/core/output/naming/RestActionNamingStrategyTest.kt index 30aed35981..874957f17a 100644 --- a/core/src/test/kotlin/org/evomaster/core/output/naming/RestActionNamingStrategyTest.kt +++ b/core/src/test/kotlin/org/evomaster/core/output/naming/RestActionNamingStrategyTest.kt @@ -208,7 +208,7 @@ open class RestActionNamingStrategyTest { fun testResponseNamedWithMultipleFaults() { val faults = listOf( DetectedFault(ExperimentalFaultCategory.GQL_ERROR_FIELD, "items", null), - DetectedFault(ExperimentalFaultCategory.HTTP_INVALID_LOCATION, "items", null), + DetectedFault(DefinedFaultCategory.HTTP_INVALID_LOCATION, "items", null), DetectedFault(DefinedFaultCategory.HTTP_STATUS_500, "items", null)) val restAction = getRestCallAction() val eIndividual = getEvaluatedIndividualWithFaults(restAction, faults, 500) diff --git a/pom.xml b/pom.xml index 93f2160279..0359f06c50 100644 --- a/pom.xml +++ b/pom.xml @@ -222,7 +222,7 @@ 17 2.2.20 true - 0.7.0 + 0.8.0 5.14.2 1.14.2 3.1.5