mirror of
https://github.com/etesync/android
synced 2024-11-22 07:58:09 +00:00
Fix tests.
This commit is contained in:
parent
a4a129d989
commit
496b6cd633
@ -89,6 +89,10 @@ android {
|
|||||||
exclude 'META-INF/NOTICE.txt'
|
exclude 'META-INF/NOTICE.txt'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
testOptions {
|
||||||
|
unitTests.returnDefaultValues = true
|
||||||
|
}
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
|
@ -115,7 +115,7 @@ class HttpClient private constructor(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor(context: Context, host: String?, authToken: String): this(context) {
|
constructor(context: Context?, host: String?, authToken: String): this(context) {
|
||||||
addAuthentication(host, authToken)
|
addAuthentication(host, authToken)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ class AuthenticatorTest {
|
|||||||
@Before
|
@Before
|
||||||
@Throws(IOException::class)
|
@Throws(IOException::class)
|
||||||
fun setUp() {
|
fun setUp() {
|
||||||
httpClient = HttpClient.create(null)
|
httpClient = HttpClient.Builder().build().okHttpClient
|
||||||
remote = HttpUrl.parse("http://localhost:8000") // FIXME: hardcode for now, should make configureable
|
remote = HttpUrl.parse("http://localhost:8000") // FIXME: hardcode for now, should make configureable
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -28,12 +28,12 @@ class ServiceTest {
|
|||||||
@Before
|
@Before
|
||||||
@Throws(Exception::class)
|
@Throws(Exception::class)
|
||||||
fun setUp() {
|
fun setUp() {
|
||||||
httpClient = HttpClient.create(null)
|
httpClient = HttpClient.Builder().build().okHttpClient
|
||||||
remote = HttpUrl.parse("http://localhost:8000") // FIXME: hardcode for now, should make configureable
|
remote = HttpUrl.parse("http://localhost:8000") // FIXME: hardcode for now, should make configureable
|
||||||
val journalAuthenticator = JournalAuthenticator(httpClient!!, remote!!)
|
val journalAuthenticator = JournalAuthenticator(httpClient!!, remote!!)
|
||||||
authToken = journalAuthenticator.getAuthToken(Helpers.USER, Helpers.PASSWORD)
|
authToken = journalAuthenticator.getAuthToken(Helpers.USER, Helpers.PASSWORD)
|
||||||
|
|
||||||
httpClient = HttpClient.create(null, App.log, null, authToken!!)
|
httpClient = HttpClient.Builder(null, null, authToken!!).build().okHttpClient
|
||||||
|
|
||||||
/* Reset */
|
/* Reset */
|
||||||
val request = Request.Builder()
|
val request = Request.Builder()
|
||||||
|
Loading…
Reference in New Issue
Block a user