assert SortAsHelper.getSortAsForValue("Artist", "äöåéíü").equals("AOAEIU");
}
@Test
public void testMatching() {
configurationParameterRepository.merge(new ConfigurationParameterEntity(PREFIX + "Artist.sortAsExpression", ConfigurationParameter.Type.STRING, "^(.*) ([^ ]*)$"));
configurationParameterRepository.merge(new ConfigurationParameterEntity(PREFIX + "Artist.sortAsValue", ConfigurationParameter.Type.STRING, "$2 $1"));
assert SortAsHelper.getSortAsForValue("Artist", "Frank Zappa").equals("ZAPPA FRANK");
assert SortAsHelper.getSortAsForValue("Artist", "Wolfgang Amadeus Mozart").equals("MOZART WOLFGANG AMADEUS");
configurationParameterRepository.merge(new ConfigurationParameterEntity(PREFIX + "Artist.sortAsExpression", ConfigurationParameter.Type.STRING, "^(.*) ([^ ]*)$"));
configurationParameterRepository.merge(new ConfigurationParameterEntity(PREFIX + "Artist.sortAsValue", ConfigurationParameter.Type.STRING, "$2"));
assert SortAsHelper.getSortAsForValue("Artist", "Frank Zappa").equals("ZAPPA");
assert SortAsHelper.getSortAsForValue("Artist", "Wolfgang Amadeus Mozart").equals("MOZART");
configurationParameterRepository.merge(new ConfigurationParameterEntity(PREFIX + "Artist.sortAsExpression", ConfigurationParameter.Type.STRING, ""));
configurationParameterRepository.merge(new ConfigurationParameterEntity(PREFIX + "Artist.sortAsValue", ConfigurationParameter.Type.STRING, ""));
assert SortAsHelper.getSortAsForValue("Artist", "Frank Zappa").equals("FRANK ZAPPA");
assert SortAsHelper.getSortAsForValue("Artist", "Wolfgang Amadeus Mozart").equals("WOLFGANG AMADEUS MOZART");
}