cancel
Showing results for 
Search instead for 
Did you mean: 

Identify Security tests in a TestRunListener.afterRun listener

Highlighted
New Contributor

Identify Security tests in a TestRunListener.afterRun listener

I want to handle afterRun events for normal tests and security tests separately. I tried implementing the below two listeners. 

TestRunListener.afterRun

SecurityTestRunListener.afterRun

I expected these to be mutually exclusive. However, the TestRunListener.afterRun seems to get triggered at the end of Security tests as well. I tried identifying security tests with the name of the test case. But the below statement in the TestRunListener.afterRun gives the name of the functional test even at the end of the security test. 

log.info(testRunner.testCase.getName())

I expected to get something like 'SecurityTest 10'. But received 'GETVersion200' (name of my functional test). 

How do I differentiate a functional test run from a security test run in the TestRunListener.afterRun listener?

New Here?
Join us and watch the welcome video:
Watch the New Interview
APITestingMistake#2
Top Kudoed Authors