minor refactoring

This commit is contained in:
dashevchenko 2025-02-24 17:36:42 +02:00
parent 93e191856f
commit f28f14f2fc
4 changed files with 4 additions and 28 deletions

View File

@ -713,7 +713,8 @@ public class EntityQueryControllerTest extends AbstractControllerTest {
// all devices with ownerName = TEST TENANT
EntityCountQuery query = new EntityCountQuery(filter, List.of(activeAlarmTimeFilter, tenantOwnerNameFilter));
countByQueryAndCheck(query, numOfDevices);
await().atMost(TIMEOUT, TimeUnit.SECONDS).until(() -> countByQuery(query),
result -> result == numOfDevices);
// all devices with ownerName = TEST TENANT
EntityCountQuery activeAlarmTimeToLongQuery = new EntityCountQuery(filter, List.of(activeAlarmTimeToLongFilter, tenantOwnerNameFilter));

View File

@ -2,6 +2,5 @@ ZOOKEEPER_ENABLED=true
ZOOKEEPER_URL=zookeeper:2181
TB_KAFKA_SERVERS=kafka:9092
TB_EDQS_STATS_ENABLED=false
METRICS_ENABLED=true
METRICS_ENDPOINTS_EXPOSE=prometheus

View File

@ -164,10 +164,8 @@ public class ContainerTestSuite {
}
// to trigger edqs synchronization
if (true) {
addToFile(targetDir, "tb-node.env",
Map.of("TB_EDQS_SYNC_ENABLED", "true"));
}
addToFile(targetDir, "tb-node.env",
Map.of("TB_EDQS_SYNC_ENABLED", "true"));
testContainer = new DockerComposeContainerImpl<>(composeFiles)
.withPull(false)

View File

@ -114,28 +114,6 @@ public class TestRestClient {
requestSpec.header(JWT_TOKEN_HEADER_PARAM, "Bearer " + token);
}
public JsonNode getActivateRequest(String password) {
ObjectNode response = given().spec(requestSpec).get("/api/noauth/activate?activateToken={activateToken}", token)
.then()
.statusCode(HTTP_OK)
.extract()
.as(ObjectNode.class);
return JacksonUtil.newObjectNode()
.put("activateToken", this.token)
.put("password", password);
}
public void activateAndLoginAsUser(JsonNode activateRequest) {
ObjectNode tokenInfo = given().spec(requestSpec).body(activateRequest)
.post("/api/noauth/activate")
.then()
.extract()
.as(ObjectNode.class);
token = tokenInfo.get("token").asText();
refreshToken = tokenInfo.get("refreshToken").asText();
requestSpec.header(JWT_TOKEN_HEADER_PARAM, "Bearer " + token);
}
public Tenant postTenant(Tenant tenant) {
return given().spec(requestSpec).body(tenant)
.post("/api/tenant")