Skip to content

Commit

Permalink
Fix logic of determining disabled profiles
Browse files Browse the repository at this point in the history
  • Loading branch information
ole-ve committed Oct 15, 2024
1 parent 8561759 commit a8f0cc0
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package de.tum.cit.aet.artemis.core.config;

import java.util.Arrays;
import java.util.List;
import java.util.Set;

Expand All @@ -14,7 +13,7 @@ public abstract class AbstractModuleConfig {

public AbstractModuleConfig(Environment environment, Set<Profiles> requiredProfiles) {
// ToDo: Consider adding a profile/flag to disable this check in tests
List<String> requiredDisabledProfiles = Arrays.stream(environment.getActiveProfiles()).filter(profile -> !requiredProfiles.contains(Profiles.of(profile))).toList();
List<Profiles> requiredDisabledProfiles = requiredProfiles.stream().filter(profile -> !environment.acceptsProfiles(profile)).toList();
if (!requiredDisabledProfiles.isEmpty()) {
throw new IllegalStateException(
"Module requires the following profiles to be enabled: " + requiredProfiles + " but the following profiles are disabled: " + requiredDisabledProfiles);
Expand Down

0 comments on commit a8f0cc0

Please sign in to comment.