CSSInclude { public @Nullable String getInclude() { return include; }  @Nullable String getInclude();  }
@Test void testSingle() { context.request().setAttribute("categories", CATEGORY_SINGLE); CSSInclude underTest = AdaptTo.notNull(context.request(), CSSInclude.class); assertEquals("<link rel=\"stylesheet\" href=\"/etc/clientlibs/app1/clientlib1.min.css\" type=\"text/css\">\n", underTest.getInclude()); }
@Test void testSingleUnminified() { when(htmlLibraryManager.isMinifyEnabled()).thenReturn(false); context.request().setAttribute("categories", CATEGORY_SINGLE); CSSInclude underTest = AdaptTo.notNull(context.request(), CSSInclude.class); assertEquals("<link rel=\"stylesheet\" href=\"/etc/clientlibs/app1/clientlib1.css\" type=\"text/css\">\n", underTest.getInclude()); }
@Test void testSingleProxy() { context.request().setAttribute("categories", CATEGORY_SINGLE_PROXY); CSSInclude underTest = AdaptTo.notNull(context.request(), CSSInclude.class); assertEquals("<link rel=\"stylesheet\" href=\"/etc.clientlibs/app1/clientlibs/clientlib2_proxy.min.css\" type=\"text/css\">\n", underTest.getInclude()); }
@Test void testMulti() { context.request().setAttribute("categories", CATEGORIES_MULTIPLE); CSSInclude underTest = AdaptTo.notNull(context.request(), CSSInclude.class); assertEquals("<link rel=\"stylesheet\" href=\"/etc/clientlibs/app1/clientlib3.min.css\" type=\"text/css\">\n" + "<link rel=\"stylesheet\" href=\"/etc.clientlibs/app1/clientlibs/clientlib4_proxy.min.css\" type=\"text/css\">\n" + "<link rel=\"stylesheet\" href=\"/etc.clientlibs/app1/clientlibs/clientlib5_proxy.min.css\" type=\"text/css\">\n", underTest.getInclude()); }
@Test void testInvalid() { context.request().setAttribute("categories", CATEGORY_INVALID); CSSInclude underTest = AdaptTo.notNull(context.request(), CSSInclude.class); assertNull(underTest.getInclude()); }
@Test void testMissingCategoryNoAttributes() { CSSInclude underTest = AdaptTo.notNull(context.request(), CSSInclude.class); assertNull(underTest.getInclude()); }
@Test @SuppressWarnings("null") void testSingleNotAccessible() throws PersistenceException { context.request().setAttribute("categories", CATEGORY_SINGLE); context.resourceResolver().delete(context.resourceResolver().getResource("/etc/clientlibs/app1/clientlib1")); CSSInclude underTest = AdaptTo.notNull(context.request(), CSSInclude.class); assertNull(underTest.getInclude()); }