Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public void testDeterminismOfLog(boolean enableConstraintHandling){
OpenAPI schema = (new OpenAPIParser()).readLocation("swagger-ahm/ahm.json", null, null).getOpenAPI();
isDeterminismConsumer( new ArrayList<>(), (args) -> RestActionBuilderV3.INSTANCE
.getModelsFromSwagger(schema, new LinkedHashMap<>(),
new RestActionBuilderV3.Options(false,enableConstraintHandling,false,0.0,0.0,true,false,false)));
new RestActionBuilderV3.Options(false,enableConstraintHandling,false,0.0,0.0,true,false,false,true)));
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public void testDeterminismOfLog(boolean enableConstraintHandling){
OpenAPI schema = (new OpenAPIParser()).readLocation("swagger-ahm/ahm.json", null, null).getOpenAPI();
isDeterminismConsumer( new ArrayList<>(), (args) -> {
RestActionBuilderV3.INSTANCE.getModelsFromSwagger(schema, new LinkedHashMap<>(),
new RestActionBuilderV3.Options(false,enableConstraintHandling,false,0.0,0.0,true,false,false));
new RestActionBuilderV3.Options(false,enableConstraintHandling,false,0.0,0.0,true,false,false,true));
});
}

Expand Down
4 changes: 4 additions & 0 deletions core/src/main/kotlin/org/evomaster/core/EMConfig.kt
Original file line number Diff line number Diff line change
Expand Up @@ -1378,6 +1378,10 @@ class EMConfig {
"Only available for JVM languages")
var dtoForRequestPayload = false

@Experimental
@Cfg("Enable multipart/form-data support when building REST actions.")
var enableMultipartFormDataSupport = false

@Important(6.0)
@Cfg("Host name or IP address of where the SUT EvoMaster Controller Driver is listening on." +
" This option is only needed for white-box testing.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ object RestActionBuilderV3 {
val enableAdvancedFormats: Boolean = true,

val inferFormatFromNames: Boolean = true,

val enableMultipartFormDataSupport: Boolean = false,
){
constructor(config: EMConfig): this(
enableConstraintHandling = config.enableSchemaConstraintHandling,
Expand All @@ -125,7 +127,8 @@ object RestActionBuilderV3 {
probUseExamples = config.probRestExamples,
usingWhiteBox = !config.blackBox,
enableAdvancedFormats = config.enableAdvancedFormats,
inferFormatFromNames = config.inferFormatFromNames
inferFormatFromNames = config.inferFormatFromNames,
enableMultipartFormDataSupport = config.enableMultipartFormDataSupport,
)

init {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@ class RestActionBuilderV3Test{
RestActionBuilderV3.cleanCache()
}

@Test
fun testMultipartFormDataSupportOptionDefaultsToDisabled(){
val config = EMConfig()

assertFalse(config.enableMultipartFormDataSupport)
assertFalse(RestActionBuilderV3.Options(config).enableMultipartFormDataSupport)
assertTrue(RestActionBuilderV3.Options(enableMultipartFormDataSupport = true).enableMultipartFormDataSupport)
}

@Test
fun testDtoIssueWithWronglyHandledField(){
Expand Down
1 change: 1 addition & 0 deletions docs/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@ There are 3 types of options:
|`enableAdvancedFormats`| __Boolean__. Whether to enable the handling of new type formats in OpenAPI schemas, e.g., the ones introduced in 3.1.0. *Default value*: `false`.|
|`enableCustomizedMethodForMockObjectHandling`| __Boolean__. Whether to apply customized method (i.e., implement 'customizeMockingRPCExternalService' for external services or 'customizeMockingDatabase' for database) to handle mock object. *Default value*: `false`.|
|`enableCustomizedMethodForScheduleTaskHandling`| __Boolean__. Whether to apply customized method (i.e., implement 'customizeScheduleTaskInvocation' for invoking schedule task) to invoke schedule task. *Default value*: `false`.|
|`enableMultipartFormDataSupport`| __Boolean__. Enable multipart/form-data support when building REST actions. *Default value*: `false`.|
|`enableRPCCustomizedTestOutput`| __Boolean__. Whether to enable customized RPC Test output if 'customizeRPCTestOutput' is implemented. *Default value*: `false`.|
|`enableStaticFlakyInference`| __Boolean__. Specify whether to infer potential flakiness statically from response values, such as timestamps, UUIDs, hashes and runtime-specific messages. *Depends on*: `handleFlakiness=true`. *Default value*: `true`.|
|`enableWriteSnapshotTests`| __Boolean__. Enable to print snapshots of the generated tests during the search in an interval defined in snapshotsInterval. *Default value*: `false`.|
Expand Down
Loading