createTest method

Future<CreateTestResponse> createTest({
  1. required String serviceArn,
  2. required String testTemplateArn,
  3. LoggingConfiguration? loggingConfiguration,
  4. Map<String, List<String>>? parameters,
  5. String? roleName,
  6. List<StopCondition>? stopConditions,
})

Creates a test for a service by configuring a test template. Each service has one test per template.

May throw AccessDeniedException. May throw ConflictException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ValidationException.

Parameter serviceArn : The ARN of the service to create the test for.

Parameter testTemplateArn : The ARN of the test template to configure.

Parameter loggingConfiguration : The logging configuration for the test.

Parameter parameters : The parameter values for the test.

Parameter roleName : The name of the IAM execution role to use when running the test.

Parameter stopConditions : The stop conditions for the test.

Implementation

Future<CreateTestResponse> createTest({
  required String serviceArn,
  required String testTemplateArn,
  LoggingConfiguration? loggingConfiguration,
  Map<String, List<String>>? parameters,
  String? roleName,
  List<StopCondition>? stopConditions,
}) async {
  final $payload = <String, dynamic>{
    'serviceArn': serviceArn,
    'testTemplateArn': testTemplateArn,
    if (loggingConfiguration != null)
      'loggingConfiguration': loggingConfiguration,
    if (parameters != null) 'parameters': parameters,
    if (roleName != null) 'roleName': roleName,
    if (stopConditions != null) 'stopConditions': stopConditions,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/v2/create-test',
    exceptionFnMap: _exceptionFns,
  );
  return CreateTestResponse.fromJson(response);
}