Polish end of lines
This commit is contained in:
@@ -341,7 +341,6 @@ class IntegrationTests(@Autowired val restTemplate: TestRestTemplate) {
|
|||||||
@Test
|
@Test
|
||||||
fun `Assert article page title, content and status code`() {
|
fun `Assert article page title, content and status code`() {
|
||||||
println(">> TODO")
|
println(">> TODO")
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@AfterAll
|
@AfterAll
|
||||||
@@ -627,13 +626,13 @@ We add data initialization to `BlogApplication`.
|
|||||||
fun databaseInitializer(userRepository: UserRepository, articleRepository: ArticleRepository) = CommandLineRunner {
|
fun databaseInitializer(userRepository: UserRepository, articleRepository: ArticleRepository) = CommandLineRunner {
|
||||||
val smaldini = User("smaldini", "Stéphane", "Maldini")
|
val smaldini = User("smaldini", "Stéphane", "Maldini")
|
||||||
userRepository.save(smaldini)
|
userRepository.save(smaldini)
|
||||||
|
|
||||||
articleRepository.save(Article(
|
articleRepository.save(Article(
|
||||||
"Reactor Bismuth is out",
|
"Reactor Bismuth is out",
|
||||||
"Lorem ipsum",
|
"Lorem ipsum",
|
||||||
"dolor **sit** amet https://projectreactor.io/",
|
"dolor **sit** amet https://projectreactor.io/",
|
||||||
smaldini,
|
smaldini,
|
||||||
1
|
1
|
||||||
|
|
||||||
))
|
))
|
||||||
articleRepository.save(Article(
|
articleRepository.save(Article(
|
||||||
"Reactor Aluminium has landed",
|
"Reactor Aluminium has landed",
|
||||||
@@ -641,7 +640,6 @@ fun databaseInitializer(userRepository: UserRepository, articleRepository: Artic
|
|||||||
"dolor **sit** amet https://projectreactor.io/",
|
"dolor **sit** amet https://projectreactor.io/",
|
||||||
smaldini,
|
smaldini,
|
||||||
2
|
2
|
||||||
|
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
----
|
----
|
||||||
@@ -675,7 +673,6 @@ class IntegrationTests(@Autowired val restTemplate: TestRestTemplate) {
|
|||||||
assertThat(entity.statusCode).isEqualTo(HttpStatus.OK)
|
assertThat(entity.statusCode).isEqualTo(HttpStatus.OK)
|
||||||
assertThat(entity.body).contains("Reactor Aluminium has landed",,
|
assertThat(entity.body).contains("Reactor Aluminium has landed",,
|
||||||
"<a href=\"https://projectreactor.io/\">https://projectreactor.io/</a>")
|
"<a href=\"https://projectreactor.io/\">https://projectreactor.io/</a>")
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@AfterAll
|
@AfterAll
|
||||||
@@ -683,7 +680,6 @@ class IntegrationTests(@Autowired val restTemplate: TestRestTemplate) {
|
|||||||
println(">> Tear down")
|
println(">> Tear down")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
----
|
----
|
||||||
|
|
||||||
@@ -804,6 +800,7 @@ class BlogProperties {
|
|||||||
var title: String? = null
|
var title: String? = null
|
||||||
lateinit var content: String
|
lateinit var content: String
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
----
|
----
|
||||||
|
|
||||||
|
|||||||
@@ -19,13 +19,13 @@ class BlogApplication {
|
|||||||
fun databaseInitializer(userRepository: UserRepository, articleRepository: ArticleRepository) = CommandLineRunner {
|
fun databaseInitializer(userRepository: UserRepository, articleRepository: ArticleRepository) = CommandLineRunner {
|
||||||
val smaldini = User("smaldini", "Stéphane", "Maldini")
|
val smaldini = User("smaldini", "Stéphane", "Maldini")
|
||||||
userRepository.save(smaldini)
|
userRepository.save(smaldini)
|
||||||
|
|
||||||
articleRepository.save(Article(
|
articleRepository.save(Article(
|
||||||
"Reactor Bismuth is out",
|
"Reactor Bismuth is out",
|
||||||
"Lorem ipsum",
|
"Lorem ipsum",
|
||||||
"dolor **sit** amet https://projectreactor.io/",
|
"dolor **sit** amet https://projectreactor.io/",
|
||||||
smaldini,
|
smaldini,
|
||||||
1
|
1
|
||||||
|
|
||||||
))
|
))
|
||||||
articleRepository.save(Article(
|
articleRepository.save(Article(
|
||||||
"Reactor Aluminium has landed",
|
"Reactor Aluminium has landed",
|
||||||
@@ -33,7 +33,6 @@ class BlogApplication {
|
|||||||
"dolor **sit** amet https://projectreactor.io/",
|
"dolor **sit** amet https://projectreactor.io/",
|
||||||
smaldini,
|
smaldini,
|
||||||
2
|
2
|
||||||
|
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -13,4 +13,5 @@ class BlogProperties {
|
|||||||
var title: String? = null
|
var title: String? = null
|
||||||
lateinit var content: String
|
lateinit var content: String
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -23,4 +23,4 @@ private fun getOrdinal(n: Int) = when {
|
|||||||
n % 10 == 2 -> "${n}nd"
|
n % 10 == 2 -> "${n}nd"
|
||||||
n % 10 == 3 -> "${n}rd"
|
n % 10 == 3 -> "${n}rd"
|
||||||
else -> "${n}th"
|
else -> "${n}th"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,5 +48,3 @@ class HtmlController(private val repository: ArticleRepository,
|
|||||||
val addedAt: String)
|
val addedAt: String)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -29,4 +29,4 @@ class UserController(private val repository: UserRepository) {
|
|||||||
|
|
||||||
@GetMapping("/{login}")
|
@GetMapping("/{login}")
|
||||||
fun findOne(@PathVariable login: String) = repository.findById(login)
|
fun findOne(@PathVariable login: String) = repository.findById(login)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,4 +17,4 @@ data class User(
|
|||||||
@Id val login: String,
|
@Id val login: String,
|
||||||
val firstname: String,
|
val firstname: String,
|
||||||
val lastname: String,
|
val lastname: String,
|
||||||
val description: String? = null)
|
val description: String? = null)
|
||||||
|
|||||||
@@ -6,4 +6,4 @@ interface ArticleRepository : CrudRepository<Article, Long> {
|
|||||||
fun findAllByOrderByAddedAtDesc(): Iterable<Article>
|
fun findAllByOrderByAddedAtDesc(): Iterable<Article>
|
||||||
}
|
}
|
||||||
|
|
||||||
interface UserRepository : CrudRepository<User, String>
|
interface UserRepository : CrudRepository<User, String>
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
blog.title=Blog
|
blog.title=Blog
|
||||||
blog.banner.title=Warning
|
blog.banner.title=Warning
|
||||||
blog.banner.content=The blog will be down tomorrow.
|
blog.banner.content=The blog will be down tomorrow.
|
||||||
|
|||||||
@@ -13,4 +13,4 @@
|
|||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
{{> footer}}
|
{{> footer}}
|
||||||
|
|||||||
@@ -28,4 +28,4 @@
|
|||||||
{{/articles}}
|
{{/articles}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{> footer}}
|
{{> footer}}
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ import org.mockito.Mockito.any
|
|||||||
import org.springframework.http.MediaType
|
import org.springframework.http.MediaType
|
||||||
import org.springframework.test.web.servlet.result.MockMvcResultMatchers.*
|
import org.springframework.test.web.servlet.result.MockMvcResultMatchers.*
|
||||||
|
|
||||||
|
|
||||||
@ExtendWith(SpringExtension::class)
|
@ExtendWith(SpringExtension::class)
|
||||||
@WebMvcTest
|
@WebMvcTest
|
||||||
// TODO Use constructor-based val property for @MockBean when supported, see issue spring-boot#13113
|
// TODO Use constructor-based val property for @MockBean when supported, see issue spring-boot#13113
|
||||||
@@ -56,4 +55,4 @@ class HttpApiTests(@Autowired val mockMvc: MockMvc) {
|
|||||||
.andExpect(jsonPath("\$.[1].login").value(smaldini.login))
|
.andExpect(jsonPath("\$.[1].login").value(smaldini.login))
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,7 +37,6 @@ class IntegrationTests(@Autowired val restTemplate: TestRestTemplate) {
|
|||||||
assertThat(entity.statusCode).isEqualTo(HttpStatus.OK)
|
assertThat(entity.statusCode).isEqualTo(HttpStatus.OK)
|
||||||
assertThat(entity.body).contains("Reactor Aluminium has landed",
|
assertThat(entity.body).contains("Reactor Aluminium has landed",
|
||||||
"<a href=\"https://projectreactor.io/\">https://projectreactor.io/</a>")
|
"<a href=\"https://projectreactor.io/\">https://projectreactor.io/</a>")
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@AfterAll
|
@AfterAll
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
junit.jupiter.testinstance.lifecycle.default = per_class
|
junit.jupiter.testinstance.lifecycle.default = per_class
|
||||||
|
|||||||
Reference in New Issue
Block a user