Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 20 additions & 15 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.5.5</version>
<version>4.0.1</version>
</parent>

<groupId>org.couchbase</groupId>
Expand All @@ -20,23 +20,18 @@
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<swagger.version>3.0.0</swagger.version>
<springweb.version>3.0.0</springweb.version>
<couchbase.version>3.7.9</couchbase.version>
<couchbase.version>3.10.0</couchbase.version>
<lombok.version>1.18.42</lombok.version>
<springdoc.version>3.0.1</springdoc.version>
<junit.version>4.13.2</junit.version>
<mavensurefire.version>3.0.0-M5</mavensurefire.version>
<maven-surefire.version>3.5.4</maven-surefire.version>
</properties>

<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
<version>6.2.5</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot</artifactId>
Expand All @@ -55,6 +50,16 @@
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-webmvc-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-restclient</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
Expand All @@ -74,7 +79,7 @@
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
<version>2.8.5</version>
<version>${springdoc.version}</version>
</dependency>
<dependency>
<groupId>com.couchbase.client</groupId>
Expand All @@ -84,7 +89,7 @@
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.38</version>
<version>${lombok.version}</version>
<scope>provided</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.mindrot/jbcrypt -->
Expand Down Expand Up @@ -125,15 +130,15 @@
<path>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.38</version>
<version>${lombok.version}</version>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.5.2</version>
<version>${maven-surefire.version}</version>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
Expand Down Expand Up @@ -164,7 +169,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>3.5.2</version>
<version>${maven-surefire.version}</version>
<configuration>
<includes>
<include>**/*IntegrationTest.java</include>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration;

@SpringBootApplication(exclude = SecurityAutoConfiguration.class, proxyBeanMethods = false)
@SpringBootApplication(proxyBeanMethods = false)
public class Application implements CommandLineRunner {

private static final Logger log = LoggerFactory.getLogger(Application.class);
Expand Down
8 changes: 6 additions & 2 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Spring MVC configuration
spring.mvc.pathmatch.matching-strategy=ANT_PATH_MATCHER

# Modern Couchbase configuration (Spring Boot 3.5+)
# Modern Couchbase configuration (Spring Boot 4.0+)
spring.couchbase.connection-string=${DB_CONN_STR}
spring.couchbase.username=${DB_USERNAME}
spring.couchbase.password=${DB_PASSWORD}
Expand All @@ -10,4 +10,8 @@ spring.couchbase.bucket.name=travel-sample
# Couchbase connection optimizations
spring.couchbase.env.timeouts.query=30000ms
spring.couchbase.env.timeouts.key-value=5000ms
spring.couchbase.env.timeouts.connect=10000ms
spring.couchbase.env.timeouts.connect=10000ms

# springdoc-openapi 3.x - enable API docs (disabled by default in 3.x)
springdoc.api-docs.enabled=true
springdoc.swagger-ui.enabled=true
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.web.client.TestRestTemplate;
import org.springframework.boot.resttestclient.TestRestTemplate;
import org.springframework.boot.resttestclient.autoconfigure.AutoConfigureTestRestTemplate;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.dao.DataRetrievalFailureException;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus;
Expand All @@ -30,6 +30,7 @@

@Slf4j
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@AutoConfigureTestRestTemplate
class AirlineIntegrationTest {

@Value("${local.server.port}")
Expand All @@ -46,7 +47,7 @@ private void deleteAirline(String airlineId, String cleanupTiming) {
if (airlineService.getAirlineById(airlineId) != null) {
restTemplate.delete("/api/v1/airline/" + airlineId);
}
} catch (DocumentNotFoundException | DataRetrievalFailureException | ResourceAccessException e) {
} catch (DocumentNotFoundException | ResourceAccessException e) {
log.warn("Document " + airlineId + " not present " + cleanupTiming);
} catch (Exception e) {
log.debug("Cleanup: Could not delete test airline {}: {} (this is expected during test cleanup)", airlineId, e.getMessage());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.web.client.TestRestTemplate;
import org.springframework.boot.resttestclient.TestRestTemplate;
import org.springframework.boot.resttestclient.autoconfigure.AutoConfigureTestRestTemplate;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.dao.DataRetrievalFailureException;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus;
Expand All @@ -31,6 +31,7 @@

@Slf4j
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@AutoConfigureTestRestTemplate
class AirportIntegrationTest {

@Value("${local.server.port}")
Expand All @@ -47,7 +48,7 @@ private void deleteAirport(String airportId, String cleanupTiming) {
if (airportService.getAirportById(airportId) != null) {
restTemplate.delete("/api/v1/airport/" + airportId);
}
} catch (DocumentNotFoundException | DataRetrievalFailureException | ResourceAccessException e) {
} catch (DocumentNotFoundException | ResourceAccessException e) {
log.warn("Document " + airportId + " not present " + cleanupTiming);
} catch (Exception e) {
log.debug("Cleanup: Could not delete test airport {}: {} (this is expected during test cleanup)", airportId, e.getMessage());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.web.client.TestRestTemplate;
import org.springframework.boot.resttestclient.TestRestTemplate;
import org.springframework.boot.resttestclient.autoconfigure.AutoConfigureTestRestTemplate;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.dao.DataRetrievalFailureException;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus;
Expand All @@ -28,6 +28,7 @@

@Slf4j
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@AutoConfigureTestRestTemplate
class RouteIntegrationTest {

@Value("${local.server.port}")
Expand All @@ -44,7 +45,7 @@ private void deleteRoute(String routeId, String cleanupTiming) {
if (routeService.getRouteById(routeId) != null) {
restTemplate.delete("/api/v1/route/" + routeId);
}
} catch (DocumentNotFoundException | DataRetrievalFailureException | ResourceAccessException e) {
} catch (DocumentNotFoundException | ResourceAccessException e) {
log.warn("Document " + routeId + " not present " + cleanupTiming);
} catch (Exception e) {
log.debug("Cleanup: Could not delete test route {}: {} (this is expected during test cleanup)", routeId, e.getMessage());
Expand Down
Loading