@Test
public void testInvalidPackageNames() {

    for (String illegal : new String[] {".", "foo-bar", "foo_bar", "1a", "a.foo"}) {
        assertThatThrownBy(() -> PackageValidator.validate(illegal))
                .isInstanceOf(IllegalArgumentException.class)
                .hasMessage("Conjure package names must match pattern ^([a-z][a-z0-9]+(\\.[a-z][a-z0-9]*)*)?$: "
                        + illegal);
    }
}