Skip to content

Commit

Permalink
Merge pull request #154 from Drill4J/fix/remove-drill-prefix-for-api-…
Browse files Browse the repository at this point in the history
…url-and-key-params

feat: remove drill_ prefix for api_url and api_key parameters
  • Loading branch information
RomanDavlyatshin authored Sep 5, 2024
2 parents 566170f + c9fbcfd commit ea5c0d5
Show file tree
Hide file tree
Showing 17 changed files with 26 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ package com.epam.drill.test.agent.runner
import java.io.File

abstract class Configuration {
var drillApiUrl: String? = null
var drillApiKey: String? = null
var apiUrl: String? = null
var apiKey: String? = null
var groupId: String? = null
var appId: String? = null

Expand All @@ -39,8 +39,8 @@ abstract class Configuration {
fun toJvmArgs(): List<String> {
val args = mutableMapOf<String, Any?>()
args["drillInstallationDir"] = runtimePath
args[Configuration::drillApiUrl.name] = drillApiUrl
drillApiKey?.let { args[Configuration::drillApiKey.name] = it }
args[Configuration::apiUrl.name] = apiUrl
apiKey?.let { args[Configuration::apiKey.name] = it }
args[Configuration::groupId.name] = groupId
args[Configuration::appId.name] = appId
args[Configuration::logLevel.name] = logLevel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ val validateConfig = Validation<Configuration> {
identifier()
minLength(3)
}
Configuration::drillApiUrl required {
Configuration::apiUrl required {
validTransportUrl()
}
Configuration::drillApiKey ifPresent {
Configuration::apiKey ifPresent {
minLength(1)
}
Configuration::logLevel ifPresent {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import com.epam.drill.plugins.test2code.api.Label

object ParameterDefinitions {
val GROUP_ID = AgentParameterDefinition.forString(name = "groupId")
val DRILL_API_URL = AgentParameterDefinition.forString(name = "drillApiUrl", parser = { if (!it.endsWith("/") ) "$it/" else it })
val DRILL_API_KEY = AgentParameterDefinition.forString(name = "drillApiKey")
val API_URL = AgentParameterDefinition.forString(name = "apiUrl", parser = { if (!it.endsWith("/") ) "$it/" else it })
val API_KEY = AgentParameterDefinition.forString(name = "apiKey")
val MESSAGE_QUEUE_LIMIT = AgentParameterDefinition.forString(name = "coverageRetentionLimit", defaultValue = "512Mb")
val SSL_TRUSTSTORE = AgentParameterDefinition.forString(name = "sslTruststore")
val SSL_TRUSTSTORE_PASSWORD = AgentParameterDefinition.forString(name = "sslTruststorePassword")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ object AdminMessageSender : AgentMessageSender<Action> {

private fun messageSender(): QueuedAgentMessageSender<Action, ByteArray> {
val transport = HttpAgentMessageTransport(
Configuration.parameters[ParameterDefinitions.DRILL_API_URL],
Configuration.parameters[ParameterDefinitions.DRILL_API_KEY],
Configuration.parameters[ParameterDefinitions.API_URL],
Configuration.parameters[ParameterDefinitions.API_KEY],
Configuration.parameters[ParameterDefinitions.SSL_TRUSTSTORE].takeIf(String::isNotEmpty)?.let(::resolvePath) ?: "",
Configuration.parameters[ParameterDefinitions.SSL_TRUSTSTORE_PASSWORD],
gzipCompression = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ class ValidatedParametersProvider(
val appId by provider
val groupId by provider
val drillInstallationDir by provider
val drillApiUrl by provider
val drillApiKey by provider
val apiUrl by provider
val apiKey by provider
val devToolsProxyAddress by provider
val browserProxyAddress by provider
val logLevel by provider
Expand All @@ -51,7 +51,7 @@ class ValidatedParametersProvider(
ValidatingParameters::drillInstallationDir required {
minLength(1)
}
ValidatingParameters::drillApiUrl required {
ValidatingParameters::apiUrl required {
validTransportUrl()
}
}
Expand All @@ -65,7 +65,7 @@ class ValidatedParametersProvider(
identifier()
minLength(3)
}
ValidatingParameters::drillApiKey ifPresent {
ValidatingParameters::apiKey ifPresent {
minLength(3)
}
ValidatingParameters::logLevelAsList onEach {
Expand Down
2 changes: 1 addition & 1 deletion tests-cucumber-v4/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ drill {
agentPath = nativeAgentDir.resolve(nativeAgentFile)
appId = "test-pet-standalone"
groupId = "drill-tests"
drillApiUrl = "http://" + rootProject.extra["testsAdminStubServerHost"] as String + ":" + rootProject.extra["testsAdminStubServerPort"] as Int
apiUrl = "http://" + rootProject.extra["testsAdminStubServerHost"] as String + ":" + rootProject.extra["testsAdminStubServerPort"] as Int
logLevel = "TRACE"
jvmArgs += "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5010"
labels = mapOf("User" to "Test", "Team" to "Drill4j")
Expand Down
2 changes: 1 addition & 1 deletion tests-cucumber-v5/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ drill {
agentPath = nativeAgentDir.resolve(nativeAgentFile)
appId = "test-pet-standalone"
groupId = "drill-tests"
drillApiUrl = "http://" + rootProject.extra["testsAdminStubServerHost"] as String + ":" + rootProject.extra["testsAdminStubServerPort"] as Int
apiUrl = "http://" + rootProject.extra["testsAdminStubServerHost"] as String + ":" + rootProject.extra["testsAdminStubServerPort"] as Int
logLevel = "TRACE"
jvmArgs += "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5011"
labels = mapOf("User" to "Test", "Team" to "Drill4j")
Expand Down
2 changes: 1 addition & 1 deletion tests-cucumber-v6.7/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ drill {
agentPath = nativeAgentDir.resolve(nativeAgentFile)
appId = "test-pet-standalone"
groupId = "drill-tests"
drillApiUrl = "http://" + rootProject.extra["testsAdminStubServerHost"] as String + ":" + rootProject.extra["testsAdminStubServerPort"] as Int
apiUrl = "http://" + rootProject.extra["testsAdminStubServerHost"] as String + ":" + rootProject.extra["testsAdminStubServerPort"] as Int
logLevel = "TRACE"
jvmArgs += "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5013"
labels = mapOf("User" to "Test", "Team" to "Drill4j")
Expand Down
2 changes: 1 addition & 1 deletion tests-cucumber-v6/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ drill {
agentPath = nativeAgentDir.resolve(nativeAgentFile)
appId = "test-pet-standalone"
groupId = "drill-tests"
drillApiUrl = "http://" + rootProject.extra["testsAdminStubServerHost"] as String + ":" + rootProject.extra["testsAdminStubServerPort"] as Int
apiUrl = "http://" + rootProject.extra["testsAdminStubServerHost"] as String + ":" + rootProject.extra["testsAdminStubServerPort"] as Int
logLevel = "TRACE"
jvmArgs += "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5012"
labels = mapOf("User" to "Test", "Team" to "Drill4j")
Expand Down
2 changes: 1 addition & 1 deletion tests-https-headers-ju4/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ drill {
agentPath = nativeAgentDir.resolve(nativeAgentFile)
appId = "test-pet-standalone"
groupId = "drill-tests"
drillApiUrl = "http://" + rootProject.extra["testsAdminStubServerHost"] as String + ":" + rootProject.extra["testsAdminStubServerPort"] as Int
apiUrl = "http://" + rootProject.extra["testsAdminStubServerHost"] as String + ":" + rootProject.extra["testsAdminStubServerPort"] as Int
logLevel = "TRACE"
jvmArgs += "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5014"
labels = mapOf("User" to "Test", "Team" to "Drill4j")
Expand Down
2 changes: 1 addition & 1 deletion tests-https-headers-ju5/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ drill {
agentPath = nativeAgentDir.resolve(nativeAgentFile)
appId = "test-pet-standalone"
groupId = "drill-tests"
drillApiUrl = "http://" + rootProject.extra["testsAdminStubServerHost"] as String + ":" + rootProject.extra["testsAdminStubServerPort"] as Int
apiUrl = "http://" + rootProject.extra["testsAdminStubServerHost"] as String + ":" + rootProject.extra["testsAdminStubServerPort"] as Int
logLevel = "TRACE"
jvmArgs += "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5016"
labels = mapOf("User" to "Test", "Team" to "Drill4j")
Expand Down
2 changes: 1 addition & 1 deletion tests-https-headers-testng-v6.1/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ drill {
agentPath = nativeAgentDir.resolve(nativeAgentFile)
appId = "test-pet-standalone"
groupId = "drill-tests"
drillApiUrl = "http://" + rootProject.extra["testsAdminStubServerHost"] as String + ":" + rootProject.extra["testsAdminStubServerPort"] as Int
apiUrl = "http://" + rootProject.extra["testsAdminStubServerHost"] as String + ":" + rootProject.extra["testsAdminStubServerPort"] as Int
logLevel = "TRACE"
jvmArgs += "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5017"
labels = mapOf("User" to "Test", "Team" to "Drill4j")
Expand Down
2 changes: 1 addition & 1 deletion tests-https-headers-testng-v7.4/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ drill {
agentPath = nativeAgentDir.resolve(nativeAgentFile)
appId = "test-pet-standalone"
groupId = "drill-tests"
drillApiUrl = "http://" + rootProject.extra["testsAdminStubServerHost"] as String + ":" + rootProject.extra["testsAdminStubServerPort"] as Int
apiUrl = "http://" + rootProject.extra["testsAdminStubServerHost"] as String + ":" + rootProject.extra["testsAdminStubServerPort"] as Int
logLevel = "TRACE"
jvmArgs += "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5018"
labels = mapOf("User" to "Test", "Team" to "Drill4j")
Expand Down
2 changes: 1 addition & 1 deletion tests-rest-assure-ju5/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ drill {
agentPath = nativeAgentDir.resolve(nativeAgentFile)
appId = "test-pet-standalone"
groupId = "drill-tests"
drillApiUrl = "http://" + rootProject.extra["testsAdminStubServerHost"] as String + ":" + rootProject.extra["testsAdminStubServerPort"] as Int
apiUrl = "http://" + rootProject.extra["testsAdminStubServerHost"] as String + ":" + rootProject.extra["testsAdminStubServerPort"] as Int
logLevel = "TRACE"
jvmArgs += "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5006"
labels = mapOf("User" to "Test", "Team" to "Drill4j")
Expand Down
2 changes: 1 addition & 1 deletion tests-selenium-v3-ju5/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ drill {
agentPath = nativeAgentDir.resolve(nativeAgentFile)
appId = "test-pet-standalone"
groupId = "drill-tests"
drillApiUrl = "http://" + rootProject.extra["testsAdminStubServerHost"] as String + ":" + rootProject.extra["testsAdminStubServerPort"] as Int
apiUrl = "http://" + rootProject.extra["testsAdminStubServerHost"] as String + ":" + rootProject.extra["testsAdminStubServerPort"] as Int
logLevel = "TRACE"
jvmArgs += "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5008"
labels = mapOf("User" to "Test", "Team" to "Drill4j")
Expand Down
2 changes: 1 addition & 1 deletion tests-selenium-v4-ju5/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ drill {
agentPath = nativeAgentDir.resolve(nativeAgentFile)
appId = "test-pet-standalone"
groupId = "drill-tests"
drillApiUrl = "http://" + rootProject.extra["testsAdminStubServerHost"] as String + ":" + rootProject.extra["testsAdminStubServerPort"] as Int
apiUrl = "http://" + rootProject.extra["testsAdminStubServerHost"] as String + ":" + rootProject.extra["testsAdminStubServerPort"] as Int
logLevel = "TRACE"
jvmArgs += "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5009"
labels = mapOf("User" to "Test", "Team" to "Drill4j")
Expand Down
2 changes: 1 addition & 1 deletion tests-spock/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ drill {
agentPath = nativeAgentDir.resolve(nativeAgentFile)
appId = "test-pet-standalone"
groupId = "drill-tests"
drillApiUrl = "http://" + rootProject.extra["testsAdminStubServerHost"] as String + ":" + rootProject.extra["testsAdminStubServerPort"] as Int
apiUrl = "http://" + rootProject.extra["testsAdminStubServerHost"] as String + ":" + rootProject.extra["testsAdminStubServerPort"] as Int
logLevel = "TRACE"
jvmArgs += "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5007"
labels = mapOf("User" to "Test", "Team" to "Drill4j")
Expand Down

0 comments on commit ea5c0d5

Please sign in to comment.