Skip to content
Advertisement

Tag: spring-boot

How to disable AWS parameter store autoconfiguration for tests?

I have added spring-cloud-starter-aws-parameter-store-config dependency as explained in the spring documentation. Now, for unit tests I want to disable parameter store configuration. But not able to do it. I tried setting following property in test/application.properties Also tried excluding AwsParamStoreBootstrapConfiguration.class from AutoConfiguration but still not working. Exception Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.amazonaws.services.simplesystemsmanagement.AWSSimpleSystemsManagement]: Factory method ‘ssmClient’ threw exception; nested exception

How to returnDTO instead of entity in Spring boot pagination?

My DTO is different from entity. How can I return a DTO instead of entity with pagination while still showing information of all pages? Controller: Service: Repository: DTO: Entity: Answer The StudentDTO class can have a constructor with a Student parameter. Then you can call map on the Page object.

Spring boot where is my jar file

Spring boot makes it really easy to setup a simple app. But it takes me longer to actually get a jar file which I can upload to a remote server. I am using IntelliJ, no command line, and I use gradle. The application is running somehow out of Intellij. But where are the created files? Where is my jar from

Spring boot – @Service class calling another @Service class

Is it fine to have a @Service annotated class calling another @Service annotated class? Or it is a bad practice? Eg.: Answer It is not any restriction calling a service from another one. Unless you make circular dependency between services. Circular dependency : https://en.wikipedia.org/wiki/Circular_dependency Circular dependency in spring : https://www.baeldung.com/circular-dependencies-in-spring

MappingJackson2HttpMessageConverter configuration is not being recognized in spring boot 2

I am working with spring for a while already and in my spring boot 1.5x’s projects always dealing with the LazyInitializationException with the next configuration (more downstairs) but now I am creating a new project with spring boot 2 and the same configuration is not being recognized further than WebMvcConfigurer now replace to the deprecated WebMvcConfigurerAdapter. My configuration: But after

Advertisement