JUnit 5 test case result not reflecting even changed the logic

I am trying to use junit5 in spring-boot application in intelliJ IDE. I am getting issue in not reflecting result of junit test when I run it individual. while I run using mvn clean install command, my test cases gets executed and work fine but when I run it individual test case, result remain same . its always showing last result which I got from cmd mvn clean install..even I have changed code. its not reflecting. Below are using:

        <artifactId>spring-boot-starter-parent</artifactId>         <version>2.3.0.RELEASE</version> 

below are dependencies:

<dependency>             <groupId>org.springframework.boot</groupId>             <artifactId>spring-boot-starter-test</artifactId>             <scope>test</scope>         </dependency> <dependency>             <groupId>org.mockito</groupId>             <artifactId>mockito-core</artifactId>             <version>3.3.3</version>         </dependency>         <dependency>             <groupId>org.mockito</groupId>             <artifactId>mockito-junit-jupiter</artifactId>             <version>3.3.3</version>             <scope>test</scope>         </dependency>         <dependency>             <groupId>org.junit.jupiter</groupId>             <artifactId>junit-jupiter-engine</artifactId>             <version>5.6.2</version>             <scope>test</scope>         </dependency> 

My test case:

import static org.junit.jupiter.api.Assertions.assertEquals; import org.junit.jupiter.api.Test;  public class TestingApplicationTests {     @Test     public void contextLoads() {         assertEquals("abc", "abc");     } } 

if I change it to

import static org.junit.jupiter.api.Assertions.assertEquals; import org.junit.jupiter.api.Test;  public class TestingApplicationTests {     @Test     public void contextLoads() {         assertEquals("abc", "123");     } } 

and run again this single test with right click "Run" it will be passed if last result from mvn install was passed. My question is why its not reflecting my result?. it should fail in second case.

Add Comment
0 Answer(s)

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.