Skip to content

Commit

Permalink
MET-6139 Fix new sonar issues
Browse files Browse the repository at this point in the history
  • Loading branch information
stzanakis committed Oct 17, 2024
1 parent 1b8cbae commit ba4229f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,8 @@ void zipFileShouldBeDownloadedWhenNotAvailable()
}

private void clearSchemasDir() throws IOException {
String TMP_DIR = System.getProperty("java.io.tmpdir");
File schemasDirectory = new File(TMP_DIR, "schemas");
String tmpDir = System.getProperty("java.io.tmpdir");
File schemasDirectory = new File(tmpDir, "schemas");
FileUtils.deleteDirectory(schemasDirectory);
schemasDirectory.mkdirs();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,12 +283,12 @@ private Properties loadDefaultProperties(String propertyFile) {
@Test
void ValidationExecutionServiceTestWithProvidedProperties() {
Properties property = loadDefaultProperties("src/test/resources/custom-validation.properties");
ValidationExecutionService validationExecutionService = new ValidationExecutionService(
ValidationExecutionService validationExecutionServiceWithProvidedProperties = new ValidationExecutionService(
property);
ExecutorService es = Whitebox.getInternalState(validationExecutionService, "es");
ExecutorService es = Whitebox.getInternalState(validationExecutionServiceWithProvidedProperties, "es");
assertNotNull(es);
SchemaProvider schemaProvider = Whitebox
.getInternalState(validationExecutionService, "schemaProvider");
.getInternalState(validationExecutionServiceWithProvidedProperties, "schemaProvider");
Properties properties = loadDefaultProperties(
"src/test/resources/custom-validation.properties");
assertNotNull(schemaProvider);
Expand All @@ -311,12 +311,12 @@ void ValidationExecutionServiceTestWithCustomConfiguration() {
PredefinedSchemas predefinedSchemas = new PredefinedSchemas();
predefinedSchemas.add("name", "location", "root", "schematronFile");
predefinedSchemas.add("name1", "location1", "root1", "schematronFile1");
ValidationExecutionService validationExecutionService = new ValidationExecutionService(
ValidationExecutionService validationExecutionServiceWithCustomConfig = new ValidationExecutionService(
() -> 12, new ClasspathResourceResolver(), new SchemaProvider(predefinedSchemas));
ExecutorService es = Whitebox.getInternalState(validationExecutionService, "es");
ExecutorService es = Whitebox.getInternalState(validationExecutionServiceWithCustomConfig, "es");
assertNotNull(es);
SchemaProvider schemaProvider = Whitebox
.getInternalState(validationExecutionService, "schemaProvider");
.getInternalState(validationExecutionServiceWithCustomConfig, "schemaProvider");
assertNotNull(schemaProvider);
PredefinedSchemas locations = Whitebox
.getInternalState(schemaProvider, "predefinedSchemasLocations");
Expand Down

0 comments on commit ba4229f

Please sign in to comment.