@Test
public void should_throw_NotAllowedException_when_find_external_asset() throws Exception {

    exception.expect(NotAllowedException.class);
    exception.expectMessage("We can't load an external asset. Use the link http://mycdnserver.myasset.js");
    Page page = aPage().withId("page-id").build();
    Asset asset = aFilledAsset(page);
    asset.setName("http://mycdnserver.myasset.js");
    asset.setExternal(true);
    when(pageRepository.get("page-id")).thenReturn(
            aPage().withAsset(asset).build());
    assetRepository.findAssetPath(
    "page-id", "http://mycdnserver.myasset.js", AssetType.JAVASCRIPT);
}