Search in sources :

Example 1 with MockDeviceDetails

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

the class EndpointProfileTest method setup.

@Before
public void setup() {
    testDeviceDetails = new MockDeviceDetails();
    mockContext = new AnalyticsContextBuilder().withSdkInfo(SDK_NAME, SDK_VERSION).withUniqueIdValue(UNIQUE_ID).withDeviceDetails(testDeviceDetails).withContext(RuntimeEnvironment.application.getApplicationContext()).build();
    target = new EndpointProfile(mockContext);
}
Also used : MockDeviceDetails(com.amazonaws.mobileconnectors.pinpoint.internal.core.system.MockDeviceDetails) EndpointProfile(com.amazonaws.mobileconnectors.pinpoint.targeting.endpointProfile.EndpointProfile) AnalyticsContextBuilder(com.amazonaws.mobileconnectors.pinpoint.analytics.utils.AnalyticsContextBuilder) Before(org.junit.Before)

Example 2 with MockDeviceDetails

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

the class TargetingClientTest method setup.

@Before
public void setup() {
    MockitoAnnotations.initMocks(this);
    testDeviceDetails = new MockDeviceDetails();
    mockContext = new AnalyticsContextBuilder().withSdkInfo(SDK_NAME, SDK_VERSION).withUniqueIdValue(UNIQUE_ID).withDeviceDetails(testDeviceDetails).withPinpointServiceClient(mockPinpointServiceClient).withContext(RuntimeEnvironment.application.getApplicationContext()).build();
    targetingClient = new TargetingClient(mockContext, mockPinpointExecutor);
}
Also used : MockDeviceDetails(com.amazonaws.mobileconnectors.pinpoint.internal.core.system.MockDeviceDetails) AnalyticsContextBuilder(com.amazonaws.mobileconnectors.pinpoint.analytics.utils.AnalyticsContextBuilder) Before(org.junit.Before)

Example 3 with MockDeviceDetails

use of com.amazonaws.mobileconnectors.pinpoint.internal.core.system.MockDeviceDetails 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());
}
Also used : PinpointContext(com.amazonaws.mobileconnectors.pinpoint.internal.core.PinpointContext) MockDeviceDetails(com.amazonaws.mobileconnectors.pinpoint.internal.core.system.MockDeviceDetails) AnalyticsContextBuilder(com.amazonaws.mobileconnectors.pinpoint.analytics.utils.AnalyticsContextBuilder) Before(org.junit.Before)

Example 4 with MockDeviceDetails

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

the class EventRecorderTest method setup.

@Before
public void setup() {
    MockitoAnnotations.initMocks(this);
    testDeviceDetails = new MockDeviceDetails();
    mockContext = new AnalyticsContextBuilder().withSdkInfo(SDK_NAME, SDK_VERSION).withUniqueIdValue(UNIQUE_ID).withDeviceDetails(testDeviceDetails).withContext(RuntimeEnvironment.application.getApplicationContext()).build();
    analyticsEvent = AnalyticsEvent.newInstance(mockContext, SESSION_ID, SESSION_START, SESSION_END, SESSION_DURATION, TIME_STAMP, EVENT_NAME);
    analyticsEvent.addAttribute("key1", "value1");
    analyticsEvent.addAttribute("key2", "value2");
    endpointProfile = new EndpointProfile(mockContext);
    dbUtil = new PinpointDBUtil(RuntimeEnvironment.application.getApplicationContext());
    eventRecorder = new EventRecorder(mockContext, dbUtil, submissionRunnable);
}
Also used : MockDeviceDetails(com.amazonaws.mobileconnectors.pinpoint.internal.core.system.MockDeviceDetails) EndpointProfile(com.amazonaws.mobileconnectors.pinpoint.targeting.endpointProfile.EndpointProfile) AnalyticsContextBuilder(com.amazonaws.mobileconnectors.pinpoint.analytics.utils.AnalyticsContextBuilder) Before(org.junit.Before)

Example 5 with MockDeviceDetails

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

the class PinpointDBUtilTest method setup.

@Before
public void setup() {
    testDeviceDetails = new MockDeviceDetails();
    mockContext = new AnalyticsContextBuilder().withSdkInfo(SDK_NAME, SDK_VERSION).withUniqueIdValue(UNIQUE_ID).withDeviceDetails(testDeviceDetails).withContext(RuntimeEnvironment.application.getApplicationContext()).build();
    dbUtil = new PinpointDBUtil(RuntimeEnvironment.application.getApplicationContext());
}
Also used : MockDeviceDetails(com.amazonaws.mobileconnectors.pinpoint.internal.core.system.MockDeviceDetails) AnalyticsContextBuilder(com.amazonaws.mobileconnectors.pinpoint.analytics.utils.AnalyticsContextBuilder) Before(org.junit.Before)

Aggregations

AnalyticsContextBuilder (com.amazonaws.mobileconnectors.pinpoint.analytics.utils.AnalyticsContextBuilder)5 MockDeviceDetails (com.amazonaws.mobileconnectors.pinpoint.internal.core.system.MockDeviceDetails)5 Before (org.junit.Before)5 EndpointProfile (com.amazonaws.mobileconnectors.pinpoint.targeting.endpointProfile.EndpointProfile)2 PinpointContext (com.amazonaws.mobileconnectors.pinpoint.internal.core.PinpointContext)1