-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
QA-5209: Defined the junit-platform.properties file to enable paralle…
…l test execution and reviewed the bean scope to prevent conflicts with parallelism
- Loading branch information
1 parent
1fcd7ba
commit 23a39a5
Showing
50 changed files
with
420 additions
and
275 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
...a-tests/src/main/java/it/pagopa/interop/authorization/service/utils/ConfigFileReader.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package it.pagopa.interop.authorization.service.utils; | ||
|
||
import it.pagopa.interop.authorization.domain.Tenant; | ||
import lombok.Getter; | ||
import org.springframework.beans.factory.config.ConfigurableBeanFactory; | ||
import org.springframework.context.annotation.Scope; | ||
import org.springframework.stereotype.Component; | ||
import org.yaml.snakeyaml.Yaml; | ||
import org.yaml.snakeyaml.constructor.Constructor; | ||
|
||
import java.io.BufferedReader; | ||
import java.io.FileReader; | ||
import java.io.IOException; | ||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
@Component | ||
@Getter | ||
public class ConfigFileReader { | ||
private final List<Tenant> tenantList; | ||
|
||
public ConfigFileReader() { | ||
this.tenantList = readProperty(); | ||
} | ||
|
||
private List<Tenant> readProperty() { | ||
String filePath = "config/tenants-ids.yaml"; | ||
List<Tenant> tenantList = new ArrayList<>(); | ||
try (BufferedReader reader = new BufferedReader(new FileReader(filePath))) { | ||
Yaml yaml = new Yaml(new Constructor(Tenant.class)); | ||
yaml.loadAll(reader).forEach(i -> tenantList.add((Tenant) i)); | ||
} catch (IOException exception) { | ||
exception.printStackTrace(); | ||
} | ||
return tenantList; | ||
} | ||
|
||
} |
Oops, something went wrong.