v0.3.0
Breaking Changes
HTTP Client Abstraction
The HTTP Client used by Karate is pluggable and can be switched between Apache and Jersey. This is a significant change that 'future-proofs' Karate, and opens up various options - for example a Spring MVC Mock implementation. The main advantage for users is that if you run into class conflicts you can just switch and not be blocked. For example, if you want to include Karate tests within the same Java project as your web-app, and your web-app depends on an older version of Jersey - just use the Apache implementation.
So now you need two dependencies:
Before:
<dependency>
<groupId>com.intuit.karate</groupId>
<artifactId>karate-junit4</artifactId>
<version>0.2.9</version>
<scope>test</scope>
</dependency>After:
<dependency>
<groupId>com.intuit.karate</groupId>
<artifactId>karate-apache</artifactId>
<version>0.3.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.intuit.karate</groupId>
<artifactId>karate-junit4</artifactId>
<version>0.3.0</version>
<scope>test</scope>
</dependency>Other than the change to cookies (see below) this does not impact any existing test scripts or syntax.
cookies are map-like
If you were using the value of a cookie, each cookie is now a map-like object not a plain-string and the value can be accessed using the value key.
Before:
And def time = cookies.timeAfter:
And def time = cookies.time.valuePull Requests
#34 Binary response handling ( thanks @ambertests )
Other improvements
- new demo example for creating an array dynamically for a data-driven test
- new demo example for implementing test set-up routines that run only once similar to the JUnit @BeforeClass annotation