fixes unit tests for push and peek
- list test doesn't seem to correctly read the first element in the list from the server
This commit is contained in:
4
app/src/main/java/com/maenle/bump/util/CodeProcessor.kt
Normal file
4
app/src/main/java/com/maenle/bump/util/CodeProcessor.kt
Normal file
@ -0,0 +1,4 @@
|
||||
package com.maenle.bump.util
|
||||
|
||||
class CodeProcessor {
|
||||
}
|
@ -144,7 +144,7 @@ class MessageProcessor(code: String, private val salt: ByteArray? = null) {
|
||||
const val ITERATIONS_LENGTH: Int = 4
|
||||
|
||||
const val ITERATIONS: Int = 100_000
|
||||
const val TIME_TO_LIVE: Long = 1000 * 365 * 24
|
||||
const val TIME_TO_LIVE: Long = 100000 * 365 * 24
|
||||
|
||||
}
|
||||
|
||||
|
@ -58,11 +58,12 @@ class RestSingleton constructor(context: Context){
|
||||
requestQueue.add(jsonRequest)
|
||||
}
|
||||
|
||||
fun push(sender: String, message: String, function: () -> Unit){
|
||||
fun push(sender: String, title: String, encoded: String, function: () -> Unit){
|
||||
val url = URL + "push/"
|
||||
val data = JSONObject()
|
||||
data.put("sender", sender)
|
||||
data.put("data", message)
|
||||
data.put("title", title)
|
||||
data.put("data", encoded)
|
||||
val stringRequest = JsonObjectRequest(Request.Method.POST, url,
|
||||
data,
|
||||
{_ -> function()},
|
||||
|
Reference in New Issue
Block a user