• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

WebTestClient cannot read matrix variable

 
Bartender
Posts: 2266
13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, I am writing a test case for Dominik Cebula's Spring Professional Tutorial example. I found out that WebTestClient cannot read matrix variables.
Here is the relevant parts of Dominik's code:



This is my  Junit 5 test case:

But the error is:


Does anyone has any suggestion to fix this issue?


On the other hand, if I use MockMvc, it works.
 
Himai Minh
Bartender
Posts: 2266
13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I can answer my own question.
Instead of using WebFluxTest, use SpringBootTest and AutoConfigureWebTestClient.
According to someone from Spring Community, WebFluxTest ignores the WebMvcConfigurer

Reference:
https://stackoverflow.com/questions/60307284/webfluxtest-cannot-read-matrix-variables/60327750#60327750
 
reply
    Bookmark Topic Watch Topic
  • New Topic