0

I have a nested List<List<Integer>> and Integer[] marks

When I am sending the request from Postman like this :

"numsList" : [
    [1, 0],
    [2, 2],
    [2, 3]
  ]

everything is working fine. The request is getting mapped as numsList=[[1, 0], [2, 2], [2, 3]]

But when I am trying to write a junit, I am unable to create the request object in this format.

I am doing like this : var numsList = List.of(List.of(1,0,2,3,2,2)); and it is in the incorrect format.

Need some help to correct this.

1

1 Answer 1

2

List.of(List.of(1,0,2,3,2,2)) is [[1,0,2,3,2,2]].

You probably need List.of(List.of(1,0), List.of(2,3), List.of(2,2)), which is [[1,0], [2,3], [2,2]].

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.