Skip to content

Commit

Permalink
Bump com.datadoghq:datadog-api-client from 2.30.0 to 2.31.0
Browse files Browse the repository at this point in the history
Bumps [com.datadoghq:datadog-api-client](https://github.com/DataDog/datadog-api-client-java) from 2.30.0 to 2.31.0.
- [Release notes](https://github.com/DataDog/datadog-api-client-java/releases)
- [Changelog](https://github.com/DataDog/datadog-api-client-java/blob/master/CHANGELOG.md)
- [Commits](DataDog/datadog-api-client-java@datadog-api-client-2.30.0...datadog-api-client-2.31.0)

---
updated-dependencies:
- dependency-name: com.datadoghq:datadog-api-client
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
  • Loading branch information
dependabot[bot] authored and azzmiks committed Jan 10, 2025
1 parent 9d3548c commit 3cdc982
Show file tree
Hide file tree
Showing 11 changed files with 41 additions and 20 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ dependencies {
api("software.amazon.awssdk:secretsmanager:$awsSdkVersion")
api("org.jetbrains.kotlinx:kotlinx-serialization-json:1.7.3")
api("javax.activation:activation:1.1.1")
api("com.datadoghq:datadog-api-client:2.30.0")
api("com.datadoghq:datadog-api-client:2.31.0")
testRuntimeOnly("software.amazon.awssdk:sso:$awsSdkVersion")
testRuntimeOnly("software.amazon.awssdk:sts:$awsSdkVersion")
testImplementation("org.junit.jupiter:junit-jupiter-api:$junitVersion")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import com.datadog.api.client.v1.model.SyntheticsBrowserTestConfig
import com.datadog.api.client.v1.model.SyntheticsBrowserTestType
import com.datadog.api.client.v1.model.SyntheticsBrowserVariable
import com.datadog.api.client.v1.model.SyntheticsBrowserVariableType
import com.datadog.api.client.v1.model.SyntheticsDeviceID
import com.datadog.api.client.v1.model.SyntheticsStep
import com.datadog.api.client.v1.model.SyntheticsTestRequest
import com.personio.synthetics.builder.browser.StepsBuilder
import com.personio.synthetics.client.SyntheticsApiClient
import com.personio.synthetics.config.Defaults
import com.personio.synthetics.model.config.SyntheticsDeviceID
import java.net.URL
import kotlin.time.Duration
import kotlin.time.Duration.Companion.days
Expand Down Expand Up @@ -82,7 +82,7 @@ class SyntheticBrowserTestBuilder(
* @param deviceIds Pass comma separated browsers and devices to the test config derived from SyntheticsDeviceID class
*/
fun browsersAndDevices(vararg deviceIds: SyntheticsDeviceID) {
options.deviceIds = deviceIds.map { it }
options.deviceIds = deviceIds.map { it.value }
}

/**
Expand All @@ -94,7 +94,7 @@ class SyntheticBrowserTestBuilder(
replaceWith = ReplaceWith("browsersAndDevices(*deviceIds)"),
)
fun browserAndDevice(vararg deviceIds: SyntheticsDeviceID) {
options.deviceIds = deviceIds.map { it }
options.deviceIds = deviceIds.map { it.value }
}

fun steps(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.personio.synthetics.builder

import com.datadog.api.client.v1.model.SyntheticsDeviceID
import com.datadog.api.client.v1.model.SyntheticsTestOptions
import com.datadog.api.client.v1.model.SyntheticsTestOptionsMonitorOptions
import com.datadog.api.client.v1.model.SyntheticsTestOptionsRetry
Expand All @@ -13,6 +12,7 @@ import com.personio.synthetics.domain.SyntheticTestParameters
import com.personio.synthetics.model.config.Location
import com.personio.synthetics.model.config.MonitorPriority
import com.personio.synthetics.model.config.RenotifyInterval
import com.personio.synthetics.model.config.SyntheticsDeviceID
import com.personio.synthetics.model.config.Timeframe
import java.time.ZoneId
import java.time.temporal.ChronoUnit
Expand Down Expand Up @@ -46,7 +46,7 @@ abstract class SyntheticTestBuilder(

options =
SyntheticsTestOptions()
.addDeviceIdsItem(SyntheticsDeviceID.CHROME_LAPTOP_LARGE)
.addDeviceIdsItem(SyntheticsDeviceID.CHROME_LAPTOP_LARGE.toString())
.tickEvery(defaults.testFrequency / 1000)
.minFailureDuration(defaults.minFailureDuration / 1000)
.minLocationFailed(defaults.minLocationFailed)
Expand Down
4 changes: 2 additions & 2 deletions src/main/kotlin/com/personio/synthetics/client/BrowserTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package com.personio.synthetics.client

import com.datadog.api.client.v1.model.SyntheticsBrowserTest
import com.datadog.api.client.v1.model.SyntheticsBrowserTestConfig
import com.datadog.api.client.v1.model.SyntheticsDeviceID
import com.datadog.api.client.v1.model.SyntheticsTestOptions
import com.datadog.api.client.v1.model.SyntheticsTestOptionsMonitorOptions
import com.datadog.api.client.v1.model.SyntheticsTestOptionsRetry
Expand All @@ -11,6 +10,7 @@ import com.datadog.api.client.v1.model.SyntheticsUpdateTestPauseStatusPayload
import com.personio.synthetics.config.Config
import com.personio.synthetics.config.Defaults
import com.personio.synthetics.config.loadConfiguration
import com.personio.synthetics.model.config.SyntheticsDeviceID

/**
* Creates a synthetic browser test with the added configurations (if any) and steps in Datadog
Expand Down Expand Up @@ -118,7 +118,7 @@ class BrowserTest(

private fun defaultSyntheticsTestOptions(): SyntheticsTestOptions =
SyntheticsTestOptions()
.addDeviceIdsItem(SyntheticsDeviceID.CHROME_LAPTOP_LARGE)
.addDeviceIdsItem(SyntheticsDeviceID.CHROME_LAPTOP_LARGE.toString())
.tickEvery(defaultSettings.testFrequency / 1000)
.minFailureDuration(defaultSettings.minFailureDuration / 1000)
.minLocationFailed(defaultSettings.minLocationFailed)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ package com.personio.synthetics.config
* @see com.personio.synthetics.builder.SyntheticTestBuilder
*/

import com.datadog.api.client.v1.model.SyntheticsDeviceID
import com.datadog.api.client.v1.model.SyntheticsTestOptionsScheduling
import com.datadog.api.client.v1.model.SyntheticsTestOptionsSchedulingTimeframe
import com.datadog.api.client.v1.model.SyntheticsTestRequest
import com.personio.synthetics.client.BrowserTest
import com.personio.synthetics.model.config.Location
import com.personio.synthetics.model.config.MonitorPriority
import com.personio.synthetics.model.config.RenotifyInterval
import com.personio.synthetics.model.config.SyntheticsDeviceID
import com.personio.synthetics.model.config.Timeframe
import java.net.URL
import java.time.ZoneId
Expand Down Expand Up @@ -178,5 +178,5 @@ fun BrowserTest.publicLocation(vararg locationItems: Location) =
*/
fun BrowserTest.browserAndDevice(vararg deviceIds: SyntheticsDeviceID) =
apply {
options.deviceIds = deviceIds.map { it }
options.deviceIds = deviceIds.map { it.value }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.personio.synthetics.model.config

enum class SyntheticsDeviceID(val value: String) {
CHROME_LAPTOP_LARGE("chrome.laptop_large"),
CHROME_TABLET("chrome.tablet"),
CHROME_MOBILE_SMALL("chrome.mobile_small"),

FIREFOX_LAPTOP_LARGE("firefox.laptop_large"),
FIREFOX_TABLET("firefox.tablet"),
FIREFOX_MOBILE_SMALL("firefox.mobile_small"),

EDGE_LAPTOP_LARGE("edge.laptop_large"),
EDGE_TABLET("edge.tablet"),
EDGE_MOBILE_SMALL("edge.mobile_small"),
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package com.personio.synthetics.builder

import com.datadog.api.client.v1.model.SyntheticsDeviceID
import com.datadog.api.client.v1.model.SyntheticsStep
import com.datadog.api.client.v1.model.SyntheticsTestPauseStatus
import com.personio.synthetics.TEST_STEP_NAME
import com.personio.synthetics.builder.browser.StepsBuilder
import com.personio.synthetics.client.SyntheticsApiClient
import com.personio.synthetics.config.getConfigFromFile
import com.personio.synthetics.model.config.Location
import com.personio.synthetics.model.config.SyntheticsDeviceID
import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.BeforeEach
import org.junit.jupiter.api.Test
Expand Down Expand Up @@ -96,7 +96,7 @@ class SyntheticBrowserTestBuilderTest {
val result = testBuilder.build()

assertEquals(
listOf(SyntheticsDeviceID.CHROME_TABLET, SyntheticsDeviceID.FIREFOX_TABLET),
listOf(SyntheticsDeviceID.CHROME_TABLET.value, SyntheticsDeviceID.FIREFOX_TABLET.value),
result.options.deviceIds,
)
}
Expand All @@ -107,7 +107,7 @@ class SyntheticBrowserTestBuilderTest {
val result = testBuilder.build()

assertEquals(
listOf(SyntheticsDeviceID.CHROME_TABLET, SyntheticsDeviceID.FIREFOX_TABLET),
listOf(SyntheticsDeviceID.CHROME_TABLET.value, SyntheticsDeviceID.FIREFOX_TABLET.value),
result.options.deviceIds,
)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package com.personio.synthetics.client

import com.datadog.api.client.v1.model.SyntheticsBrowserTestConfig
import com.datadog.api.client.v1.model.SyntheticsDeviceID
import com.datadog.api.client.v1.model.SyntheticsGlobalVariable
import com.datadog.api.client.v1.model.SyntheticsListGlobalVariablesResponse
import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper
import com.personio.synthetics.config.Config
import com.personio.synthetics.config.Credentials
import com.personio.synthetics.config.Defaults
import com.personio.synthetics.model.config.SyntheticsDeviceID
import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Test
Expand Down Expand Up @@ -39,7 +39,7 @@ internal class BrowserTestTest {
@Test
fun `initialising a BrowserTest object sets the device id to chrome laptop large`() {
val browserTest = BrowserTest("Test", syntheticsApi, defaults())
assertEquals(listOf(SyntheticsDeviceID.CHROME_LAPTOP_LARGE), browserTest.options.deviceIds)
assertEquals(listOf(SyntheticsDeviceID.CHROME_LAPTOP_LARGE.toString()), browserTest.options.deviceIds)
}

@Test
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.personio.synthetics.config

import com.datadog.api.client.v1.model.SyntheticsDeviceID
import com.personio.synthetics.client.BrowserTest
import com.personio.synthetics.model.config.Location
import com.personio.synthetics.model.config.MonitorPriority
import com.personio.synthetics.model.config.RenotifyInterval
import com.personio.synthetics.model.config.SyntheticsDeviceID
import com.personio.synthetics.model.config.Timeframe
import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Assertions.assertNotNull
Expand Down Expand Up @@ -184,13 +184,19 @@ internal class BrowserTestConfigTest {
fun `browserAndDevice function sets the browser and device to the test config`() {
browserTest.browserAndDevice(SyntheticsDeviceID.CHROME_LAPTOP_LARGE)

assertEquals(listOf(SyntheticsDeviceID.CHROME_LAPTOP_LARGE), browserTest.options.deviceIds)
assertEquals(listOf(SyntheticsDeviceID.CHROME_LAPTOP_LARGE.value), browserTest.options.deviceIds)
}

@Test
fun `browserAndDevice function sets multiple browsers and devices in the test config`() {
browserTest.browserAndDevice(SyntheticsDeviceID.CHROME_LAPTOP_LARGE, SyntheticsDeviceID.FIREFOX_MOBILE_SMALL)

assertEquals(listOf(SyntheticsDeviceID.CHROME_LAPTOP_LARGE, SyntheticsDeviceID.FIREFOX_MOBILE_SMALL), browserTest.options.deviceIds)
assertEquals(
listOf(
SyntheticsDeviceID.CHROME_LAPTOP_LARGE.value,
SyntheticsDeviceID.FIREFOX_MOBILE_SMALL.value,
),
browserTest.options.deviceIds,
)
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.personio.synthetics.e2e

import com.datadog.api.client.v1.model.SyntheticsDeviceID
import com.personio.synthetics.dsl.syntheticBrowserTest
import com.personio.synthetics.model.config.Location
import com.personio.synthetics.model.config.MonitorPriority
import com.personio.synthetics.model.config.RenotifyInterval
import com.personio.synthetics.model.config.SyntheticsDeviceID
import com.personio.synthetics.model.config.Timeframe
import com.personio.synthetics.step.ui.model.TargetElement
import org.junit.jupiter.api.Test
Expand Down
2 changes: 1 addition & 1 deletion src/test/kotlin/com/personio/synthetics/e2e/E2ETest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package com.personio.synthetics.e2e
import com.datadog.api.client.v1.model.SyntheticsAssertionOperator
import com.datadog.api.client.v1.model.SyntheticsAssertionType
import com.datadog.api.client.v1.model.SyntheticsCheckType
import com.datadog.api.client.v1.model.SyntheticsDeviceID
import com.datadog.api.client.v1.model.SyntheticsTestPauseStatus
import com.personio.synthetics.client.syntheticBrowserTest
import com.personio.synthetics.config.advancedScheduling
Expand Down Expand Up @@ -33,6 +32,7 @@ import com.personio.synthetics.model.assertion.FileSizeCheckType
import com.personio.synthetics.model.config.Location
import com.personio.synthetics.model.config.MonitorPriority
import com.personio.synthetics.model.config.RenotifyInterval
import com.personio.synthetics.model.config.SyntheticsDeviceID
import com.personio.synthetics.model.config.Timeframe
import com.personio.synthetics.step.api.apiStep
import com.personio.synthetics.step.assertion.currentUrlAssertion
Expand Down

0 comments on commit 3cdc982

Please sign in to comment.