DefaultPartialRequest { public PartialRequest getDefaultPartialRequest() { String query = partialRequestConfig.getQuery(); if (query == null) { return null; } PartialRequest partialRequest = new PartialRequest(); partialRequest.setQuery(query); Set<String> unknowns = partialRequestConfig.getUnknowns(); if (unknowns != null) { partialRequest.setUnknowns(unknowns); } Map<String, Object> input = createInputObj(); partialRequest.setInput(input); if (partialRequestConfig.isLogPartialRequest()) { logPartialRequestJsonString(partialRequest); } return partialRequest; } DefaultPartialRequest();  DefaultPartialRequest(HttpServletRequest httpServletRequest, PartialRequestConfig partialRequestConfig); PartialRequest getDefaultPartialRequest();  }
@Test void shouldReturnNullIfQueryIsNotSetInfPartialRequestConfig() { final HttpServletRequest mockHttpServletRequest = mock(HttpServletRequest.class); when(mockHttpServletRequest.getMethod()).thenReturn(GET); when(mockHttpServletRequest.getServletPath()).thenReturn(PATH); DefaultPartialRequest target = new DefaultPartialRequest(mockHttpServletRequest, new PartialRequestConfig()); PartialRequest result = target.getDefaultPartialRequest(); assertThat(result, is(nullValue())); }