use of com.microsoft.appcenter.push.ingestion.models.PushInstallationLog in project mobile-center-sdk-android by Microsoft.
the class PushSerializerTest method serialize.
@Test
public void serialize() throws JSONException {
LogContainer expectedContainer = new LogContainer();
List<Log> logs = new ArrayList<>();
{
PushInstallationLog log = new PushInstallationLog();
log.setTimestamp(new Date());
log.setPushToken("TEST");
logs.add(log);
}
expectedContainer.setLogs(logs);
UUID sid = UUIDUtils.randomUUID();
for (Log log : logs) {
log.setSid(sid);
}
LogSerializer serializer = new DefaultLogSerializer();
serializer.addLogFactory(PushInstallationLog.TYPE, new PushInstallationLogFactory());
String payload = serializer.serializeContainer(expectedContainer);
LogContainer actualContainer = serializer.deserializeContainer(payload);
Assert.assertEquals(expectedContainer, actualContainer);
}
use of com.microsoft.appcenter.push.ingestion.models.PushInstallationLog in project mobile-center-sdk-android by Microsoft.
the class Push method enqueuePushInstallationLog.
/**
* Enqueue a push installation log.
*
* @param pushToken the push token value
*/
private void enqueuePushInstallationLog(@NonNull String pushToken) {
PushInstallationLog log = new PushInstallationLog();
log.setPushToken(pushToken);
mChannel.enqueue(log, PUSH_GROUP);
}
Aggregations