@Test void testValidatePackageNonSystem() { when(entityType.getPackage()).thenReturn(aPackage); when(aPackage.getId()).thenReturn("nosys"); entityTypeValidator.validatePackage(entityType); }
void validatePackage(EntityType entityType) { Package pack = entityType.getPackage(); if (pack != null && isSystemPackage(pack) && !systemEntityTypeRegistry.hasSystemEntityType(entityType.getId())) { throw new MolgenisValidationException( new ConstraintViolation( format( "Adding entity [%s] to system package [%s] is not allowed", entityType.getId(), pack.getId()))); } }
EntityTypeValidator { void validatePackage(EntityType entityType) { Package pack = entityType.getPackage(); if (pack != null && isSystemPackage(pack) && !systemEntityTypeRegistry.hasSystemEntityType(entityType.getId())) { throw new MolgenisValidationException( new ConstraintViolation( format( "Adding entity [%s] to system package [%s] is not allowed", entityType.getId(), pack.getId()))); } } }
EntityTypeValidator { void validatePackage(EntityType entityType) { Package pack = entityType.getPackage(); if (pack != null && isSystemPackage(pack) && !systemEntityTypeRegistry.hasSystemEntityType(entityType.getId())) { throw new MolgenisValidationException( new ConstraintViolation( format( "Adding entity [%s] to system package [%s] is not allowed", entityType.getId(), pack.getId()))); } } EntityTypeValidator(DataService dataService, SystemEntityTypeRegistry systemEntityTypeRegistry); }
EntityTypeValidator { void validatePackage(EntityType entityType) { Package pack = entityType.getPackage(); if (pack != null && isSystemPackage(pack) && !systemEntityTypeRegistry.hasSystemEntityType(entityType.getId())) { throw new MolgenisValidationException( new ConstraintViolation( format( "Adding entity [%s] to system package [%s] is not allowed", entityType.getId(), pack.getId()))); } } EntityTypeValidator(DataService dataService, SystemEntityTypeRegistry systemEntityTypeRegistry); void validate(EntityType entityType); }
EntityTypeValidator { void validatePackage(EntityType entityType) { Package pack = entityType.getPackage(); if (pack != null && isSystemPackage(pack) && !systemEntityTypeRegistry.hasSystemEntityType(entityType.getId())) { throw new MolgenisValidationException( new ConstraintViolation( format( "Adding entity [%s] to system package [%s] is not allowed", entityType.getId(), pack.getId()))); } } EntityTypeValidator(DataService dataService, SystemEntityTypeRegistry systemEntityTypeRegistry); void validate(EntityType entityType);  }