@Test void getSqlCreateUniqueKey() { 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); String expectedSql = "ALTER TABLE \"entityTypeId#c34894ba\" ADD CONSTRAINT \"entityTypeId#c34894ba_attr_key\" UNIQUE (\"attr\")"; assertEquals(expectedSql, PostgreSqlQueryGenerator.getSqlCreateUniqueKey(entityType, attr)); }
static String getSqlCreateUniqueKey(EntityType entityType, Attribute attr) { return "ALTER TABLE " + getTableName(entityType) + " ADD " + getSqlUniqueKey(entityType, attr); }
PostgreSqlQueryGenerator { static String getSqlCreateUniqueKey(EntityType entityType, Attribute attr) { return "ALTER TABLE " + getTableName(entityType) + " ADD " + getSqlUniqueKey(entityType, attr); } }
PostgreSqlQueryGenerator { static String getSqlCreateUniqueKey(EntityType entityType, Attribute attr) { return "ALTER TABLE " + getTableName(entityType) + " ADD " + getSqlUniqueKey(entityType, attr); } private  PostgreSqlQueryGenerator(); }
PostgreSqlQueryGenerator { static String getSqlCreateUniqueKey(EntityType entityType, Attribute attr) { return "ALTER TABLE " + getTableName(entityType) + " ADD " + getSqlUniqueKey(entityType, attr); } private  PostgreSqlQueryGenerator();  }
PostgreSqlQueryGenerator { static String getSqlCreateUniqueKey(EntityType entityType, Attribute attr) { return "ALTER TABLE " + getTableName(entityType) + " ADD " + getSqlUniqueKey(entityType, attr); } private  PostgreSqlQueryGenerator();   }