-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement downloadedFileAssertion step
- Loading branch information
Showing
4 changed files
with
198 additions
and
12 deletions.
There are no files selected for viewing
44 changes: 44 additions & 0 deletions
44
src/main/kotlin/com/personio/synthetics/model/assertion/DownloadedFileAssertionParams.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package com.personio.synthetics.model.assertion | ||
|
||
import com.datadog.api.v1.client.model.SyntheticsCheckType | ||
import com.personio.synthetics.model.Params | ||
|
||
internal data class DownloadedFileAssertionParams( | ||
val file: File, | ||
) : Params() | ||
|
||
internal data class File( | ||
val nameCheck: NameCheck? = null, | ||
val sizeCheck: SizeCheck? = null, | ||
val md5: String? = null, | ||
) : Params() | ||
|
||
internal data class NameCheck( | ||
val type: String, | ||
val value: String?, | ||
) : Params() | ||
|
||
internal data class SizeCheck( | ||
val type: String, | ||
val value: Int, | ||
) : Params() | ||
|
||
enum class FileNameCheckType(val value: SyntheticsCheckType) { | ||
NOT_CONTAINS(SyntheticsCheckType.NOT_CONTAINS), | ||
IS_EMPTY(SyntheticsCheckType.IS_EMPTY), | ||
STARTS_WITH(SyntheticsCheckType.STARTS_WITH), | ||
NOT_EQUALS(SyntheticsCheckType.NOT_EQUALS), | ||
NOT_IS_EMPTY(SyntheticsCheckType.NOT_IS_EMPTY), | ||
CONTAINS(SyntheticsCheckType.CONTAINS), | ||
MATCH_REGEX(SyntheticsCheckType.MATCH_REGEX), | ||
EQUALS(SyntheticsCheckType.EQUALS), | ||
NOT_STARTS_WITH(SyntheticsCheckType.NOT_STARTS_WITH), | ||
} | ||
|
||
enum class FileSizeCheckType(val value: SyntheticsCheckType) { | ||
LOWER(SyntheticsCheckType.LOWER), | ||
GREATER(SyntheticsCheckType.GREATER), | ||
NOT_EQUALS(SyntheticsCheckType.NOT_EQUALS), | ||
GREATER_EQUALS(SyntheticsCheckType.GREATER_EQUALS), | ||
LOWER_EQUALS(SyntheticsCheckType.LOWER_EQUALS), | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters