Skip to content

Commit a92ebd0

Browse files
authored
Tidy testapp and poms. (#1521)
Closes #1520.
1 parent e9f9d66 commit a92ebd0

File tree

12 files changed

+182
-151
lines changed

12 files changed

+182
-151
lines changed

pom.xml

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2-
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
34

45
<modelVersion>4.0.0</modelVersion>
56

spring-data-couchbase/pom.xml

+21-34
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,19 @@
1919
<java-module-name>spring.data.couchbase</java-module-name>
2020
<jodatime>2.10.13</jodatime>
2121
<jakarta.validation>3.0.1</jakarta.validation>
22-
<hibernate.validator>7.0.1.Final</hibernate.validator>
2322
<apt>1.1.3</apt>
2423
<querydsl>5.0.0</querydsl>
2524
<mysema.querydsl>3.7.4</mysema.querydsl>
25+
<jakarta.enterprise>3.0.0</jakarta.enterprise>
26+
<org.hibernate.validator>7.0.1.Final</org.hibernate.validator>
27+
<jakarta.el>4.0.0</jakarta.el>
28+
<javax.el>3.0.0</javax.el>
29+
<org.glassfish>4.0.2</org.glassfish>
30+
<org.apache.geronimo.specs>1.0.1</org.apache.geronimo.specs>
31+
<javax.interceptor>1.2.1</javax.interceptor>
32+
<com.couchbase.mock>1.5.25</com.couchbase.mock>
33+
<com.squareup.okhttp3>4.8.1</com.squareup.okhttp3>
34+
<org.awaitility>4.0.3</org.awaitility>
2635
</properties>
2736

2837
<dependencyManagement>
@@ -67,19 +76,11 @@
6776
<version>${springdata.commons}</version>
6877
</dependency>
6978

70-
<!-- in parent
71-
<dependency>
72-
<groupId>com.couchbase.client</groupId>
73-
<artifactId>java-client</artifactId>
74-
<version>${couchbase}</version>
75-
</dependency>
76-
-->
77-
7879
<!-- CDI -->
7980
<dependency>
8081
<groupId>jakarta.enterprise</groupId>
8182
<artifactId>jakarta.enterprise.cdi-api</artifactId>
82-
<version>3.0.0</version>
83+
<version>${jakarta.enterprise}</version>
8384
</dependency>
8485

8586
<dependency>
@@ -92,14 +93,7 @@
9293
<dependency>
9394
<groupId>org.hibernate.validator</groupId>
9495
<artifactId>hibernate-validator</artifactId>
95-
<version>7.0.1.Final</version>
96-
<scope>test</scope>
97-
</dependency>
98-
99-
<dependency>
100-
<groupId>org.apache.httpcomponents</groupId>
101-
<artifactId>httpclient</artifactId>
102-
<version>4.5.13</version>
96+
<version>${org.hibernate.validator}</version>
10397
<scope>test</scope>
10498
</dependency>
10599

@@ -137,22 +131,22 @@
137131
<dependency>
138132
<groupId>jakarta.el</groupId>
139133
<artifactId>jakarta.el-api</artifactId>
140-
<version>4.0.0</version>
134+
<version>${jakarta.el}</version>
141135
<scope>provided</scope>
142136
<optional>true</optional>
143137
</dependency>
144138

145139
<dependency>
146140
<groupId>javax.el</groupId>
147141
<artifactId>javax.el-api</artifactId>
148-
<version>3.0.0</version>
142+
<version>${javax.el}</version>
149143
<scope>test</scope>
150144
</dependency>
151145

152146
<dependency>
153147
<groupId>org.glassfish</groupId>
154148
<artifactId>jakarta.el</artifactId>
155-
<version>4.0.2</version>
149+
<version>${jakarta.el}</version>
156150
<scope>provided</scope>
157151
<optional>true</optional>
158152
</dependency>
@@ -162,42 +156,35 @@
162156
<dependency>
163157
<groupId>org.apache.geronimo.specs</groupId>
164158
<artifactId>geronimo-jcdi_2.0_spec</artifactId>
165-
<version>1.0.1</version>
159+
<version>${org.apache.geronimo.specs}</version>
166160
<scope>test</scope>
167161
</dependency>
168162

169163
<dependency>
170164
<groupId>javax.interceptor</groupId>
171165
<artifactId>javax.interceptor-api</artifactId>
172-
<version>1.2.1</version>
173-
<scope>test</scope>
174-
</dependency>
175-
176-
<dependency>
177-
<groupId>org.apache.openwebbeans</groupId>
178-
<artifactId>openwebbeans-se</artifactId>
179-
<version>${webbeans}</version>
166+
<version>${javax.interceptor}</version>
180167
<scope>test</scope>
181168
</dependency>
182169

183170
<dependency>
184171
<groupId>com.couchbase.mock</groupId>
185172
<artifactId>CouchbaseMock</artifactId>
186-
<version>1.5.25</version>
173+
<version>${com.couchbase.mock}</version>
187174
<scope>test</scope>
188175
</dependency>
189176

190177
<dependency>
191178
<groupId>com.squareup.okhttp3</groupId>
192179
<artifactId>okhttp</artifactId>
193-
<version>4.8.1</version>
180+
<version>${com.squareup.okhttp3}</version>
194181
<scope>test</scope>
195182
</dependency>
196183

197184
<dependency>
198185
<groupId>com.squareup.okhttp3</groupId>
199186
<artifactId>okhttp-tls</artifactId>
200-
<version>4.8.1</version>
187+
<version>${com.squareup.okhttp3}</version>
201188
<scope>test</scope>
202189
</dependency>
203190

@@ -226,7 +213,7 @@
226213
<dependency>
227214
<groupId>org.awaitility</groupId>
228215
<artifactId>awaitility</artifactId>
229-
<version>4.0.3</version>
216+
<version>${org.awaitility}</version>
230217
<scope>test</scope>
231218
</dependency>
232219

spring-data-testapp/pom.xml

+54-64
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,58 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
4-
<modelVersion>4.0.0</modelVersion>
5-
<parent>
6-
<groupId>org.springframework.boot</groupId>
7-
<artifactId>spring-boot-starter-parent</artifactId>
8-
<version>3.0.0-SNAPSHOT</version>
9-
<relativePath/> <!-- lookup parent from repository -->
10-
</parent>
11-
<groupId>com.example</groupId>
12-
<artifactId>demo</artifactId>
13-
<version>0.0.1-SNAPSHOT</version>
14-
<name>demo</name>
15-
<description>Demo project for Spring Boot</description>
16-
<properties>
17-
<java.version>11</java.version>
18-
</properties>
19-
<dependencies>
20-
<dependency>
21-
<groupId>org.springframework.boot</groupId>
22-
<artifactId>spring-boot-starter-data-couchbase</artifactId>
23-
</dependency>
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
4+
<modelVersion>4.0.0</modelVersion>
245

25-
<!--- for testing only -->
26-
<dependency>
27-
<groupId>org.springframework.data</groupId>
28-
<artifactId>spring-data-couchbase</artifactId>
29-
<version>5.0.0-SNAPSHOT</version>
30-
</dependency>
6+
<parent>
7+
<groupId>org.springframework.boot</groupId>
8+
<artifactId>spring-boot-starter-parent</artifactId>
9+
<version>3.0.0-SNAPSHOT</version>
10+
<relativePath/> <!-- lookup parent from repository -->
11+
</parent>
12+
<groupId>com.example</groupId>
13+
<artifactId>demo</artifactId>
14+
<version>0.0.1-SNAPSHOT</version>
15+
<name>demo</name>
16+
<description>Demo project for Spring Boot</description>
3117

32-
<dependency>
33-
<groupId>org.springframework.boot</groupId>
34-
<artifactId>spring-boot-starter-test</artifactId>
35-
<scope>test</scope>
36-
</dependency>
18+
<properties>
19+
<springdata.couchbase>5.0.0-SNAPSHOT</springdata.couchbase>
20+
</properties>
3721

38-
<dependency>
39-
<groupId>com.fasterxml.jackson.datatype</groupId>
40-
<artifactId>jackson-datatype-jsr310</artifactId>
41-
<version>2.10.1</version>
42-
</dependency>
22+
<dependencies>
23+
<dependency>
24+
<groupId>org.springframework.boot</groupId>
25+
<artifactId>spring-boot-starter-data-couchbase</artifactId>
26+
<exclusions>
27+
<exclusion>
28+
<groupId>org.springframework.data</groupId>
29+
<artifactId>spring-data-couchbase</artifactId>
30+
</exclusion>
31+
</exclusions>
32+
</dependency>
4333

44-
</dependencies>
34+
<dependency>
35+
<groupId>org.springframework.data</groupId>
36+
<artifactId>spring-data-couchbase</artifactId>
37+
<version>${springdata.couchbase}</version>
38+
</dependency>
4539

46-
<build>
47-
<plugins>
48-
<plugin>
49-
<groupId>org.springframework.boot</groupId>
50-
<artifactId>spring-boot-maven-plugin</artifactId>
51-
<!--
52-
<version>3.0.0-SNAPSHOT</version>
53-
-->
54-
</plugin>
55-
</plugins>
56-
</build>
40+
<dependency>
41+
<groupId>org.springframework.boot</groupId>
42+
<artifactId>spring-boot-starter-test</artifactId>
43+
<scope>test</scope>
44+
</dependency>
45+
46+
</dependencies>
47+
48+
<build>
49+
<plugins>
50+
<plugin>
51+
<groupId>org.springframework.boot</groupId>
52+
<artifactId>spring-boot-maven-plugin</artifactId>
53+
</plugin>
54+
</plugins>
55+
</build>
5756

5857
<repositories>
5958
<repository>
@@ -72,24 +71,15 @@
7271
</repository>
7372
</repositories>
7473

75-
<pluginRepositories>
76-
<pluginRepository>
77-
<id>spring-snapshots</id>
78-
<url>https://repo.spring.io/snapshot</url>
79-
</pluginRepository>
80-
<pluginRepository>
81-
<id>spring-milestones</id>
82-
<url>https://repo.spring.io/milestone</url>
83-
</pluginRepository>
84-
</pluginRepositories>
85-
86-
<!--
8774
<pluginRepositories>
8875
<pluginRepository>
89-
<id>spring-plugins-release</id>
90-
<url>https://repo.spring.io/plugins-release</url>
76+
<id>spring-snapshots</id>
77+
<url>https://repo.spring.io/snapshot</url>
78+
</pluginRepository>
79+
<pluginRepository>
80+
<id>spring-milestones</id>
81+
<url>https://repo.spring.io/milestone</url>
9182
</pluginRepository>
9283
</pluginRepositories>
93-
-->
9484

9585
</project>

spring-data-testapp/src/main/java/com/example/demo/Airport.java

+1-15
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2017-2021 the original author or authors.
2+
* Copyright 2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -29,7 +29,6 @@
2929
/**
3030
* Airport entity
3131
*
32-
* @author Michael Nitschinger
3332
* @author Michael Reiche
3433
*/
3534
@Document
@@ -79,19 +78,6 @@ public LocalDateTime getOpenDate() {
7978
return openDate;
8079
}
8180

82-
/*
83-
public Airport withId(String id) {
84-
return new Airport(id, this.iata, this.icao);
85-
}
86-
87-
public Airport withIcao(String icao) {
88-
return new Airport(this.getId(), this.iata, icao);
89-
}
90-
91-
public Airport withIata(String iata) {
92-
return new Airport(this.getId(), iata, this.icao);
93-
}
94-
*/
9581
public Airport clearVersion() {
9682
version = Long.valueOf(0);
9783
return this;

spring-data-testapp/src/main/java/com/example/demo/AirportRepository.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2017-2021 the original author or authors.
2+
* Copyright 2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -13,7 +13,6 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
1716
package com.example.demo;
1817

1918
import com.couchbase.client.java.query.QueryScanConsistency;
@@ -32,10 +31,11 @@
3231

3332
/**
3433
* Airport repository for testing <br>
34+
*
35+
* @author Michael Reiche
3536
*/
3637
@Repository
3738
@Document
38-
// @ScanConsistency(query = QueryScanConsistency.REQUEST_PLUS)
3939
public interface AirportRepository extends CouchbaseRepository<Airport, String> {
4040

4141
// override an annotate with REQUEST_PLUS
@@ -49,7 +49,7 @@ public interface AirportRepository extends CouchbaseRepository<Airport, String>
4949
@ScanConsistency(query = QueryScanConsistency.REQUEST_PLUS)
5050
Airport findByIata(String iata);
5151

52-
@ScanConsistency(query = QueryScanConsistency.NOT_BOUNDED)
52+
@ScanConsistency(query = QueryScanConsistency.NOT_BOUNDED)
5353
Airport iata(String iata);
5454

5555
@Query("#{#n1ql.selectEntity} where iata = $1")

spring-data-testapp/src/main/java/com/example/demo/AirportService.java

+20
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
/*
2+
* Copyright 2022 the original author or authors
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
116
package com.example.demo;
217

318
import com.couchbase.client.java.transactions.TransactionResult;
@@ -9,6 +24,11 @@
924
import org.springframework.transaction.annotation.Transactional;
1025
import org.springframework.util.Assert;
1126

27+
/**
28+
*
29+
*
30+
* @author Michael Reiche
31+
*/
1232
@Service
1333
@Transactional
1434
public class AirportService {

0 commit comments

Comments
 (0)