### Question:
DefaultGroupExtractor implements GroupExtractor { public boolean isMinimized(final HttpServletRequest request) { Validate.notNull(request); final String minimizeAsString = request.getParameter(PARAM_MINIMIZE); return !(Context.get().getConfig().isDebug() && "false".equalsIgnoreCase(minimizeAsString)); }  String getGroupName(final HttpServletRequest request); ResourceType getResourceType(final HttpServletRequest request); String encodeGroupUrl(final String groupName, final ResourceType resourceType, final boolean minimize); boolean isMinimized(final HttpServletRequest request); static final String ATTR_INCLUDE_PATH; static final String PARAM_MINIMIZE; }### Answer:
@Test(expected = NullPointerException.class) public void cannotExtractMinimizedWithNullRequest() { groupExtractor.isMinimized(null); }
@Test public void testMinimizedWithoutParams() { final HttpServletRequest request = Mockito.mock(HttpServletRequest.class); assertTrue(groupExtractor.isMinimized(request)); }
@Test public void testMinimizedWithTrueParam() { final HttpServletRequest request = Mockito.mock(HttpServletRequest.class); Mockito.when(request.getParameter(DefaultGroupExtractor.PARAM_MINIMIZE)).thenReturn("true"); assertTrue(groupExtractor.isMinimized(request)); }
@Test public void testMinimizedWithFalseParam() { final HttpServletRequest request = Mockito.mock(HttpServletRequest.class); Mockito.when(request.getParameter(DefaultGroupExtractor.PARAM_MINIMIZE)).thenReturn("false"); assertFalse(groupExtractor.isMinimized(request)); }
@Test public void testMinimizedWithFalseParamInDEPLOYMENTMode() { final WroConfiguration config = new WroConfiguration(); config.setDebug(false); Context.get().setConfig(config); final HttpServletRequest request = Mockito.mock(HttpServletRequest.class); Mockito.when(request.getParameter(DefaultGroupExtractor.PARAM_MINIMIZE)).thenReturn("false"); assertTrue(groupExtractor.isMinimized(request)); }
@Test public void testMinimizedWithInvalidParamValue() { final HttpServletRequest request = Mockito.mock(HttpServletRequest.class); Mockito.when(request.getParameter(DefaultGroupExtractor.PARAM_MINIMIZE)).thenReturn("someInvalidBoolean"); assertTrue(groupExtractor.isMinimized(request)); }