-1

I have a existing test for a endpoint which was working fine with Karate 1.1.0 but after recent update to karate 1.2.0 it stopped working due to Jackson xml uncognised property exception test endpoint which accepts request body in terms of multipart/form-data. When I try to post data to endpoint with request body and a document as multipart fields which was working fine if I use karate core version as 1.1.0 but when I update to 1.2.0 it's not working and I'm hitting error

Exception occurred in Restapi class of ReponseEntity method com.fasterxml.jackson.databind.exc.UncognizedPropertyException: Unrecognized field "read"

My feature file:

Given url basetesturl + 'test1/test'
And header Content-Type ='multipart/form-data'
And header Authorization = "Bearer"+ Oathtoken
And multipart field documents= {read:'classpath:testdoc.pdf', filename:'testdoc.pdf'content:'application/pdf'
 And multipart field Data= {read:'classpath:testreqpl.json', filename:'testreqpl.json'content:'multipart/form-data' 
And method POST
Then status 200
James Z
  • 12,209
  • 10
  • 24
  • 44
hamsa raj
  • 39
  • 1
  • 5
  • most likely a library conflict not related to karate. the ONLY way to get help is to follow this process: https://github.com/karatelabs/karate/wiki/How-to-Submit-an-Issue - also note that we released 6 RC versions precisely so that such problems can be identified, so now you may have to wait or use the old version – Peter Thomas May 11 '22 at 18:47

1 Answers1

0

Make sure you try the option to use the all classifier:

https://github.com/karatelabs/karate/wiki/1.2.0-Upgrade-Guide

<dependency>
  <groupId>com.intuit.karate</groupId>
  <artifactId>karate-core</artifactId>
  <version>${karate.version}</version>
  <classifier>all</classifier>
</dependency>
Peter Thomas
  • 54,465
  • 21
  • 84
  • 248
  • Let me try this option and confirm whether it works, I've also submitted this as an issue in the karate GitHub page – hamsa raj May 11 '22 at 20:08
  • I have added the Gradle equivalent of classifier as given below testCompile "com.karate:karate-junit5:1.2.0:all" but it's not working and keep hitting the same error as mentioned in the question jackson xml Unrecognized field "read" – hamsa raj May 12 '22 at 09:09
  • @hamsaraj I have nothing to add to my comments above – Peter Thomas May 12 '22 at 10:26