@Test public void createWorldpayAdditionalInfoDataShouldSetAcceptHeaderFromHttpRequest() { when(httpServletRequestMock.getHeader(ACCEPT)).thenReturn(ACCEPT_HEADER_VALUE); final WorldpayAdditionalInfoData result = testObj.createWorldpayAdditionalInfoData(httpServletRequestMock); assertEquals(ACCEPT_HEADER_VALUE, result.getAcceptHeader()); }
@Override public WorldpayAdditionalInfoData createWorldpayAdditionalInfoData(final HttpServletRequest request) { final WorldpayAdditionalInfoData additionalInfoData = new WorldpayAdditionalInfoData(); final String sessionId = request.getSession().getId(); additionalInfoData.setSessionId(sessionId); sessionService.setAttribute(WORLDPAY_ADDITIONAL_DATA_SESSION_ID, sessionId); additionalInfoData.setCustomerIPAddress(worldpayCustomerIpAddressStrategy.getCustomerIp(request)); additionalInfoData.setAcceptHeader(request.getHeader(ACCEPT)); additionalInfoData.setUserAgentHeader(request.getHeader(USER_AGENT)); return additionalInfoData; }
DefaultWorldpayAdditionalInfoService implements WorldpayAdditionalInfoService { @Override public WorldpayAdditionalInfoData createWorldpayAdditionalInfoData(final HttpServletRequest request) { final WorldpayAdditionalInfoData additionalInfoData = new WorldpayAdditionalInfoData(); final String sessionId = request.getSession().getId(); additionalInfoData.setSessionId(sessionId); sessionService.setAttribute(WORLDPAY_ADDITIONAL_DATA_SESSION_ID, sessionId); additionalInfoData.setCustomerIPAddress(worldpayCustomerIpAddressStrategy.getCustomerIp(request)); additionalInfoData.setAcceptHeader(request.getHeader(ACCEPT)); additionalInfoData.setUserAgentHeader(request.getHeader(USER_AGENT)); return additionalInfoData; } }
DefaultWorldpayAdditionalInfoService implements WorldpayAdditionalInfoService { @Override public WorldpayAdditionalInfoData createWorldpayAdditionalInfoData(final HttpServletRequest request) { final WorldpayAdditionalInfoData additionalInfoData = new WorldpayAdditionalInfoData(); final String sessionId = request.getSession().getId(); additionalInfoData.setSessionId(sessionId); sessionService.setAttribute(WORLDPAY_ADDITIONAL_DATA_SESSION_ID, sessionId); additionalInfoData.setCustomerIPAddress(worldpayCustomerIpAddressStrategy.getCustomerIp(request)); additionalInfoData.setAcceptHeader(request.getHeader(ACCEPT)); additionalInfoData.setUserAgentHeader(request.getHeader(USER_AGENT)); return additionalInfoData; } DefaultWorldpayAdditionalInfoService(final WorldpayCustomerIpAddressStrategy worldpayCustomerIpAddressStrategy, final SessionService sessionService); }
DefaultWorldpayAdditionalInfoService implements WorldpayAdditionalInfoService { @Override public WorldpayAdditionalInfoData createWorldpayAdditionalInfoData(final HttpServletRequest request) { final WorldpayAdditionalInfoData additionalInfoData = new WorldpayAdditionalInfoData(); final String sessionId = request.getSession().getId(); additionalInfoData.setSessionId(sessionId); sessionService.setAttribute(WORLDPAY_ADDITIONAL_DATA_SESSION_ID, sessionId); additionalInfoData.setCustomerIPAddress(worldpayCustomerIpAddressStrategy.getCustomerIp(request)); additionalInfoData.setAcceptHeader(request.getHeader(ACCEPT)); additionalInfoData.setUserAgentHeader(request.getHeader(USER_AGENT)); return additionalInfoData; } DefaultWorldpayAdditionalInfoService(final WorldpayCustomerIpAddressStrategy worldpayCustomerIpAddressStrategy, final SessionService sessionService); @Override WorldpayAdditionalInfoData createWorldpayAdditionalInfoData(final HttpServletRequest request); }
DefaultWorldpayAdditionalInfoService implements WorldpayAdditionalInfoService { @Override public WorldpayAdditionalInfoData createWorldpayAdditionalInfoData(final HttpServletRequest request) { final WorldpayAdditionalInfoData additionalInfoData = new WorldpayAdditionalInfoData(); final String sessionId = request.getSession().getId(); additionalInfoData.setSessionId(sessionId); sessionService.setAttribute(WORLDPAY_ADDITIONAL_DATA_SESSION_ID, sessionId); additionalInfoData.setCustomerIPAddress(worldpayCustomerIpAddressStrategy.getCustomerIp(request)); additionalInfoData.setAcceptHeader(request.getHeader(ACCEPT)); additionalInfoData.setUserAgentHeader(request.getHeader(USER_AGENT)); return additionalInfoData; } DefaultWorldpayAdditionalInfoService(final WorldpayCustomerIpAddressStrategy worldpayCustomerIpAddressStrategy, final SessionService sessionService); @Override WorldpayAdditionalInfoData createWorldpayAdditionalInfoData(final HttpServletRequest request);  }