Search in sources :

Example 6 with TestPreferences

use of com.nightscout.core.preferences.TestPreferences in project android-uploader by nightscout.

the class BaseUploaderTest method setUp.

@Before
public void setUp() throws Exception {
    preferences = new TestPreferences();
    mockUploader = new MockUploader(preferences);
    exceptionUploader = new ExceptionThrowingUploader(preferences);
}
Also used : TestPreferences(com.nightscout.core.preferences.TestPreferences) Before(org.junit.Before)

Example 7 with TestPreferences

use of com.nightscout.core.preferences.TestPreferences in project android-uploader by nightscout.

the class MongoUploaderTest method setUp.

@Before
public void setUp() throws Exception {
    mockCollection = mock(DBCollection.class);
    preferences = new TestPreferences();
    mongoUploader = new MongoUploader(preferences, new MongoClientURI("mongodb://localhost"), "collection", "dsCollection");
    mongoUploader.setCollection(mockCollection);
    mongoUploader.setDeviceStatusCollection(mockCollection);
    setUpUpsertCapture();
}
Also used : DBCollection(com.mongodb.DBCollection) MongoClientURI(com.mongodb.MongoClientURI) TestPreferences(com.nightscout.core.preferences.TestPreferences) Before(org.junit.Before)

Example 8 with TestPreferences

use of com.nightscout.core.preferences.TestPreferences in project android-uploader by nightscout.

the class RestLegacyUploaderTest method setUp.

@Before
public void setUp() throws Exception {
    preferences = new TestPreferences();
    restUploader = new RestLegacyUploader(preferences, URI.create("http://test.com/"));
    mockHttpClient = mock(HttpClient.class);
    restUploader.setClient(mockHttpClient);
    setUpExecuteCaptor();
}
Also used : HttpClient(org.apache.http.client.HttpClient) TestPreferences(com.nightscout.core.preferences.TestPreferences) Before(org.junit.Before)

Example 9 with TestPreferences

use of com.nightscout.core.preferences.TestPreferences in project android-uploader by nightscout.

the class RestV1UploaderTest method setUp.

@Before
public void setUp() throws Exception {
    preferences = new TestPreferences();
    restUploader = new RestV1Uploader(preferences, URI.create("http://testingtesting@test.com/v1"));
    mockHttpClient = Mockito.mock(HttpClient.class);
    restUploader.setClient(mockHttpClient);
    setUpExecuteCaptor();
}
Also used : HttpClient(org.apache.http.client.HttpClient) TestPreferences(com.nightscout.core.preferences.TestPreferences) Before(org.junit.Before)

Aggregations

TestPreferences (com.nightscout.core.preferences.TestPreferences)9 Before (org.junit.Before)5 Test (org.junit.Test)4 Intent (android.content.Intent)3 HttpClient (org.apache.http.client.HttpClient)3 DBCollection (com.mongodb.DBCollection)1 MongoClientURI (com.mongodb.MongoClientURI)1 URI (java.net.URI)1 HttpUriRequest (org.apache.http.client.methods.HttpUriRequest)1