1

We have a java method which accept one String and an array of String:

public static void foo(String bar, String... parts){
    modify parameters...
}

We would like to send parameters from karate feature:

* def temp = JavaClass.foo(bar, part1, part2)

It works, but only bar and part2 are sent to foo method. How we can send an array of Strings from karate feature, smth like

* def temp = JavaClass.foo(bar, [part1, part2])

Sorry if we didn't see the issue in official github repo. Thanks

1 Answer 1

1

Try making the parts argument as a Java list, it should work then.

public static void foo(String bar, List<String> parts){

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.