edge-fqm: Refactoring guide

edge-fqm: Refactoring guide

Overview

This module includes additional critical updates for Eureka compatibility.

Previously, this module was using diku tenant and diku_admin. There was discussion over it, and was decided to make unified approach to all edge modules. Since most of such modules was using some test tenant and test user, we decided to go in this direction also.

First of all, we now need to create tenant&user and after destroy it. So to the test was added @BeforeAll and @AfterAll methods.

@BeforeAll public void setup() { runFeature("classpath:corsair/edge-fqm/edge-fqm-junit.feature"); } @AfterAll public void tearDown() { runFeature("classpath:common/eureka/destroy-data.feature"); }

@BeforeAll method was in the tests even before refactoring, but it was just declaring some modules and login as admin without any creation

Since now, we need to declare modules we need for our tests purposes and userPermissions that will be assigned to the testUser as it was done in usual modules.

image-20250410-193202.png

We need to make call to setup-users.feature and pass all steps as in usual module. Also, as some of scenarios need locations to be present in the DB, we are creating sample data(similar as in mod-fqm-manager)

Scenario: create tenant and data for testing * call read('classpath:common/eureka/setup-users.feature') Scenario: Add sample data for queries Given call read('classpath:corsair/edge-fqm/features/utils/add-query-data.feature')
image-20250410-193337.png

All test scenarios was not modified, and successfully passing without any additional refactoring.

Currently, tenant&user was added to ephemeral properties in manual way. Ticket has been already created. You can look for progress of it's completion

apiKey was replaced with value of new tenant&user