@SuppressWarnings("deprecation") @Test void getSqlCreateCheckConstraintWrongDataType() { EntityType entityType = when(mock(EntityType.class).getId()).thenReturn("entity").getMock(); when(entityType.getId()).thenReturn("entityTypeId"); Attribute attr = when(mock(Attribute.class).getName()).thenReturn("attr").getMock(); when(attr.getIdentifier()).thenReturn("attrId"); when(attr.getDataType()).thenReturn(STRING); assertThrows( MolgenisDataException.class, () -> PostgreSqlQueryGenerator.getSqlCreateCheckConstraint(entityType, attr)); }
static String getSqlCreateCheckConstraint(EntityType entityType, Attribute attr) { return "ALTER TABLE " + getTableName(entityType) + " ADD " + getSqlCheckConstraint(entityType, attr); }
PostgreSqlQueryGenerator { static String getSqlCreateCheckConstraint(EntityType entityType, Attribute attr) { return "ALTER TABLE " + getTableName(entityType) + " ADD " + getSqlCheckConstraint(entityType, attr); } }
PostgreSqlQueryGenerator { static String getSqlCreateCheckConstraint(EntityType entityType, Attribute attr) { return "ALTER TABLE " + getTableName(entityType) + " ADD " + getSqlCheckConstraint(entityType, attr); } private  PostgreSqlQueryGenerator(); }
PostgreSqlQueryGenerator { static String getSqlCreateCheckConstraint(EntityType entityType, Attribute attr) { return "ALTER TABLE " + getTableName(entityType) + " ADD " + getSqlCheckConstraint(entityType, attr); } private  PostgreSqlQueryGenerator();  }
PostgreSqlQueryGenerator { static String getSqlCreateCheckConstraint(EntityType entityType, Attribute attr) { return "ALTER TABLE " + getTableName(entityType) + " ADD " + getSqlCheckConstraint(entityType, attr); } private  PostgreSqlQueryGenerator();   }