Skip to content
Advertisement

Tag: spring

How to convert List into a Mono

i’m trying to convert this method to an a reactive method I Have something like this but i don’t know how to conver the ArrayList to return an Mono<List> Answer If you really want a Mono, then just wrap the value that you want to transport in it: But I doubt you really want to return a list in a

Spring Boot: class with @Service bean bean not found

I have multiple @Service class which implements a class BaseService In a Controller class, I want to call a Service class (which implements BaseService) based on a parameter I’m using a function in Utils and calling it from the Controller class My TestService class has an @Service annotation TestService works if I call it using constructor in the Controller class

HttpMessageConverter for Single Object and List of Object

I have an Object (here: Property) and I want to add csv export ability to my Spring Backend for single and list of objects. I added this to my config: and the Property Converter looks like this: This code works for a Single Property. When I try to return a list of Properties: I tried to add a PropertyListConverter but

Spring Boot, Swagger and Authorisation

I have a Spring Boot API that uses Springdoc (Swagger). The API has security with “apiKey” and “code” fields being passed in the header. I am having difficulty configuring Swagger correctly to enable the Authentication function in the Swagger UI. This is the configuration: I know this is incorrect, but are unsure how to configure it. Any assistance appreciated. Attempts

Why my test passes without a bearer token

I have a simple Spring app. But I don’t understand why the test passes without the need of a bearer token. Here is the controller: Security Configuration: In order to setup the security configs for tests I’m using: So my test class looks like this: If I change the autority in the test to something like ‘foo-user’ the response becomes

Advertisement