@Test public void testCreateMappingTableNameMappingName() { String table = "table"; String mappingName = "mapping"; Mapping mapping = mappingFactory.createMapping(table, mappingName); assertEquals(table, mapping.getTableName()); assertEquals(mappingName, mapping.getMappingName()); }
@Test public void testCreateMappingTableNameMappingNameKeyNameKeyType() { String table = "table"; String mappingName = "mapping"; String keyName = "keyName"; for (Mapping.KeyType type : Mapping.KeyType.values()) { Mapping mapping = mappingFactory.createMapping(table, mappingName, keyName, type); assertEquals(table, mapping.getTableName()); assertEquals(mappingName, mapping.getMappingName()); assertEquals(keyName, mapping.getKeyName()); assertEquals(type, mapping.getKeyType()); } Mapping mapping = mappingFactory.createMapping(table, mappingName, keyName, null); assertEquals(table, mapping.getTableName()); assertEquals(mappingName, mapping.getMappingName()); assertEquals(keyName, mapping.getKeyName()); assertNull(mapping.getKeyType()); }