AllianceBrandingPlugin implements BrandingPlugin { public void init() { try { PropertiesConfiguration propertiesConfiguration = new PropertiesConfiguration(getClass().getResource(brandingPropertiesFilePath)); productName = propertiesConfiguration.getString("branding.product.name", "Alliance"); productURL = propertiesConfiguration.getString("branding.product.url", ALLIANCE_URL); productImage = propertiesConfiguration.getString("branding.product.image", ALLIANCE_LOGO); vendorName = propertiesConfiguration.getString("branding.vendor.name", "Codice Foundation"); vendorURL = propertiesConfiguration.getString("branding.vendor.url", "http: vendorImage = propertiesConfiguration.getString("branding.vendor.image", ALLIANCE_LOGO); favIcon = propertiesConfiguration.getString("branding.favicon", "/alliance/favicon.ico"); } catch (ConfigurationException e) { LOGGER.info("Unable to read properties file {}", brandingPropertiesFilePath, e.getMessage()); productName = "Alliance"; productURL = ALLIANCE_URL; productImage = ALLIANCE_LOGO; vendorName = "Codice Foundation"; vendorURL = ALLIANCE_URL; vendorImage = ALLIANCE_LOGO; favIcon = "/alliance/favicon.ico"; } } AllianceBrandingPlugin(String brandingPropertiesFilePath); void init(); @Override String getFavIcon(); @Override String getProductImage(); @Override String getProductName(); @Override String getProductURL(); @Override String getVendorImage(); @Override String getVendorName(); @Override String getVendorURL(); @Override String getBase64VendorImage(); @Override String getBase64FavIcon(); @Override String getBase64ProductImage();  }
@Test public void testInit() { allianceBrandingPlugin.init(); assertThat( allianceBrandingPlugin.getProductName(), is(equalTo(productName + " " + System.getProperty("projectVersion")))); assertThat(allianceBrandingPlugin.getProductURL(), is(equalTo(productURL))); assertThat(allianceBrandingPlugin.getProductImage(), is(equalTo(productImage))); assertThat(allianceBrandingPlugin.getVendorName(), is(equalTo(vendorName))); assertThat(allianceBrandingPlugin.getVendorURL(), is(equalTo(vendorURL))); assertThat(allianceBrandingPlugin.getVendorImage(), is(equalTo(vendorImage))); assertThat(allianceBrandingPlugin.getFavIcon(), is(equalTo(favIcon))); }