Skip to content

Instantly share code, notes, and snippets.

View nguyenvanthan's full-sized avatar

Christian NGUYEN VAN THAN nguyenvanthan

  • Nextperf
  • France
View GitHub Profile
@nguyenvanthan
nguyenvanthan / gist:7642092
Created November 25, 2013 14:34
How to test validation annotation in JUnit
@BeforeClass
public static void setUp() {
ValidatorFactory factory = Validation.buildDefaultValidatorFactory();
validator = factory.getValidator();
}
@Test
public void manufacturerIsNull() {
Car car = new Car(null, "DD-AB-123", 4);