package com.github.aureliano.almamater.annotation.validation.apply;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

import org.junit.Test;

public class ConstraintViolationTest {

	@Test
	public void testEquals() {
		ConstraintViolation c1 = new ConstraintViolation();
		assertFalse(c1.equals(null));
		
		ConstraintViolation c2 = new ConstraintViolation();
		assertEquals(c1, c2);
		
		c1.withMessage("A test message.");
		assertFalse(c1.equals(c2));
		
		c2.withMessage("A test message.");
		assertTrue(c1.equals(c2));
		
		/*c1.withValidator(NotNull.class);
		assertFalse(c1.equals(c2));
		
		c2.withValidator(Override.class);
		assertFalse(c1.equals(c2));
		
		c2.withValidator(NotNull.class);
		assertTrue(c1.equals(c2));*/
	}
}
@@ -219,16 +219,86 @@
 .Test;%0A%0A
+import com.github.aureliano.almamater.annotation.validation.NotNull;%0A%0A
 public c
@@ -679,10 +679,8 @@
 %09%0A%09%09
-/*
 c1.w
@@ -877,10 +877,8 @@
 2));
-*/
 %0A%09%7D%0A

Apply constraint violation test.