@Test public void testInvalidErrorNamespaces() { for (String invalid : new String[] {"conjure", "palantirFoo", "palantir-foo", "PALANTIR-FOO", "palantir_foo", "PALANTIR_FOO" }) { assertThatThrownBy(() -> ErrorNamespaceValidator.validate(ErrorNamespace.of(invalid))) .isInstanceOf(IllegalArgumentException.class) .hasMessageContaining("Namespace for errors must match pattern") .hasMessageContaining(invalid); } }
public static void validate(ErrorNamespace name) { Preconditions.checkArgument( UPPER_CAMEL_CASE.matcher(name.get()).matches(), "Namespace for errors must match pattern %s: %s", UPPER_CAMEL_CASE, name); }
ErrorNamespaceValidator { public static void validate(ErrorNamespace name) { Preconditions.checkArgument( UPPER_CAMEL_CASE.matcher(name.get()).matches(), "Namespace for errors must match pattern %s: %s", UPPER_CAMEL_CASE, name); } }
ErrorNamespaceValidator { public static void validate(ErrorNamespace name) { Preconditions.checkArgument( UPPER_CAMEL_CASE.matcher(name.get()).matches(), "Namespace for errors must match pattern %s: %s", UPPER_CAMEL_CASE, name); } private  ErrorNamespaceValidator(); }
ErrorNamespaceValidator { public static void validate(ErrorNamespace name) { Preconditions.checkArgument( UPPER_CAMEL_CASE.matcher(name.get()).matches(), "Namespace for errors must match pattern %s: %s", UPPER_CAMEL_CASE, name); } private  ErrorNamespaceValidator(); static void validate(ErrorNamespace name); }
ErrorNamespaceValidator { public static void validate(ErrorNamespace name) { Preconditions.checkArgument( UPPER_CAMEL_CASE.matcher(name.get()).matches(), "Namespace for errors must match pattern %s: %s", UPPER_CAMEL_CASE, name); } private  ErrorNamespaceValidator(); static void validate(ErrorNamespace name);  }