public void testRetrieveUserDataNoUsername() throws ConnectionException {
UserDataRetriever dataRetriever = new ForceUserDataRetriever();
dataRetriever.setStoreUsername(false);
dataRetriever.setSessionId(VALID_SFDC_SID);
dataRetriever.setEndpoint(VALID_SFDC_ENDPOINT);
SecurityContext sc = dataRetriever.retrieveUserData();
Assert.assertNull(sc.getUserName(), "username should be null when storeUsername is set to false");
Assert.assertEquals(sc.getUserId(), partnerSc.getUserId(),
"Security context should match that which the partner connection returned");
Assert.assertEquals(sc.getSessionId(), partnerSc.getSessionId(),
"Security context should match that which the partner connection returned");
Assert.assertEquals(sc.getEndPoint(), partnerSc.getEndPoint(),
"Security context should match that which the partner connection returned");
}