Search in sources :

Example 6 with MockSystem

use of com.amazonaws.mobileconnectors.pinpoint.internal.core.system.MockSystem in project aws-sdk-android by aws-amplify.

the class BaiduNotificationClientTest method setup.

@Before
public void setup() {
    MockitoAnnotations.initMocks(this);
    final Context roboContext = RuntimeEnvironment.application.getApplicationContext();
    spiedRoboContext = Mockito.spy(roboContext);
    mockPinpointContext = new AnalyticsContextBuilder().withSystem(new MockSystem("JIMMY_CRACKED_CORN.and")).withConfiguration(mockConfiguration).withContext(spiedRoboContext).build();
    analyticsClient = new AnalyticsClient(mockPinpointContext);
    Whitebox.setInternalState(analyticsClient, "eventRecorder", mockEventRecorder);
    when(mockConfiguration.optBoolean("isAnalyticsEnabled", true)).thenReturn(true);
    when(mockPinpointContext.getAnalyticsClient()).thenReturn(analyticsClient);
    // target.setSessionClient(new SessionClient(mockContext, mockEventClient, mockTargetingClient,
    // new TestSessionStore(), false));
    when(mockPinpointContext.getTargetingClient()).thenReturn(mockTargetingClient);
    when(mockPinpointContext.getConfiguration()).thenReturn(mockConfiguration);
    when(mockPinpointContext.getPinpointConfiguration()).thenReturn(mockPinpointConfiguration);
    target = NotificationClient.createClient(mockPinpointContext, ChannelType.BAIDU);
}
Also used : Context(android.content.Context) PinpointContext(com.amazonaws.mobileconnectors.pinpoint.internal.core.PinpointContext) AnalyticsClient(com.amazonaws.mobileconnectors.pinpoint.analytics.AnalyticsClient) AnalyticsContextBuilder(com.amazonaws.mobileconnectors.pinpoint.analytics.utils.AnalyticsContextBuilder) MockSystem(com.amazonaws.mobileconnectors.pinpoint.internal.core.system.MockSystem) Before(org.junit.Before)

Aggregations

AnalyticsContextBuilder (com.amazonaws.mobileconnectors.pinpoint.analytics.utils.AnalyticsContextBuilder)6 MockSystem (com.amazonaws.mobileconnectors.pinpoint.internal.core.system.MockSystem)6 Context (android.content.Context)5 AnalyticsClient (com.amazonaws.mobileconnectors.pinpoint.analytics.AnalyticsClient)5 PinpointContext (com.amazonaws.mobileconnectors.pinpoint.internal.core.PinpointContext)5 Before (org.junit.Before)5 Activity (android.app.Activity)1 AWSCredentials (com.amazonaws.auth.AWSCredentials)1 AWSCredentialsProvider (com.amazonaws.auth.AWSCredentialsProvider)1 AnonymousAWSCredentials (com.amazonaws.auth.AnonymousAWSCredentials)1 SessionClient (com.amazonaws.mobileconnectors.pinpoint.analytics.SessionClient)1 ContextWithPermissions (com.amazonaws.mobileconnectors.pinpoint.analytics.utils.ContextWithPermissions)1 AndroidPreferencesConfiguration (com.amazonaws.mobileconnectors.pinpoint.internal.core.configuration.AndroidPreferencesConfiguration)1 TargetingClient (com.amazonaws.mobileconnectors.pinpoint.targeting.TargetingClient)1