简体   繁体   中英

Unable to read $ in .properties file

@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.NONE,
        classes = {
                FeignAutoConfiguration.class,
                HttpMessageConvertersAutoConfiguration.class,
                AbcClientConfiguration.class,
                ObjectMapper.class
        },
        properties = {
                "downstream.abc.api.apiHost=https://staging.abc.com",
                "downstream.abc.api.xPartnerAcessKeyValue=abcdefg",
                "downstream.abc.api.partnerId=123",
                "downstream.abc.api.query=mutation raasDeleteCustomerPii($input: RaasDeleteCustomerPiiInput!) { raasDeleteCustomerPii(input: $input) {success}}"
        }
)
@EnableFeignClients(clients = {
        AbcApiClient.class
})
@EnableConfigurationProperties(AbcApiProperties.class)

Unable to read $ in $input while parsing ${downstream.abc.api.query}. I am unable to use \ or ` for escape.

Try to create a new variable that has the value of $ like that:

public static final char dollar = '$';

then in your annotation do a simple concatenation as follow:

"downstream.abc.api.query=mutation raasDeleteCustomerPii("+dollar+"input: RaasDeleteCustomerPiiInput!) { raasDeleteCustomerPii(input: $input) {success}}"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM