Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
409 views
in Technique[技术] by (71.8m points)

java - Karate Spring Integration

We have a Spring MVC application, Is it possible to integrate spring context in Karate ? .Say bind the SpringJunitRunner through the Karate runner. Or to lookup the bean by spring context ?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Anything is possible in Karate because you can always use Java interop.

You can use the documentation of the servlet-mocking as a reference: https://github.com/intuit/karate/tree/master/karate-mock-servlet

So you should be able to pass the context around as a config variable. Also I think there is a Spring helper to get access to an already running context (via Java) you can search for that also.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...