use of com.amazonaws.mobileconnectors.pinpoint.analytics.utils.AnalyticsContextBuilder in project aws-sdk-android by aws-amplify.
the class FCMNotificationClientTest 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.GCM);
}
use of com.amazonaws.mobileconnectors.pinpoint.analytics.utils.AnalyticsContextBuilder in project aws-sdk-android by aws-amplify.
the class GCMNotificationClientTest method setup.
@Before
public void setup() {
MockitoAnnotations.initMocks(this);
Context roboContext = ApplicationProvider.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.GCM);
}
use of com.amazonaws.mobileconnectors.pinpoint.analytics.utils.AnalyticsContextBuilder in project aws-sdk-android by aws-amplify.
the class SessionClientTest method setup.
@Before
public void setup() {
MockitoAnnotations.initMocks(this);
this.mockPinpointContext = new AnalyticsContextBuilder().withSdkInfo(SDK_NAME, SDK_VERSION).withUniqueIdValue(UNIQUE_ID).withConfiguration(mockConfiguration).withContext(RuntimeEnvironment.application.getApplicationContext()).withSystem(new MockSystem("SESSION_CLIENT.test")).build();
when(mockPinpointContext.getAnalyticsClient()).thenReturn(mockAnalyticsClient);
when(mockPinpointContext.getTargetingClient()).thenReturn(mockTargetingClient);
when(mockPinpointContext.getConfiguration()).thenReturn(mockConfiguration);
when(mockPinpointContext.getPinpointConfiguration()).thenReturn(mockPinpointConfiguration);
target = new SessionClient(mockPinpointContext);
System.out.print(target.toString());
}
use of com.amazonaws.mobileconnectors.pinpoint.analytics.utils.AnalyticsContextBuilder in project aws-sdk-android by aws-amplify.
the class GooglePlayMonetizationEventBuilderTest 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.analytics.utils.AnalyticsContextBuilder 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);
}
Aggregations