use of org.codice.ddf.branding.BrandingRegistry in project ddf by codice.
the class TestLandingPage method setupLandingPage.
@BeforeClass
public static void setupLandingPage() throws IOException {
BrandingPlugin brandingPlugin = mock(BrandingPlugin.class);
when(brandingPlugin.getBase64FavIcon()).thenReturn("");
when(brandingPlugin.getBase64ProductImage()).thenReturn(Base64.getEncoder().encodeToString(fakeImg.getBytes()));
landingPage = new LandingPage();
BrandingRegistry branding = mock(BrandingRegistryImpl.class);
when(branding.getProductName()).thenReturn(productName);
when(branding.getProductVersion()).thenReturn(version);
when(branding.getBrandingPlugins()).thenReturn(Collections.singletonList(brandingPlugin));
when(branding.getAttributeFromBranding(any())).thenCallRealMethod();
landingPage.setBranding(branding);
String firstDateLeadingZeroes = "05/07/20 stuff happened";
String secondDateNoLeadingZeroes = "4/3/20 old stuff happened";
String noDate = "something happened";
List<String> unsorted = Arrays.asList(secondDateNoLeadingZeroes, noDate, firstDateLeadingZeroes);
sorted = Arrays.asList(firstDateLeadingZeroes, secondDateNoLeadingZeroes, noDate);
landingPage.setAnnouncements(unsorted);
}
use of org.codice.ddf.branding.BrandingRegistry in project ddf by codice.
the class TestLandingPage method testDefaultTitle.
@Test
public void testDefaultTitle() {
BrandingRegistry brandingPlugin = mock(BrandingRegistry.class);
when(brandingPlugin.getProductName()).thenReturn("DDF");
LandingPage landingPage = new LandingPage();
landingPage.setBranding(brandingPlugin);
assertThat(landingPage.getTitle(), is(equalTo("DDF")));
}
Aggregations