@Test
public void testInclude() throws IOException {

	ScopedCSSVariablesTopHeadDynamicInclude
		scopedCSSVariablesTopHeadDynamicInclude =
			new ScopedCSSVariablesTopHeadDynamicInclude();
	ScopedCSSVariablesProvider scopedCSSVariablesProvider = Mockito.mock(
		ScopedCSSVariablesProvider.class);
	Collection<ScopedCSSVariables> scopedCSSVariables = Arrays.asList(
		new ScopedCSSVariables() {
			@Override
			public Map<String, String> getCSSVariables() {
				return Collections.singletonMap("color", "red");
			}
			@Override
			public String getScope() {
				return ":root";
			}
		});
	Mockito.when(
		scopedCSSVariablesProvider.getScopedCSSVariablesCollection(
			Mockito.any(HttpServletRequest.class))
	).thenReturn(
		scopedCSSVariables
	);
	scopedCSSVariablesTopHeadDynamicInclude.setScopedCSSVariablesProviders(
		Arrays.asList(scopedCSSVariablesProvider));
	HttpServletRequest httpServletRequest = Mockito.mock(
		HttpServletRequest.class);
	HttpServletResponse httpServletResponse = Mockito.mock(
		HttpServletResponse.class);
	BufferCacheServletResponse bufferCacheServletResponse =
		new BufferCacheServletResponse(httpServletResponse);
	scopedCSSVariablesTopHeadDynamicInclude.include(
		httpServletRequest, bufferCacheServletResponse,
		"/html/common/themes/top_head.jsp#post");
	Assert.assertEquals(
		_read("liferay_css_variables_1.html", true),
		bufferCacheServletResponse.getString());
}