Examples of SforceServiceLocator


Examples of com.sforce.soap.enterprise.SforceServiceLocator

            public boolean authenticate(String username, String password) {
                return false;
            }
        };

        AuthenticationProxy proxy = new AuthenticationProxy(badAuthenticator, null, new SforceServiceLocator());

        try {
            proxy.login("username", "password");
            fail();
        } catch (LoginFault expectedException) {
View Full Code Here

Examples of com.sforce.soap.enterprise.SforceServiceLocator

        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"));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.