@Test void testValidateExtendsValid() { when(entityType.getExtends()).thenReturn(parent); when(parent.isAbstract()).thenReturn(true); EntityTypeValidator.validateExtends(entityType); }
static void validateExtends(EntityType entityType) { EntityType entityTypeExtends = entityType.getExtends(); if (entityTypeExtends != null && !entityTypeExtends.isAbstract()) { throw new MolgenisValidationException( new ConstraintViolation( format( "EntityType [%s] is not abstract; EntityType [%s] can't extend it", entityTypeExtends.getId(), entityType.getId()))); } }
EntityTypeValidator { static void validateExtends(EntityType entityType) { EntityType entityTypeExtends = entityType.getExtends(); if (entityTypeExtends != null && !entityTypeExtends.isAbstract()) { throw new MolgenisValidationException( new ConstraintViolation( format( "EntityType [%s] is not abstract; EntityType [%s] can't extend it", entityTypeExtends.getId(), entityType.getId()))); } } }
EntityTypeValidator { static void validateExtends(EntityType entityType) { EntityType entityTypeExtends = entityType.getExtends(); if (entityTypeExtends != null && !entityTypeExtends.isAbstract()) { throw new MolgenisValidationException( new ConstraintViolation( format( "EntityType [%s] is not abstract; EntityType [%s] can't extend it", entityTypeExtends.getId(), entityType.getId()))); } } EntityTypeValidator(DataService dataService, SystemEntityTypeRegistry systemEntityTypeRegistry); }
EntityTypeValidator { static void validateExtends(EntityType entityType) { EntityType entityTypeExtends = entityType.getExtends(); if (entityTypeExtends != null && !entityTypeExtends.isAbstract()) { throw new MolgenisValidationException( new ConstraintViolation( format( "EntityType [%s] is not abstract; EntityType [%s] can't extend it", entityTypeExtends.getId(), entityType.getId()))); } } EntityTypeValidator(DataService dataService, SystemEntityTypeRegistry systemEntityTypeRegistry); void validate(EntityType entityType); }
EntityTypeValidator { static void validateExtends(EntityType entityType) { EntityType entityTypeExtends = entityType.getExtends(); if (entityTypeExtends != null && !entityTypeExtends.isAbstract()) { throw new MolgenisValidationException( new ConstraintViolation( format( "EntityType [%s] is not abstract; EntityType [%s] can't extend it", entityTypeExtends.getId(), entityType.getId()))); } } EntityTypeValidator(DataService dataService, SystemEntityTypeRegistry systemEntityTypeRegistry); void validate(EntityType entityType);  }