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:
2022-01-04 10:51:02 +01:00
parent 35c072abf6
commit e1f3e468cf
4 changed files with 18 additions and 7 deletions

View File

@ -0,0 +1,4 @@
package com.maenle.bump.util
class CodeProcessor {
}

View File

@ -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
}

View File

@ -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()},