exercise model extension and exercise_type test fix

This commit is contained in:
Bossanyi Tibor 2020-07-03 10:27:57 +02:00
parent 03af5984be
commit 2bd3f2232d
4 changed files with 11 additions and 9 deletions

View File

@ -14,9 +14,9 @@ data class ExerciseType (
@get: NotBlank var name: String = "",
@get: NotBlank var description: String = "",
@get: Null var video: BinaryType?,
@get: NotBlank var unit: String = "",
@get: Null var unitQuantity: String = "",
@get: Null var unitQuantityUnit: String = "",
@get: Null var unit: String?,
@get: Null var unitQuantity: String?,
@get: Null var unitQuantityUnit: String?,
@Id @GeneratedValue(strategy = GenerationType.IDENTITY)

View File

@ -15,6 +15,7 @@ data class Exercises (
@get: NonNull var quantity: Int = 0,
@get: Null var restTime: Int?, // in seconds
@get: NonNull var unit: String? = null,
@get: NonNull var unitQuantity: Double? = null,
@Id @GeneratedValue(strategy = GenerationType.IDENTITY)
val exerciseId: Long = 0

View File

@ -35,6 +35,7 @@ class ExerciseTest {
quantity = 100,
dateAdd = "2020-05-13 04:32:00",
unit = "repeat",
unitQuantity = 30.0,
restTime = null
)
val exerciseNew = exerciseRepository.save(exercise)

View File

@ -47,18 +47,18 @@ class ExerciseTypeTest {
@Test
fun testInsert(){
logger.info("Add 'Húzodzkodás 2")
val newEx = ExerciseType( "Húzodzkodás 2", " A legtöbb húzodszkodást 24 óra alatt John Ort érte el 7600-al 2016-ban. ", null )
logger.info("Add 'Húzodszkodás 2")
val newEx = ExerciseType( "Húzodszkodás 2", " A legtöbb húzodszkodást 24 óra alatt John Ort érte el 7600-al 2016-ban. ", null, null, null , null)
val savedEx: ExerciseType = exerciseTypeRepository.save(newEx)
assertEquals(savedEx.name, "Húzodzkodás 2")
assertEquals(savedEx.name, "Húzodszkodás 2")
this.insertedId = savedEx.exerciseTypeId
logger.info("Find 'Húzodzkodás 2")
logger.info("Find 'Húzodszkodás 2")
val extype: ExerciseType = exerciseTypeRepository.findById( savedEx.exerciseTypeId ).orElse(null)
assertEquals( extype.name, "Húzodzkodás 2")
assertEquals( extype.name, "Húzodszkodás 2")
logger.info("Delete 'Húzodzkodás 2")
logger.info("Delete 'Húzodszkodás 2")
exerciseTypeRepository.delete(extype)
}
}