Replies: 2 comments 5 replies
-
Did you already try the |
Beta Was this translation helpful? Give feedback.
2 replies
-
I thought I'd give it a go to find a fix, but this unit test I started with is passing: @Test
void doNotExpandNewValue() {
rewriteRun(
spec -> spec.recipe(new ChangePropertyValue("my.prop", "${keycloak.url:replaced-by-test-resource}/realms/quarkus/", "${keycloak.url}/realms/quarkus/", null, null)),
properties(
"my.prop=${keycloak.url}/realms/quarkus/",
"my.prop=${keycloak.url:replaced-by-test-resource}/realms/quarkus/"
)
);
} I don't know enough about the context in which the unit tests run vs how openrewrite is triggered normally (or how quarkus is using openrewrite, for that matter), any clue on how to trigger this same behaviour in a test? |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I'm trying to implement this relatively simple recipe:
The important part is
${keycloak.url:replaced-by-test-resource}
.I wouldn't expect any variable expansion taking place, given I don't provide any properties but given a default value is provided in my expression, it is resolved anyway and I end up with my tests failing with:
I see that there is a
propertyPlaceholderHelper
used when loading resources and I suppose that's what is at play here. I tried various way to escape my expression and couldn't find something that would work (and for which I don't end up with a\
in my output).Any advice on how to address this?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions