Separate views into a maven module

This commit is contained in:
2020-10-24 01:25:25 +02:00
parent 536c6e7b79
commit 8b8dbd6fe5
37 changed files with 255 additions and 227 deletions
@@ -1,9 +1,9 @@
package be.simplenotes.app.filters
import be.simplenotes.domain.security.JwtPayload
import be.simplenotes.domain.security.JwtPayloadExtractor
import be.simplenotes.domain.security.SimpleJwt
import be.simplenotes.config.JwtConfig
import be.simplenotes.types.LoggedInUser
import com.natpryce.hamkrest.assertion.assertThat
import org.http4k.core.*
import org.http4k.core.Method.GET
@@ -58,7 +58,7 @@ internal class AuthFilterTest {
@Test
fun `it should allow a valid token`() {
val jwtPayload = JwtPayload(1, "user")
val jwtPayload = LoggedInUser(1, "user")
val token = simpleJwt.sign(jwtPayload)
val response = app(Request(GET, "/optional").cookie("Bearer", token))
assertThat(response, hasStatus(OK))
@@ -84,7 +84,7 @@ internal class AuthFilterTest {
@Test
fun `it should allow a valid token"`() {
val jwtPayload = JwtPayload(1, "user")
val jwtPayload = LoggedInUser(1, "user")
val token = simpleJwt.sign(jwtPayload)
val response = app(Request(GET, "/protected").cookie("Bearer", token))
assertThat(response, hasStatus(OK))