}
@Test
public void should_select_webapp_as_a_first_authorized_location() {
AssetStorageUnit asu = new AssetStorageUnit();
asu.setName("asset-name");
asu.setType(AssetType.js);
asu.setVersion("1.0.0");
Map<String, String> locations = new HashMap<String, String>();
locations.put("cdn", "//asset-name.js");
locations.put("webapp", "/assets/js/asset-name.js");
locations.put("classpath", "/foo/bar/asset-name.js");
asu.setLocations(locations);
Asset asset = assetMapper.mapToAsset(asu);
assertThat(asset.getConfigLocation()).isEqualTo("/assets/js/asset-name.js");
assertThat(asset.getConfigLocationKey()).isEqualTo("webapp");
assertThat(asset.getFinalLocation()).isEqualTo("/context/assets/js/asset-name.js");
}