val result = mockMvc.perform(get("/api/v1/books/978-4-7710-1067-3"))
.andDo(MockMvcResultHandlers.print())
.andExpect(status().isOk)
.andReturn()
val javaType = objectMapper.typeFactory.constructCollectionType(List::class.java, Book::class.java)
val bookObject: List<Book> = objectMapper.readValue(result.response.contentAsString, javaType)
assertThat(bookObject[0].price).isEqualTo(100)- Use explicit and deterministic Docker base image tags
- Install only what you need in production in the Java container image
- Find and fix security vulnerabilities in your Java Docker image
- Use multi-stage builds
- Don’t run Java apps as root
- Properly handle events to safely terminate a Java application
- Gracefully tear down Java applications
- Use .dockerignore
NewerOlder