Add Immutable Entities

This commit is contained in:
2020-01-22 22:45:06 +01:00
parent dbf5fbcfc5
commit 1dec96551d
9 changed files with 231 additions and 129 deletions

View File

@@ -1,7 +1,7 @@
package fr.postgresjson
import fr.postgresjson.connexion.Paginated
import fr.postgresjson.entity.IdEntity
import fr.postgresjson.entity.mutable.IdEntity
import fr.postgresjson.entity.Parameter
import org.junit.Assert.*
import org.junit.jupiter.api.Assertions
@@ -38,8 +38,7 @@ class ConnectionTest() : TestAbstract() {
""".trimIndent()
)
assertNotNull(objs)
assertTrue(objs is List<ObjTest2>)
assertEquals(objs!!.size, 2)
assertEquals(objs.size, 2)
assertEquals(objs[0].id, 1)
assertEquals(objs[0].test!!.id, 1)
}

View File

@@ -1,6 +1,7 @@
package fr.postgresjson
import fr.postgresjson.entity.*
import fr.postgresjson.entity.EntityI
import fr.postgresjson.entity.mutable.*
import org.junit.jupiter.api.Assertions.assertTrue
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.TestInstance

View File

@@ -2,7 +2,7 @@ package fr.postgresjson
import fr.postgresjson.connexion.Paginated
import fr.postgresjson.connexion.Requester
import fr.postgresjson.entity.IdEntity
import fr.postgresjson.entity.mutable.IdEntity
import org.junit.Assert
import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Test

View File

@@ -1,6 +1,6 @@
package fr.postgresjson
import fr.postgresjson.entity.IdEntity
import fr.postgresjson.entity.mutable.IdEntity
import fr.postgresjson.serializer.Serializer
import fr.postgresjson.serializer.deserialize
import fr.postgresjson.serializer.serialize