Junit testing assert output not being displayed on console

21 views
Skip to first unread message

Mohammed Suleman khan

unread,
Nov 25, 2015, 7:17:11 PM11/25/15
to JUnit Helper Group
I am trying to implement Junit test using Spring boot I have written some simple test when I am running the ApplicationTests.groovy as junit test it showing green color bar when the test is successful and red upon errors but it is not displaying any output I am getting empty stack trace upon successful test methods though I am using assert. any suggestions ?

import org.junit.Test
import org.junit.runner.RunWith
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.test.SpringApplicationConfiguration
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner
import org.springframework.test.context.web.WebAppConfiguration
import org.junit.Assert.*;
@RunWith(SpringJUnit4ClassRunner)
@SpringApplicationConfiguration(classes = Application)
@WebAppConfiguration
class ApplicationTests {

    @Test
    void testAssertions() {
        assertTrue(1 == 1)
        assertEquals("test", "test")

        def x = "42"
        assertNotNull "x must not be null", x
        assertNull null

        assertSame x, x
    } 
}


Reply all
Reply to author
Forward
0 new messages