TestSetupUtils Class Reference

Inherits from NSObject
Declared in TestSetupUtils.h

Overview

This class provides utilities useful to all unit tests based on the Salesforce SDK

+ populateUILoginInfoFromConfigFileForClass:

Loads a set of auth credentials from the ‘ui_test_credentials.json’ file located in the bundle associated with the given class, and return a dictionary of login info

+ (NSArray *)populateUILoginInfoFromConfigFileForClass:(Class)testClass

Parameters

testClass

The class associated with the bundle where the test credentials file lives.

Return Value

a dictionary of login username, password, url

Declared In

TestSetupUtils.h

+ populateAuthCredentialsFromConfigFileForClass:

Loads a set of auth credentials from the ‘test_credentials.json’ file located in the bundle associated with the given class, and configures SFUserAccountManager and the current account with the data from that file.

+ (SFSDKTestCredentialsData *)populateAuthCredentialsFromConfigFileForClass:(Class)testClass

Parameters

testClass

The class associated with the bundle where the test credentials file lives.

Return Value

The configuration data used to configure SFUserAccountManager (useful e.g. for hybrid apps which need the data to bootstrap SFHybridViewController).

Declared In

TestSetupUtils.h

+ synchronousAuthRefresh

Performs a synchronous refresh of the OAuth credentials, which will stage the remaining auth data (access token, User ID, Org ID, etc.) in SFUserAccountManager. populateAuthCredentialsFromConfigFile is required to run once before this method will attempt to refresh authentication.

+ (void)synchronousAuthRefresh

Declared In

TestSetupUtils.h

+ newClientCredentials

+ (SFOAuthCredentials *)newClientCredentials