Search in sources :

Example 11 with PinpointContext

use of com.amazonaws.mobileconnectors.pinpoint.internal.core.PinpointContext 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

PinpointContext (com.amazonaws.mobileconnectors.pinpoint.internal.core.PinpointContext)11 AnalyticsContextBuilder (com.amazonaws.mobileconnectors.pinpoint.analytics.utils.AnalyticsContextBuilder)9 Before (org.junit.Before)7 AnalyticsClient (com.amazonaws.mobileconnectors.pinpoint.analytics.AnalyticsClient)5 AnalyticsEvent (com.amazonaws.mobileconnectors.pinpoint.analytics.AnalyticsEvent)5 AndroidPreferencesConfiguration (com.amazonaws.mobileconnectors.pinpoint.internal.core.configuration.AndroidPreferencesConfiguration)2 Test (org.junit.Test)2 Cursor (android.database.Cursor)1 AndroidAppDetails (com.amazonaws.mobileconnectors.pinpoint.internal.core.system.AndroidAppDetails)1 AndroidDeviceDetails (com.amazonaws.mobileconnectors.pinpoint.internal.core.system.AndroidDeviceDetails)1 MockAppDetails (com.amazonaws.mobileconnectors.pinpoint.internal.core.system.MockAppDetails)1 MockDeviceDetails (com.amazonaws.mobileconnectors.pinpoint.internal.core.system.MockDeviceDetails)1 SDKInfo (com.amazonaws.mobileconnectors.pinpoint.internal.core.util.SDKInfo)1 NotificationClient (com.amazonaws.mobileconnectors.pinpoint.targeting.notification.NotificationClient)1 ExecutorService (java.util.concurrent.ExecutorService)1 JSONArray (org.json.JSONArray)1 MockUtil (org.mockito.internal.util.MockUtil)1