Search in sources :

Example 16 with AnalyticsContextBuilder

use of com.amazonaws.mobileconnectors.pinpoint.analytics.utils.AnalyticsContextBuilder in project aws-sdk-android by aws-amplify.

the class AmazonMonetizationEventBuilderTest method setup.

@Before
public void setup() {
    MockitoAnnotations.initMocks(this);
    when(mockConfiguration.optString("versionKey", "ver")).thenReturn("ver");
    when(mockConfiguration.optBoolean("isAnalyticsEnabled", true)).thenReturn(true);
    PinpointContext mockContext = new AnalyticsContextBuilder().withConfiguration(mockConfiguration).withContext(RuntimeEnvironment.application.getApplicationContext()).build();
    target = new AnalyticsClient(mockContext);
    AnalyticsEvent testEvent = target.createEvent(MonetizationEventBuilder.PURCHASE_EVENT_NAME);
    when(mockEventClient.createEvent(MonetizationEventBuilder.PURCHASE_EVENT_NAME)).thenReturn(testEvent);
}
Also used : AnalyticsEvent(com.amazonaws.mobileconnectors.pinpoint.analytics.AnalyticsEvent) PinpointContext(com.amazonaws.mobileconnectors.pinpoint.internal.core.PinpointContext) AnalyticsClient(com.amazonaws.mobileconnectors.pinpoint.analytics.AnalyticsClient) AnalyticsContextBuilder(com.amazonaws.mobileconnectors.pinpoint.analytics.utils.AnalyticsContextBuilder) Before(org.junit.Before)

Example 17 with AnalyticsContextBuilder

use of com.amazonaws.mobileconnectors.pinpoint.analytics.utils.AnalyticsContextBuilder in project aws-sdk-android by aws-amplify.

the class CustomMonetizationEventBuilderTest method setup.

@Before
public void setup() {
    MockitoAnnotations.initMocks(this);
    when(mockConfiguration.optString("versionKey", "ver")).thenReturn("ver");
    when(mockConfiguration.optBoolean("isAnalyticsEnabled", true)).thenReturn(true);
    PinpointContext mockContext = new AnalyticsContextBuilder().withConfiguration(mockConfiguration).withContext(RuntimeEnvironment.application.getApplicationContext()).build();
    target = new AnalyticsClient(mockContext);
    AnalyticsEvent testEvent = target.createEvent(MonetizationEventBuilder.PURCHASE_EVENT_NAME);
    when(mockEventClient.createEvent(MonetizationEventBuilder.PURCHASE_EVENT_NAME)).thenReturn(testEvent);
}
Also used : AnalyticsEvent(com.amazonaws.mobileconnectors.pinpoint.analytics.AnalyticsEvent) PinpointContext(com.amazonaws.mobileconnectors.pinpoint.internal.core.PinpointContext) AnalyticsClient(com.amazonaws.mobileconnectors.pinpoint.analytics.AnalyticsClient) AnalyticsContextBuilder(com.amazonaws.mobileconnectors.pinpoint.analytics.utils.AnalyticsContextBuilder) Before(org.junit.Before)

Example 18 with AnalyticsContextBuilder

use of com.amazonaws.mobileconnectors.pinpoint.analytics.utils.AnalyticsContextBuilder in project aws-sdk-android by aws-amplify.

the class MonetizationEventBuilderTest method setup.

@Before
public void setup() {
    MockitoAnnotations.initMocks(this);
    when(mockConfiguration.optString("versionKey", "ver")).thenReturn("ver");
    when(mockConfiguration.optBoolean("isAnalyticsEnabled", true)).thenReturn(true);
    PinpointContext mockContext = new AnalyticsContextBuilder().withConfiguration(mockConfiguration).withContext(RuntimeEnvironment.application.getApplicationContext()).build();
    target = new AnalyticsClient(mockContext);
    AnalyticsEvent testEvent = target.createEvent(MonetizationEventBuilder.PURCHASE_EVENT_NAME);
    when(mockEventClient.createEvent(MonetizationEventBuilder.PURCHASE_EVENT_NAME)).thenReturn(testEvent);
}
Also used : AnalyticsEvent(com.amazonaws.mobileconnectors.pinpoint.analytics.AnalyticsEvent) PinpointContext(com.amazonaws.mobileconnectors.pinpoint.internal.core.PinpointContext) AnalyticsClient(com.amazonaws.mobileconnectors.pinpoint.analytics.AnalyticsClient) AnalyticsContextBuilder(com.amazonaws.mobileconnectors.pinpoint.analytics.utils.AnalyticsContextBuilder) Before(org.junit.Before)

Example 19 with AnalyticsContextBuilder

use of com.amazonaws.mobileconnectors.pinpoint.analytics.utils.AnalyticsContextBuilder in project aws-sdk-android by aws-amplify.

the class VirtualMonetizationEventBuilderTest method setup.

@Before
public void setup() {
    MockitoAnnotations.initMocks(this);
    when(mockConfiguration.optString("versionKey", "ver")).thenReturn("ver");
    when(mockConfiguration.optBoolean("isAnalyticsEnabled", true)).thenReturn(true);
    PinpointContext mockContext = new AnalyticsContextBuilder().withConfiguration(mockConfiguration).withContext(RuntimeEnvironment.application.getApplicationContext()).build();
    target = new AnalyticsClient(mockContext);
    AnalyticsEvent testEvent = target.createEvent(MonetizationEventBuilder.PURCHASE_EVENT_NAME);
    when(mockEventClient.createEvent(MonetizationEventBuilder.PURCHASE_EVENT_NAME)).thenReturn(testEvent);
}
Also used : AnalyticsEvent(com.amazonaws.mobileconnectors.pinpoint.analytics.AnalyticsEvent) PinpointContext(com.amazonaws.mobileconnectors.pinpoint.internal.core.PinpointContext) AnalyticsClient(com.amazonaws.mobileconnectors.pinpoint.analytics.AnalyticsClient) AnalyticsContextBuilder(com.amazonaws.mobileconnectors.pinpoint.analytics.utils.AnalyticsContextBuilder) Before(org.junit.Before)

Aggregations

AnalyticsContextBuilder (com.amazonaws.mobileconnectors.pinpoint.analytics.utils.AnalyticsContextBuilder)19 Before (org.junit.Before)16 PinpointContext (com.amazonaws.mobileconnectors.pinpoint.internal.core.PinpointContext)14 AnalyticsClient (com.amazonaws.mobileconnectors.pinpoint.analytics.AnalyticsClient)10 MockSystem (com.amazonaws.mobileconnectors.pinpoint.internal.core.system.MockSystem)6 Context (android.content.Context)5 AnalyticsEvent (com.amazonaws.mobileconnectors.pinpoint.analytics.AnalyticsEvent)5 MockDeviceDetails (com.amazonaws.mobileconnectors.pinpoint.internal.core.system.MockDeviceDetails)5 AndroidPreferencesConfiguration (com.amazonaws.mobileconnectors.pinpoint.internal.core.configuration.AndroidPreferencesConfiguration)2 EndpointProfile (com.amazonaws.mobileconnectors.pinpoint.targeting.endpointProfile.EndpointProfile)2 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 AndroidDeviceDetails (com.amazonaws.mobileconnectors.pinpoint.internal.core.system.AndroidDeviceDetails)1 TargetingClient (com.amazonaws.mobileconnectors.pinpoint.targeting.TargetingClient)1 Test (org.junit.Test)1