It is very easy to extend Karate via Java Interop. The best way to understand this, is to look at this demo example which uses JDBC to call a database: dogs.feature
.
It is worth calling out here that if you return a Map
(or List
of Map
s) from Java - you are back in JSON-land within Karate, and you can use match
and all the other data-driven goodness of Karate.
Yes, it is that easy - and you don't have the un-necessary overhead of Step Definitions and dependency injection.
Hope this makes it clear as to why you don't need step definitions at all !
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…