Spring-cloud-contract: Custom method not referenced in generated test code

Created on 7 Feb 2018  路  1Comment  路  Source: spring-cloud/spring-cloud-contract

Question

I am trying to use custom method for a multipart parameter value as follows

request {
        method 'POST'
        url('/some/url')
        multipart(
                username: $(
                        c('someusername'),
                        p(execute('getUsername()'))),
                password: 'tester'
        )
    }

However the generated test code does not refer to the custom method but inserts the method name as literal string

MockMvcRequestSpecification request = given()
                    .param("username", "getUsername()")
                    .param("password", "tester");

Could you please advise what I am doing wrong

bug

Most helpful comment

I don't think we support this for multipart, that's why. Which apparently is a bug.

>All comments

I don't think we support this for multipart, that's why. Which apparently is a bug.

Was this page helpful?
0 / 5 - 0 ratings