code:     public void resetPassword_InvalidCodeData() {
          ExpiringCode expiringCode = new ExpiringCode("good_code",
                  new Timestamp(System.currentTimeMillis() + UaaResetPasswordService.PASSWORD_RESET_LIFETIME), "user-id", null);
          when(codeStore.retrieveCode("good_code")).thenReturn(expiringCode);
          SecurityContext securityContext = mock(SecurityContext.class);
          when(securityContext.getAuthentication()).thenReturn(new MockAuthentication());
          SecurityContextHolder.setContext(securityContext);
          try {
              emailResetPasswordService.resetPassword("good_code", "password");
              fail();
          } catch (InvalidCodeException e) {
              assertEquals("Sorry, your reset password link is no longer valid. Please request a new one", e.getMessage());
          }
      }
  
      @Test
  