unit test customer table
This commit is contained in:
@@ -17,7 +17,7 @@ class CustomerController ( private val customerRepository: CustomerRepository )
|
||||
customerRepository.findAll()
|
||||
|
||||
@PostMapping("/customers")
|
||||
fun createNewArticle(@Valid @RequestBody customer: Customer): Customer =
|
||||
fun createNewCustomer(@Valid @RequestBody customer: Customer): Customer =
|
||||
customerRepository.save(customer)
|
||||
|
||||
@GetMapping("/customers/{id}")
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package com.aitrainer.api.model
|
||||
|
||||
import com.aitrainer.api.enums.SexEnum
|
||||
|
||||
import javax.persistence.Entity
|
||||
import javax.persistence.GeneratedValue
|
||||
import javax.persistence.GenerationType
|
||||
@@ -11,13 +9,13 @@ import javax.validation.constraints.NotBlank
|
||||
@Entity
|
||||
data class Customer (
|
||||
@get: NotBlank
|
||||
val name: String = "",
|
||||
|
||||
val firstname: String,
|
||||
val email: String,
|
||||
val age: Int,
|
||||
val sex: String,
|
||||
val name: String = "",
|
||||
val firstname: String = "",
|
||||
val email: String = "",
|
||||
val age: Int = 0,
|
||||
val sex: String = "m",
|
||||
|
||||
@Id @GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
val customer_id: Long? = null
|
||||
val customer_id: Long = 0
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user