pull/104/head
Tom Hacohen 5 years ago
parent a4a129d989
commit 496b6cd633

@ -89,6 +89,10 @@ android {
exclude 'META-INF/NOTICE.txt'
}
testOptions {
unitTests.returnDefaultValues = true
}
defaultConfig {
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)
}

@ -24,7 +24,7 @@ class AuthenticatorTest {
@Before
@Throws(IOException::class)
fun setUp() {
httpClient = HttpClient.create(null)
httpClient = HttpClient.Builder().build().okHttpClient
remote = HttpUrl.parse("http://localhost:8000") // FIXME: hardcode for now, should make configureable
}

@ -28,12 +28,12 @@ class ServiceTest {
@Before
@Throws(Exception::class)
fun setUp() {
httpClient = HttpClient.create(null)
httpClient = HttpClient.Builder().build().okHttpClient
remote = HttpUrl.parse("http://localhost:8000") // FIXME: hardcode for now, should make configureable
val journalAuthenticator = JournalAuthenticator(httpClient!!, remote!!)
authToken = journalAuthenticator.getAuthToken(Helpers.USER, Helpers.PASSWORD)
httpClient = HttpClient.create(null, App.log, null, authToken!!)
httpClient = HttpClient.Builder(null, null, authToken!!).build().okHttpClient
/* Reset */
val request = Request.Builder()

Loading…
Cancel
Save