@Test public void testLocked() { when(mockRpcTemplate.execute(any(ConnectionCallback.class), eq("vrpcb: try { s.login(MOCK_VISTA_ID, MOCK_DIVISION, MOCK_ACCESS_CODE, MOCK_VERIFY_CODE, null, null, MOCK_REMOTE_ADDRESS, MOCK_REMOTE_HOSTNAME); fail("expected a Spring Security BadCredentialsException"); } catch (org.springframework.security.authentication.LockedException e) { } verify(mockRpcTemplate).execute(any(ConnectionCallback.class), eq("vrpcb: }
public final VistaUserDetails login(final String vistaId, final String division, final String accessCode, final String verifyCode, String newVerifyCode, String confirmNewVerifyCode, final String remoteAddress, String remoteHostName) throws BadCredentialsException, DataAccessException { if (!hasLength(vistaId)) throw new BadCredentialsException("missing vistaId"); if (!hasLength(division)) throw new BadCredentialsException("missing division"); if (!hasLength(accessCode)) throw new BadCredentialsException("missing access code"); if (!hasLength(verifyCode)) throw new BadCredentialsException("missing verify code"); if (!hasLength(remoteAddress)) throw new BadCredentialsException("missing remote address"); if (!hasLength(remoteHostName)) throw new BadCredentialsException("missing remote hostname"); try { ConnectionInfo info = getRpcTemplate().execute(new ConnectionInfoCallback(), RpcUriUtils.VISTA_RPC_BROKER_SCHEME + ": if (info != null) { return createVistaUserDetails(info.getHost(), vistaId, division, info.getUserDetails()); } } catch (PermissionDeniedDataAccessException e) { translateException(e); } return null; }
RpcTemplateUserDetailService implements VistaUserDetailsService { public final VistaUserDetails login(final String vistaId, final String division, final String accessCode, final String verifyCode, String newVerifyCode, String confirmNewVerifyCode, final String remoteAddress, String remoteHostName) throws BadCredentialsException, DataAccessException { if (!hasLength(vistaId)) throw new BadCredentialsException("missing vistaId"); if (!hasLength(division)) throw new BadCredentialsException("missing division"); if (!hasLength(accessCode)) throw new BadCredentialsException("missing access code"); if (!hasLength(verifyCode)) throw new BadCredentialsException("missing verify code"); if (!hasLength(remoteAddress)) throw new BadCredentialsException("missing remote address"); if (!hasLength(remoteHostName)) throw new BadCredentialsException("missing remote hostname"); try { ConnectionInfo info = getRpcTemplate().execute(new ConnectionInfoCallback(), RpcUriUtils.VISTA_RPC_BROKER_SCHEME + ": if (info != null) { return createVistaUserDetails(info.getHost(), vistaId, division, info.getUserDetails()); } } catch (PermissionDeniedDataAccessException e) { translateException(e); } return null; } }
RpcTemplateUserDetailService implements VistaUserDetailsService { public final VistaUserDetails login(final String vistaId, final String division, final String accessCode, final String verifyCode, String newVerifyCode, String confirmNewVerifyCode, final String remoteAddress, String remoteHostName) throws BadCredentialsException, DataAccessException { if (!hasLength(vistaId)) throw new BadCredentialsException("missing vistaId"); if (!hasLength(division)) throw new BadCredentialsException("missing division"); if (!hasLength(accessCode)) throw new BadCredentialsException("missing access code"); if (!hasLength(verifyCode)) throw new BadCredentialsException("missing verify code"); if (!hasLength(remoteAddress)) throw new BadCredentialsException("missing remote address"); if (!hasLength(remoteHostName)) throw new BadCredentialsException("missing remote hostname"); try { ConnectionInfo info = getRpcTemplate().execute(new ConnectionInfoCallback(), RpcUriUtils.VISTA_RPC_BROKER_SCHEME + ": if (info != null) { return createVistaUserDetails(info.getHost(), vistaId, division, info.getUserDetails()); } } catch (PermissionDeniedDataAccessException e) { translateException(e); } return null; }  }
RpcTemplateUserDetailService implements VistaUserDetailsService { public final VistaUserDetails login(final String vistaId, final String division, final String accessCode, final String verifyCode, String newVerifyCode, String confirmNewVerifyCode, final String remoteAddress, String remoteHostName) throws BadCredentialsException, DataAccessException { if (!hasLength(vistaId)) throw new BadCredentialsException("missing vistaId"); if (!hasLength(division)) throw new BadCredentialsException("missing division"); if (!hasLength(accessCode)) throw new BadCredentialsException("missing access code"); if (!hasLength(verifyCode)) throw new BadCredentialsException("missing verify code"); if (!hasLength(remoteAddress)) throw new BadCredentialsException("missing remote address"); if (!hasLength(remoteHostName)) throw new BadCredentialsException("missing remote hostname"); try { ConnectionInfo info = getRpcTemplate().execute(new ConnectionInfoCallback(), RpcUriUtils.VISTA_RPC_BROKER_SCHEME + ": if (info != null) { return createVistaUserDetails(info.getHost(), vistaId, division, info.getUserDetails()); } } catch (PermissionDeniedDataAccessException e) { translateException(e); } return null; }  RpcOperations getRpcTemplate(); @Required void setRpcTemplate(RpcOperations rpcTemplate); final VistaUserDetails login(final String vistaId, final String division, final String accessCode, final String verifyCode, String newVerifyCode, String confirmNewVerifyCode, final String remoteAddress, String remoteHostName); @Override VistaUserDetails login(String vistaId, String division, String appHandle, String remoteAddress, String remoteHostName); void logout(VistaUserDetails user); }
RpcTemplateUserDetailService implements VistaUserDetailsService { public final VistaUserDetails login(final String vistaId, final String division, final String accessCode, final String verifyCode, String newVerifyCode, String confirmNewVerifyCode, final String remoteAddress, String remoteHostName) throws BadCredentialsException, DataAccessException { if (!hasLength(vistaId)) throw new BadCredentialsException("missing vistaId"); if (!hasLength(division)) throw new BadCredentialsException("missing division"); if (!hasLength(accessCode)) throw new BadCredentialsException("missing access code"); if (!hasLength(verifyCode)) throw new BadCredentialsException("missing verify code"); if (!hasLength(remoteAddress)) throw new BadCredentialsException("missing remote address"); if (!hasLength(remoteHostName)) throw new BadCredentialsException("missing remote hostname"); try { ConnectionInfo info = getRpcTemplate().execute(new ConnectionInfoCallback(), RpcUriUtils.VISTA_RPC_BROKER_SCHEME + ": if (info != null) { return createVistaUserDetails(info.getHost(), vistaId, division, info.getUserDetails()); } } catch (PermissionDeniedDataAccessException e) { translateException(e); } return null; }  RpcOperations getRpcTemplate(); @Required void setRpcTemplate(RpcOperations rpcTemplate); final VistaUserDetails login(final String vistaId, final String division, final String accessCode, final String verifyCode, String newVerifyCode, String confirmNewVerifyCode, final String remoteAddress, String remoteHostName); @Override VistaUserDetails login(String vistaId, String division, String appHandle, String remoteAddress, String remoteHostName); void logout(VistaUserDetails user);  }