DefaultWorldpayTokenEventReferenceCreationStrategy implements WorldpayTokenEventReferenceCreationStrategy { @Override public String createTokenEventReference() { final String cartCode = cartService.getSessionCart().getCode(); return cartCode + UNDERSCORE + Instant.now().toEpochMilli(); }  @Override String createTokenEventReference(); @Required void setCartService(CartService cartService); static final String UNDERSCORE; }
@Test public void shouldCreateATokenReferenceUsingCartCode() { when(cartServiceMock.getSessionCart()).thenReturn(cartModelMock); when(cartModelMock.getCode()).thenReturn(CART_CODE); final String result = testObj.createTokenEventReference(); assertTrue(result.startsWith(CART_CODE + "_")); }