void () { final StringBuffer buf = new StringBuffer(); final IDEATestNGRemoteListener listener = createListener(buf); final String className = "a.ATest"; listener.onSuiteStart(className, true); final MockTestNGResult result = new MockTestNGResult("ATest", "testMe", null, new Object[]{null, null}); listener.onTestStart(result); listener.onTestFinished(result); final MockTestNGResult tearDown = new MockTestNGResult(className, "tearDown", null, new Object[] {new MyTestTestResult()}); listener.onConfigurationStart(tearDown); listener.onConfigurationSuccess(tearDown); listener.onSuiteFinish(className); Assert.assertEquals("output: " + buf, """ ##teamcity[enteredTheMatrix] ##teamcity[testSuiteStarted name ='ATest' locationHint = 'java:suite://a.ATest'] ##teamcity[testStarted name='ATest.testMe|[null, null|]' locationHint='java:test://ATest/testMe'] ##teamcity[testFinished name='ATest.testMe|[null, null|]'] ##teamcity[testStarted name='ATest.tearDown|[testName|]' locationHint='java:test://a.ATest/tearDown' config='true'] ##teamcity[testFinished name='ATest.tearDown|[testName|]'] ##teamcity[testSuiteFinished name='a.ATest'] """, StringUtil.convertLineSeparators(buf.toString())); }