### Question:
ResponseUtils { @SuppressWarnings("PMD.AvoidReassigningParameters") public <T extends OnlineBankingResponse> ResponseEntity<T> redirect(String locationURI, HttpServletResponse httpResp) { HttpHeaders headers = new HttpHeaders(); if (!UrlUtils.isAbsoluteUrl(locationURI)) { locationURI = "http: } headers.add(LOCATION_HEADER_NAME, locationURI); removeCookies(httpResp); return new ResponseEntity<>(headers, HttpStatus.FOUND); }  void setCookies(HttpServletResponse response, ConsentReference consentReference, String accessTokenString,
			AccessTokenTO accessTokenTO); void removeCookies(HttpServletResponse response); ResponseEntity<T> unknownCredentials(
			T resp, HttpServletResponse httpResp); ResponseEntity<T> couldNotProcessRequest(T authResp, String message,
			HttpStatus status, HttpServletResponse httpResp); @SuppressWarnings("PMD.AvoidReassigningParameters") ResponseEntity<T> redirect(String locationURI, HttpServletResponse httpResp); ResponseEntity<T> error(T authResp, HttpStatus status, String message, HttpServletResponse response); String consentCookie(String cookieString); static final String CONSENT_COOKIE_NAME; static final String ACCESS_TOKEN_COOKIE_NAME; static final String UNKNOWN_CREDENTIALS; }### Answer:
@Test void redirect_relative_url() { HttpServletResponse response = Mockito.mock(HttpServletResponse.class); when(cookieConfigProperties.getPath()).thenReturn("somePath"); ResponseEntity<OnlineBankingResponse> responseResponseEntity = responseUtils.redirect("www.google.com", response); assertTrue(responseResponseEntity.getStatusCode().is3xxRedirection()); assertSame(HttpStatus.FOUND, responseResponseEntity.getStatusCode()); assertEquals("http: }
@Test void redirect_absolute_url() { HttpServletResponse response = Mockito.mock(HttpServletResponse.class); when(cookieConfigProperties.getPath()).thenReturn("somePath"); ResponseEntity<OnlineBankingResponse> responseResponseEntity = responseUtils.redirect("http: assertTrue(responseResponseEntity.getStatusCode().is3xxRedirection()); assertSame(HttpStatus.FOUND, responseResponseEntity.getStatusCode()); assertEquals("http: }
@Test void redirect() { HttpServletResponse response = Mockito.mock(HttpServletResponse.class); when(cookieConfigProperties.getPath()).thenReturn("somePath"); ResponseEntity<OnlineBankingResponse> responseResponseEntity = responseUtils.redirect("locationURI", response); assertTrue(responseResponseEntity.getStatusCode().is3xxRedirection()); assertSame(HttpStatus.FOUND, responseResponseEntity.getStatusCode()); }