Rectangle 27 0

Step 3: Verify Junit installation in Eclipse

* This class prints the given message on console.
public class MessageUtil {

   private String message;

   //@param message to be printed
   public MessageUtil(String message){
      this.message = message;
   // prints the message
   public String printMessage(){
      return message;
import org.junit.Test;
import static org.junit.Assert.assertEquals;

public class TestJunit {
   String message = "Hello World";	
   MessageUtil messageUtil = new MessageUtil(message);

   public void testPrintMessage() {	  

Following should be the project structure

Finally, verify the output of the program by right click on program and run as junit

Verify the result