Skip to content
Advertisement

Can’t attach RestAssured’s RQ/RS of Spring Cloud Contract’s tests to Allure report

I’ve successfully added Allure2 to my project with Spring Cloud Contract tests (it uses JUnit5), but tab “Overview” is blank in all successed test of report.

I created a listener class, that gets RQ and RS from RestAssured:

JavaScript

And runner class, that uses listener class:

JavaScript

And then I’ve added runner class to my base test class:

JavaScript

But no record was added to my Allure report and, as I see in debugger, content of listener and runner is never used 🙁 What am I doing wrong?

Advertisement

Answer

I learned that SCC does not use JUnit to run tests, but uses SpringBootTest .

So I’ve created a SBT listener class:

JavaScript

And added that to my SCC base test class:

JavaScript

Now it works and I have 2 log sections in my Allure report.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement