DefaultWorldpaySessionService implements WorldpaySessionService { @Override public ChallengeWindowSizeEnum getWindowSizeChallengeFromSession() { return ChallengeWindowSizeEnum.getEnum(sessionService.getAttribute(THREED_SECURE_WINDOW_KEY)); } DefaultWorldpaySessionService(final SessionService sessionService); @Override void setSessionAttributesFor3DSecure(final DirectAuthoriseServiceResponse authoriseServiceResponse, final WorldpayAdditionalInfoData worldpayAdditionalInfoData); @Override String getAndRemoveThreeDSecureCookie(); @Override String getAndRemoveAdditionalDataSessionId(); @Override ChallengeWindowSizeEnum getWindowSizeChallengeFromSession();  }
@Test public void getWindowSizeAttributeFromSession() { when(sessionServiceMock.getAttribute(THREED_SECURE_WINDOW_KEY)).thenReturn(THREED_SECURE_WINDOW_SIZE_VALUE); final ChallengeWindowSizeEnum result = testObj.getWindowSizeChallengeFromSession(); verify(sessionServiceMock).getAttribute(THREED_SECURE_WINDOW_KEY); assertThat(result).isEqualTo(ChallengeWindowSizeEnum.getEnum(THREED_SECURE_WINDOW_SIZE_VALUE)); }