Refactor tenant configuration management (#2840)

Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
This commit is contained in:
Avgustin Marinov
2025-11-28 15:37:12 +02:00
committed by GitHub
parent 203598f3a4
commit b8a05e3cbf
14 changed files with 292 additions and 353 deletions

View File

@@ -88,7 +88,7 @@ class DdiConfigDataTest extends AbstractDDiApiIntegrationTest {
.andExpect(jsonPath("$.config.polling.sleep", equalTo("00:01:00")))
.andExpect(jsonPath("$._links.configData.href", equalTo(
"http://localhost/" + AccessContext.tenant() + "/controller/v1/4712/configData")));
Thread.sleep(1); // is required: otherwise processing the next line is
waitMillis(1); // is required: otherwise processing the next line is
// often too fast and // the following assert will fail
assertThat(targetManagement.getByControllerId("4712")
.getLastTargetQuery())

View File

@@ -33,12 +33,11 @@ import org.springframework.web.context.WebApplicationContext;
/**
* Test potential DOS attack scenarios and check if the filter prevents them.
*/
@ActiveProfiles({ "test" })
/**
* <p/>
* Feature: Component Tests - REST Security<br/>
* Story: Denial of Service protection filter
*/
@ActiveProfiles({ "test" })
class DosFilterTest extends AbstractDDiApiIntegrationTest {
private static final String X_FORWARDED_FOR = HawkbitSecurityProperties.Clients.X_FORWARDED_FOR;
@@ -113,7 +112,7 @@ class DosFilterTest extends AbstractDDiApiIntegrationTest {
void acceptableGetLoad() throws Exception {
for (int x = 0; x < 3; x++) {
// sleep for one second
Thread.sleep(1100);
waitMillis(1100);
for (int i = 0; i < 9; i++) {
mvc.perform(get("/{tenant}/controller/v1/4711", AccessContext.tenant())
.header(X_FORWARDED_FOR, "10.0.0.1"))
@@ -159,7 +158,7 @@ class DosFilterTest extends AbstractDDiApiIntegrationTest {
for (int x = 0; x < 5; x++) {
// sleep for one second
Thread.sleep(1100);
waitMillis(1100);
for (int i = 0; i < 9; i++) {
mvc.perform(post("/{tenant}/controller/v1/4711/deploymentBase/" + actionId + "/feedback",