@Override
    protected void validateConcreteMaterial(ValidationContext validationContext) {
        if (StringUtils.isBlank(packageId)) {
            addError(PACKAGE_ID, "Please select a repository and package");
        }
    }
@Test
    public void shouldAddErrorIfMaterialDoesNotHaveAPackageId() throws Exception {
        PackageMaterialConfig packageMaterialConfig = new PackageMaterialConfig();
        packageMaterialConfig.validateConcreteMaterial(new ConfigSaveValidationContext(null, null));

        assertThat(packageMaterialConfig.errors().getAll().size(), is(1));
        assertThat(packageMaterialConfig.errors().on(PackageMaterialConfig.PACKAGE_ID), is("Please select a repository and package"));
    }