DefaultWorldpayAuthorisationResultService implements WorldpayAuthorisationResultService { @Override public void setAuthorizeResultForAPM(final DirectAuthoriseServiceResponse response, final WorldpaySubscriptionAuthorizeResult result) { setSubscriptionAuthoriseResult(result, REJECTED, REVIEW_NEEDED); final RedirectReference redirectReference = response.getRedirectReference(); result.setPaymentRedirectRequired(true); result.setPaymentRedirectUrl(redirectReference.getValue()); }  @Override void setAuthoriseResultAsError(final AbstractResult target); @Override void setAuthoriseResultByTransactionStatus(final AbstractResult target, final AuthorisedStatus status, final String orderCode); @Override void setAuthorizeResultForAPM(final DirectAuthoriseServiceResponse response,
                                         final WorldpaySubscriptionAuthorizeResult result);  }
@Test public void testSetAuthorizeResultForAPM() { when(directAuthoriseServiceResponseMock.getRedirectReference()).thenReturn(redirectReferenceMock); when(redirectReferenceMock.getValue()).thenReturn(REDIRECT_REFERENCE); testObj.setAuthorizeResultForAPM(directAuthoriseServiceResponseMock, worldpaySubscriptionAuthorizeResultMock); verify(worldpaySubscriptionAuthorizeResultMock).setTransactionStatus(TransactionStatus.REJECTED); verify(worldpaySubscriptionAuthorizeResultMock).setTransactionStatusDetails(REVIEW_NEEDED); verify(worldpaySubscriptionAuthorizeResultMock).setPaymentRedirectRequired(true); verify(worldpaySubscriptionAuthorizeResultMock).setPaymentRedirectUrl(REDIRECT_REFERENCE); }