customer - password nullable

This commit is contained in:
Bossanyi Tibor 2020-07-07 00:49:36 +02:00
parent 0054a7d499
commit 9dccebfb7d
2 changed files with 4 additions and 2 deletions

View File

@ -17,7 +17,7 @@ data class Customer (
var dateChange: String? = null,
var dataPolicyAllowed: Int = 0,
var admin: Int = 0,
var password: String = "",
var password: String? = "",
var birthYear:Int = 0,
var weight: Int = 0,
var goal: String? = null,

View File

@ -100,6 +100,7 @@ class CustomerTests {
val customer = Customer()
customer.customerId = id
customer.password = null
customer.firstname = "Tib"
customer.name = "Bossi"
customer.admin = 1
@ -113,6 +114,7 @@ class CustomerTests {
var newCustomer: Customer? = response.body as Customer
assertEquals(response.statusCode, HttpStatus.OK)
assertEquals(newCustomer?.weight, 79)
assertEquals(newCustomer?.password, "123456789")
// test not found
id = 1000
@ -121,7 +123,7 @@ class CustomerTests {
// update Password
id = 90
id = 103
customer.password = "blabal"
response = customerController.updateCustomerById(id, customer, HttpHeaders.readOnlyHttpHeaders(HttpHeaders.EMPTY) )
assertEquals(response.statusCode, HttpStatus.OK)