Skip to content

Tag: spring-boot

Optional pagination with Spring

I am pretty new to java and spring. What I want to implement is api endpoint /tickets with pagination and sorting. I made it and it works. But also what I would like to do is to return plain list of all tickets if size and page are not specified in the query params, so in FE I can use

Logback conversion rule parametrizing

Is there any way of parametrizing conversion rule in Logback? I’ve tried adding child nodes, additional attributes and I don’t see a way to do it. I would like to add parameter that will be used by LongMessageConverter class. My application is setup on Spring Boot and I am using Sl4J. Answer This …

Why does MockMvc always return empty content()?

I’m trying to test my rest api with mockMvc. The test failed because of: From the output of print(), I can know the API actually returned the expected string “iPhone”. And I guess the empty “Actual” above is caused by empty “Body” below My questions are: Why MockHttpS…

Spring-boot default profile for integration tests

Spring-boot utilizes Spring profiles which allows to have separate config for different environments. One way I use this feature is to configure the test database to be used by integration tests. I wonder, however: is it necessary to create my own profile ‘test’ and explicitly activate this profil…