use of com.amazonaws.mobileconnectors.pinpoint.internal.core.PinpointContext in project aws-sdk-android by aws-amplify.
the class AnalyticsClientTest 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().withSdkInfo(SDK_NAME, SDK_VERSION).withUniqueIdValue(UNIQUE_ID).withConfiguration(mockConfiguration).withContext(RuntimeEnvironment.application.getApplicationContext()).build();
eventRecorder = EventRecorder.newInstance(mockContext, dbUtil);
target = new AnalyticsClient(mockContext);
target.setEventRecorder(eventRecorder);
}
use of com.amazonaws.mobileconnectors.pinpoint.internal.core.PinpointContext in project aws-sdk-android by aws-amplify.
the class AnalyticsEventTest method setup.
@Before
public void setup() {
testDeviceDetails = new MockDeviceDetails();
PinpointContext mockContext = new AnalyticsContextBuilder().withSdkInfo(SDK_NAME, SDK_VERSION).withUniqueIdValue(UNIQUE_ID).withDeviceDetails(testDeviceDetails).withContext(RuntimeEnvironment.application.getApplicationContext()).build();
target = AnalyticsEvent.newInstance(mockContext, SESSION_ID, SESSION_START, SESSION_END, SESSION_DURATION, TIME_STAMP, EVENT_NAME);
assertEquals(EVENT_NAME, target.getEventType());
assertEquals(UNIQUE_ID, target.getUniqueId());
assertEquals(TIME_STAMP, target.getEventTimestamp());
assertEquals(SDK_NAME, target.getSdkName());
assertEquals(SDK_VERSION, target.getSdkVersion());
assertEquals(0, target.getAllAttributes().size());
assertEquals(0, target.getAllMetrics().size());
}
use of com.amazonaws.mobileconnectors.pinpoint.internal.core.PinpointContext 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);
}
use of com.amazonaws.mobileconnectors.pinpoint.internal.core.PinpointContext 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);
}
use of com.amazonaws.mobileconnectors.pinpoint.internal.core.PinpointContext 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);
}
Aggregations