Merge branch 'tibor' into 'master'

customer - password nullable

See merge request bossanyit/aitrainer_server!8
This commit is contained in:
Bossányi Tibor 2020-07-06 22:51:00 +00:00
commit 3bf886b222
2 changed files with 4 additions and 2 deletions

View File

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

View File

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