Skip to content

Commit

Permalink
Implement tests for http request authentication
Browse files Browse the repository at this point in the history
Added a new target to the dump.sql database for the new tests
Added OkHttp logger to log the requests (disabled by default)
Refactored the code
Increased detekt's max issue to prevent the build from failing

Signed-off-by: Saeed Rezaee <saeed.rezaee@kynetics.it>
  • Loading branch information
SaeedRe committed Feb 20, 2024
1 parent 2ae4436 commit d1a8c7d
Show file tree
Hide file tree
Showing 11 changed files with 725 additions and 38 deletions.
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -280,5 +280,6 @@ dependencies{
testImplementation deps.kotlin_x
testImplementation deps.joda
testImplementation deps.okhttp
testImplementation deps.okhttp_logging
testImplementation deps.retrofit
}
1 change: 1 addition & 0 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ ext {
retrofit: "com.squareup.retrofit2:retrofit:$retrofitVersion",
retrofit_converter: "com.squareup.retrofit2:converter-gson:$retrofitVersion",
okhttp: "com.squareup.okhttp3:okhttp:${okhttpVersion}",
okhttp_logging: "com.squareup.okhttp3:logging-interceptor:${okhttpVersion}",
joda:'joda-time:joda-time:2.10.13'
]
test_dependencies = [
Expand Down
2 changes: 1 addition & 1 deletion detekt-config.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
build:
maxIssues: 170
maxIssues: 200
4 changes: 3 additions & 1 deletion docker/test/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ services:
"--hawkbit.artifact.url.protocols.download-http.protocol=http",
"--hawkbit.artifact.url.protocols.download-http.port=8080",
"--hawkbit.dmf.rabbitmq.enabled=false",
"--management.health.rabbit.enabled=false"]
"--management.health.rabbit.enabled=false",
"--hawkbit.controller.minPollingTime=00:00:01",
]

ports:
- 8081:8080
Expand Down
129 changes: 119 additions & 10 deletions docker/test/dump.sql

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,19 @@

package org.eclipse.hara.ddiclient.integrationtest

import org.eclipse.hara.ddiclient.integrationtest.TestUtils.basic
import org.eclipse.hara.ddiclient.integrationtest.TestUtils.gatewayToken
import org.eclipse.hara.ddiclient.integrationtest.TestUtils.getDownloadDirectoryFromActionId
import org.eclipse.hara.ddiclient.integrationtest.TestUtils.tenantName
import org.eclipse.hara.ddiclient.integrationtest.TestUtils.hawkbitUrl
import org.eclipse.hara.ddiclient.integrationtest.utils.TestUtils.basic
import org.eclipse.hara.ddiclient.integrationtest.utils.TestUtils.gatewayToken
import org.eclipse.hara.ddiclient.integrationtest.utils.TestUtils.getDownloadDirectoryFromActionId
import org.eclipse.hara.ddiclient.integrationtest.utils.TestUtils.tenantName
import org.eclipse.hara.ddiclient.integrationtest.utils.TestUtils.hawkbitUrl
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import kotlinx.coroutines.runBlocking
import kotlinx.coroutines.withTimeout
import org.eclipse.hara.ddiclient.api.*
import org.eclipse.hara.ddiclient.integrationtest.utils.Action
import org.eclipse.hara.ddiclient.integrationtest.utils.ManagementClient
import org.eclipse.hara.ddiclient.integrationtest.utils.TestUtils
import org.joda.time.Duration
import org.testng.Assert
import java.io.File
Expand Down
Loading

0 comments on commit d1a8c7d

Please sign in to comment.