Search in sources :

Example 6 with AbstractUploaderDevice

use of com.nightscout.core.drivers.AbstractUploaderDevice in project android-uploader by nightscout.

the class RestV1UploaderTest method testDeviceStatus_Entity.

@Test
public void testDeviceStatus_Entity() throws Exception {
    AbstractUploaderDevice deviceStatus = mockDeviceStatus();
    restUploader.uploadDeviceStatus(deviceStatus);
    HttpPost post = (HttpPost) captor.getValue();
    String entity = CharStreams.toString(new InputStreamReader(post.getEntity().getContent()));
    verifyDeviceStatus(new JSONObject(entity), deviceStatus);
}
Also used : HttpPost(org.apache.http.client.methods.HttpPost) InputStreamReader(java.io.InputStreamReader) JSONObject(org.json.JSONObject) AbstractUploaderDevice(com.nightscout.core.drivers.AbstractUploaderDevice) Matchers.containsString(org.hamcrest.Matchers.containsString) Test(org.junit.Test)

Aggregations

AbstractUploaderDevice (com.nightscout.core.drivers.AbstractUploaderDevice)6 Test (org.junit.Test)4 InputStreamReader (java.io.InputStreamReader)2 HttpPost (org.apache.http.client.methods.HttpPost)2 Matchers.containsString (org.hamcrest.Matchers.containsString)2 JSONObject (org.json.JSONObject)2 PowerManager (android.os.PowerManager)1 HitBuilders (com.google.android.gms.analytics.HitBuilders)1 Tracker (com.google.android.gms.analytics.Tracker)1 MongoClientURI (com.mongodb.MongoClientURI)1 CdcAcmSerialDriver (com.nightscout.android.drivers.USB.CdcAcmSerialDriver)1 AndroidPreferences (com.nightscout.android.preferences.AndroidPreferences)1 Uploader (com.nightscout.android.upload.Uploader)1 CRCFailError (com.nightscout.core.dexcom.CRCFailError)1 EGVRecord (com.nightscout.core.dexcom.records.EGVRecord)1 AbstractDevice (com.nightscout.core.drivers.AbstractDevice)1 DexcomG4 (com.nightscout.core.drivers.DexcomG4)1 DownloadResults (com.nightscout.core.model.DownloadResults)1 G4Download (com.nightscout.core.model.G4Download)1 BaseUploader (com.nightscout.core.upload.BaseUploader)1