final SoapBindingStub soapBindingStub = mock(SoapBindingStub.class);
final LoginResult loginResult = new LoginResult();
loginResult.setSessionId("something unique");
when(soapBindingStub.login(anyString(), anyString())).thenReturn(loginResult);
final SforceServiceLocator sforceServiceLocator = spy(new SforceServiceLocator());
when(sforceServiceLocator.getSoap()).thenReturn(soapBindingStub);
AuthenticationProxy proxy = new AuthenticationProxy(authenticator, messageContextProvider, sforceServiceLocator);
assertEquals(loginResult, proxy.login("username", "password"));
}