API1.0.22+2 dataAllowedPolicy
This commit is contained in:
parent
6f9850ecab
commit
eab46438c8
@ -91,7 +91,7 @@ class CustomerController ( private val customerRepository: CustomerRepository) {
|
|||||||
|
|
||||||
val password: String? = newCustomer.password
|
val password: String? = newCustomer.password
|
||||||
val updatedCustomer: Customer
|
val updatedCustomer: Customer
|
||||||
if ( password == null || password.isEmpty() ) {
|
if ( password == null || password.length == 0 ) {
|
||||||
updatedCustomer =
|
updatedCustomer =
|
||||||
returnCustomer.copy(
|
returnCustomer.copy(
|
||||||
name = newCustomer.name,
|
name = newCustomer.name,
|
||||||
@ -100,8 +100,8 @@ class CustomerController ( private val customerRepository: CustomerRepository) {
|
|||||||
birthYear = newCustomer.birthYear,
|
birthYear = newCustomer.birthYear,
|
||||||
fitnessLevel = newCustomer.fitnessLevel,
|
fitnessLevel = newCustomer.fitnessLevel,
|
||||||
bodyType = newCustomer.bodyType,
|
bodyType = newCustomer.bodyType,
|
||||||
goal = newCustomer.goal
|
goal = newCustomer.goal,
|
||||||
//weight = newCustomer.weight
|
dataPolicyAllowed = newCustomer.dataPolicyAllowed
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
updatedCustomer =
|
updatedCustomer =
|
||||||
@ -113,8 +113,8 @@ class CustomerController ( private val customerRepository: CustomerRepository) {
|
|||||||
birthYear = newCustomer.birthYear,
|
birthYear = newCustomer.birthYear,
|
||||||
fitnessLevel = newCustomer.fitnessLevel,
|
fitnessLevel = newCustomer.fitnessLevel,
|
||||||
bodyType = newCustomer.bodyType,
|
bodyType = newCustomer.bodyType,
|
||||||
goal = newCustomer.goal
|
goal = newCustomer.goal,
|
||||||
//weight = newCustomer.weight
|
dataPolicyAllowed = newCustomer.dataPolicyAllowed
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -80,9 +80,11 @@ class CustomerTests {
|
|||||||
|
|
||||||
assertNotNull(updatedCustomer)
|
assertNotNull(updatedCustomer)
|
||||||
updatedCustomer.firstname ="Tiborka"
|
updatedCustomer.firstname ="Tiborka"
|
||||||
|
updatedCustomer.dataPolicyAllowed = 1;
|
||||||
|
|
||||||
val customer: Customer = customerRepository.save( updatedCustomer )
|
val customer: Customer = customerRepository.save( updatedCustomer )
|
||||||
assertEquals( customer.firstname, "Tiborka")
|
assertEquals( customer.firstname, "Tiborka")
|
||||||
|
assertEquals(customer.dataPolicyAllowed, 1)
|
||||||
|
|
||||||
customerRepository.delete(updatedCustomer)
|
customerRepository.delete(updatedCustomer)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user