diff --git a/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/main/kotlin/com/foo/rest/examples/spring/openapi/v3/flakinessdetect/FlakinessDetectRest.kt b/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/main/kotlin/com/foo/rest/examples/spring/openapi/v3/flakinessdetect/FlakinessDetectRest.kt index 7996b5b345..09ee1ce9fa 100644 --- a/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/main/kotlin/com/foo/rest/examples/spring/openapi/v3/flakinessdetect/FlakinessDetectRest.kt +++ b/core-tests/e2e-tests/spring/spring-rest-openapi-v3/src/main/kotlin/com/foo/rest/examples/spring/openapi/v3/flakinessdetect/FlakinessDetectRest.kt @@ -9,6 +9,7 @@ import org.springframework.web.bind.annotation.RequestParam import org.springframework.web.bind.annotation.RestController import java.time.LocalDateTime import java.time.format.DateTimeFormatter +import java.util.UUID import kotlin.math.abs import kotlin.math.max import kotlin.math.min @@ -19,6 +20,18 @@ class FlakinessDetectRest { companion object{ val formatter = DateTimeFormatter.ofPattern("HH:mm:ss.SSS yyyy-MM-dd EEEE 'Week' ww") + private val START_UP_OBJECT_TAG = arrayOf(javax.validation.constraints.Pattern.Flag.CASE_INSENSITIVE).toString() + } + @GetMapping(path = ["/objectFlag"]) + open fun getEmptyFlag() : ResponseEntity { + + return ResponseEntity.ok(START_UP_OBJECT_TAG) + } + + @GetMapping(path = ["/stringuuid"]) + open fun getStringuuid() : ResponseEntity{ + + return ResponseEntity.ok( UUID.randomUUID().toString()) } @GetMapping(path = ["/stringfirst/{n}"]) @@ -88,4 +101,6 @@ data class FlakinessDetectData( data class TimeAgoData( val message: String, val calculatedPastTime: String -) \ No newline at end of file +) + +class EmptyForFlag(val flag: String) \ No newline at end of file diff --git a/core/src/main/kotlin/org/evomaster/core/search/service/FlakinessDetector.kt b/core/src/main/kotlin/org/evomaster/core/search/service/FlakinessDetector.kt index 7793a8d641..ba200cb5b3 100644 --- a/core/src/main/kotlin/org/evomaster/core/search/service/FlakinessDetector.kt +++ b/core/src/main/kotlin/org/evomaster/core/search/service/FlakinessDetector.kt @@ -104,7 +104,7 @@ class FlakinessDetector { } else { val normO = derive(oBody) if (rBody != normO) { - resultToUpdate.setFlakyBody(oBody) + resultToUpdate.setFlakyBody(normO) } } } @@ -132,7 +132,7 @@ class FlakinessDetector { */ val normO = derive(oMsg) if (rMsg != normO) { - resultToUpdate.setFlakyErrorMessage(oMsg) + resultToUpdate.setFlakyErrorMessage(normO) } } } diff --git a/core/src/main/kotlin/org/evomaster/core/utils/FlakinessInferenceUtil.kt b/core/src/main/kotlin/org/evomaster/core/utils/FlakinessInferenceUtil.kt index 191094ffa6..37e7c9d7ea 100644 --- a/core/src/main/kotlin/org/evomaster/core/utils/FlakinessInferenceUtil.kt +++ b/core/src/main/kotlin/org/evomaster/core/utils/FlakinessInferenceUtil.kt @@ -66,7 +66,7 @@ object FlakinessInferenceUtil { /** * Match JVM object toString like com.foo.Bar@1a2b3c. */ - private val OBJECT_AT_REGEX = Regex("[A-Za-z0-9_.$]+@[0-9a-fA-F]+") + private val OBJECT_AT_REGEX = Regex("""[\[A-Za-z0-9_.$;]+@[0-9a-fA-F]+""") /** * Match hex pointers like 0x1a2b3c.