Skip to content

Commit

Permalink
Fix QuarksCliTlsCommandIT cert path on Windows
Browse files Browse the repository at this point in the history
(cherry picked from commit 27f733d)
  • Loading branch information
michalvavrik authored and fedinskiy committed Sep 25, 2024
1 parent 7e793d6 commit 8b478be
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestMethodOrder;
import org.junit.jupiter.api.condition.OS;

import io.quarkus.logging.Log;
import io.quarkus.test.bootstrap.QuarkusCliCommandResult;
Expand Down Expand Up @@ -134,7 +135,16 @@ private static Function<QuarkusCliCommandResult, String> getPropertyFromEnvFileA
// add generated env vars also to application properties under test profile
// so that we can also use them in TlsCommandTest
var propertyValue = cmd.getPropertyValueFromEnvFile("%dev." + propertyKey);
return "%test." + propertyKey + "=" + propertyValue;
return "%test." + propertyKey + "=" + addEscapes(propertyValue);
};
}

private static String addEscapes(String propertyValue) {
if (OS.WINDOWS.isCurrentOs()) {
// we need to quote back slashes passed as command lines in Windows as they have special meaning
// TODO: move this to the QE Test Framework as this is repeated a lot
return propertyValue.replace("\\", "\\\\");
}
return propertyValue;
}
}

0 comments on commit 8b478be

Please sign in to comment.