sdeleuze
11/29/2017, 10:20 AMsdeleuze
11/29/2017, 10:20 AMCzar
11/29/2017, 10:22 AMpoohbar
11/29/2017, 1:25 PM1.4.1
and jackson-module-kotlin
i still get the same errors.. just letting you knowpoohbar
11/29/2017, 1:28 PMleodeng
11/29/2017, 2:22 PM@RestController
@RequestMapping("/api/books")
class BookController {
@PostMapping
fun save(@RequestBody book: Book): Book {
return Book(id = "1", name = book.name)
}
}
data class Book(
val id: String?,
val name: String
)
leodeng
11/29/2017, 2:23 PMcurl -i -H "Content-Type: application/json" -X POST -d '{"name": "Bootiful"}' <http://localhost:8080/api/books>
leodeng
11/29/2017, 2:25 PMthatadamedwards
11/29/2017, 4:17 PMenleur
11/30/2017, 3:52 PMkrotki
11/30/2017, 4:51 PMcompile("org.springframework.cloud:spring-cloud-starter-netflix-hystrix")
I'm getting java.lang.IllegalStateException: OnEnabledEndpointCondition may only be used on @Bean methods that return an @Endpoint or and @EndpointExtension
on application start.krotki
11/30/2017, 4:54 PMander.dev
11/30/2017, 8:17 PMleodeng
11/30/2017, 8:45 PMander.dev
11/30/2017, 8:57 PMleodeng
11/30/2017, 9:06 PMander.dev
11/30/2017, 9:11 PMander.dev
11/30/2017, 9:12 PMander.dev
11/30/2017, 9:12 PMander.dev
11/30/2017, 9:26 PMleodeng
11/30/2017, 9:47 PM@RestController
@RequestMapping("/api/books")
class BookController {
@GetMapping
fun getAll(): List<Book> {
return listOf(
Book("1", "Bootiful"),
Book("2", "Spring")
)
}
}
data class Book(
val id: String?,
val name: String
)
@RunWith(SpringRunner::class)
@WebMvcTest(BookController::class)
class BookControllerTest {
@Autowired
lateinit var mvc: MockMvc
@Test
fun getAllShouldReturnBooks() {
this.mvc.perform(get("/api/books").accept(MediaType.APPLICATION_JSON))
.andExpect(status().isOk)
}
}
hernil
12/01/2017, 12:14 PMhernil
12/01/2017, 12:37 PMhernil
12/01/2017, 12:42 PMSola
12/02/2017, 3:01 AMhernil
12/06/2017, 12:06 PMleodeng
12/06/2017, 12:21 PMmadorb
12/06/2017, 4:20 PM@Bean
fun foo(a: A, b: B?)
be equivalent to
@Bean
fun foo(a: A, @Autowired(required = false) b: B?)
Daniel Selinger
12/06/2017, 4:53 PM