DefaultWorldpayDirectResponseService implements WorldpayDirectResponseService { @Override public Boolean isCancelled(final DirectResponseData directResponseData) { return CANCELLED == directResponseData.getTransactionStatus(); }  @Override Boolean isAuthorised(final DirectResponseData directResponseData); @Override Boolean isCancelled(final DirectResponseData directResponseData); @Override Boolean is3DSecureLegacyFlow(final DirectResponseData directResponseData); @Override Boolean is3DSecureFlexFlow(final DirectResponseData directResponseData);  }
@Test public void isCancelledReturnsTrueWhenDirectResponseDataStatusIsCancelled() { when(directResponseDataMock.getTransactionStatus()).thenReturn(TransactionStatus.CANCELLED); final Boolean result = testObj.isCancelled(directResponseDataMock); assertThat(result).isTrue(); }