Refactor tenant configuration management (#2840)
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
This commit is contained in:
@@ -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())
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user