Skip to content

Commit

Permalink
review
Browse files Browse the repository at this point in the history
  • Loading branch information
basseche committed Nov 22, 2024
1 parent 7de7207 commit 793b434
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 29 deletions.
8 changes: 0 additions & 8 deletions src/main/java/org/gridsuite/filter/server/FilterService.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,20 +65,12 @@ public class FilterService {
private final FilterService self;

public FilterService(final ScriptFilterRepository scriptFiltersRepository,
final BusBarSectionFilterRepository busBarSectionFilterRepository,
final LccConverterStationFilterRepository lccConverterStationFilterRepository,
final VscConverterStationFilterRepository vscConverterStationFilterRepository,
final IdentifierListFilterRepository identifierListFilterRepository,
final ExpertFilterRepository expertFilterRepository,
NetworkStoreService networkStoreService,
NotificationService notificationService,
@Lazy FilterService self) {
filterRepositories.put(EquipmentType.BUSBAR_SECTION.name(), new BusBarSectionFilterRepositoryProxy(busBarSectionFilterRepository));
filterRepositories.put(EquipmentType.LCC_CONVERTER_STATION.name(), new LccConverterStationFilterRepositoryProxy(lccConverterStationFilterRepository));
filterRepositories.put(EquipmentType.VSC_CONVERTER_STATION.name(), new VscConverterStationFilterRepositoryProxy(vscConverterStationFilterRepository));

filterRepositories.put(FilterType.SCRIPT.name(), new ScriptFilterRepositoryProxy(scriptFiltersRepository));

filterRepositories.put(FilterType.IDENTIFIER_LIST.name(), new IdentifierListFilterRepositoryProxy(identifierListFilterRepository));

filterRepositories.put(FilterType.EXPERT.name(), new ExpertFilterRepositoryProxy(expertFilterRepository));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class MigrateEquipmentFilter implements CustomSqlChange {
public class MigrateEquipmentFiltersToExpertFilters implements CustomSqlChange {
private static final String EXPERT_RULE_TABLE = "expert_rule";
private static final String EXPERT_RULE_VALUE_TABLE = "expert_rule_value";
private static final String FREE_PROPS_ID = "free_properties_id";
private static final String SUB_FREE_PROPS_ID = "substation_free_properties_id";
private static final String NUMERIC_FILTER_ID = "numeric_filter_id_id";
private static final String VALUE_COL = "value_";

private static final Logger LOGGER = LoggerFactory.getLogger(MigrateEquipmentFilter.class);
private static final Logger LOGGER = LoggerFactory.getLogger(MigrateEquipmentFiltersToExpertFilters.class);

static class ExpertRuleParam {
private final String id;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-latest.xsd">
<changeSet author="elcheikhbas" id="1774416869-1">
<customChange class="org.gridsuite.filter.server.migrations.MigrateEquipmentFilter" />
<customChange class="org.gridsuite.filter.server.migrations.MigrateEquipmentFiltersToExpertFilters" />
</changeSet>
</databaseChangeLog>
Original file line number Diff line number Diff line change
Expand Up @@ -216,24 +216,6 @@ public String joinWithComma(Object... array) {
return join(array, ",");
}

@Test
public void testBusBarSectionFilter() throws Exception {
insertInjectionFilter(EquipmentType.BUSBAR_SECTION, UUID.fromString("77614d91-c168-4f89-8fb9-77a23729e88e"),
null, "batteryName", null, Set.of("DE"), RangeType.EQUALITY, 380., null, null, NETWORK_UUID, null, "[]");
}

@Test
public void testLccConverterStationFilter() throws Exception {
insertInjectionFilter(EquipmentType.LCC_CONVERTER_STATION, UUID.fromString("77614d91-c168-4f89-8fb9-77a23729e88e"),
"lccId1", "lccName1", "s3", Set.of("FR", "BE", "NL", "DE", "IT"), RangeType.RANGE, 20., 400., null, NETWORK_UUID, null, "[]");
}

@Test
public void testVscConverterStationFilter() throws Exception {
insertInjectionFilter(EquipmentType.VSC_CONVERTER_STATION, UUID.fromString("77614d91-c168-4f89-8fb9-77a23729e88e"),
"vscId1", "vscName1", "s2", null, RangeType.EQUALITY, 225., null, null, NETWORK_UUID, null, "[]");
}

@Test
public void testIdentifierListFilter() throws Exception {
UUID filterId = UUID.fromString("77614d91-c168-4f89-8fb9-77a23729e88e");
Expand Down

0 comments on commit 793b434

Please sign in to comment.