DefaultPasswordFilterManager implements PasswordFilterManager { @Override public void createEcho(UUID accountId, GuardedString password) { AccPasswordFilterEchoItemDto echo = new AccPasswordFilterEchoItemDto(hashPassword(password), accountId); ZonedDateTime now = ZonedDateTime.now(); echo.setValidityChecked(true); echo.setChanged(true); echo.setChangeDate(now); echo.setValidateDate(now); LOG.info("For account [{}] will be created new standard echo with validity and changed record.", accountId); idmCacheManager.cacheValue(ECHO_CACHE_NAME, accountId, echo); }  @Override void validate(AccPasswordFilterRequestDto request); @Override void change(AccPasswordFilterRequestDto request); @Override void setEchoForChange(UUID accountId, GuardedString password); @Override void clearChangedEcho(UUID accountId); @Override void createEchoForValidation(UUID accountId, GuardedString password, boolean success); @Override void createEcho(UUID accountId, GuardedString password); @Override AccPasswordFilterEchoItemDto getEcho(UUID accountId);  }
@Test @Ignore public void stressTestPasswordEndcoding() { long sum = 0; int iteration = 100; for (int index = 0; index < iteration+1; index++) { long before = System.currentTimeMillis(); passwordFilterManager.createEcho(UUID.randomUUID(), new GuardedString(getHelper().createName())); long after = System.currentTimeMillis(); long diff = after - before; sum += diff; } System.out.println(MessageFormat.format("[{0}] iteration takes [{1}]. Average for one iteration [{2}].", iteration, sum, sum/iteration)); }