@Test public void shouldOnlyValidateStrings() { { boolean valid = validator.isValid("44474042000130", context); assertTrue(valid); } }
@Test public void shouldValidateEmpty() { boolean valid = validator.isValid("", context); assertTrue(valid); }
@Test public void shouldValidateNull() { boolean valid = validator.isValid(null, context); assertTrue(valid); }
@Before public void createValidator() throws Exception { CNPJ cnpjAnnotation = ObjectWithCNPJ.class.getDeclaredField("cnpj").getAnnotation(CNPJ.class); validator = new StellaCNPJValidator(); validator.initialize(cnpjAnnotation); }