Skip to content

Commit 7a38eea

Browse files
committed
Tidy up testapp and poms.
Closes #1520.
1 parent 57463e9 commit 7a38eea

File tree

11 files changed

+137
-103
lines changed

11 files changed

+137
-103
lines changed

spring-data-couchbase/pom.xml

Lines changed: 21 additions & 34 deletions
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

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,24 @@
22
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
33
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
44
<modelVersion>4.0.0</modelVersion>
5+
6+
<properties>
7+
<springdata.commons>3.0.0-SNAPSHOT</springdata.commons>
8+
<springdata.couchbase>5.0.0-SNAPSHOT</springdata.couchbase>
9+
</properties>
10+
511
<parent>
612
<groupId>org.springframework.boot</groupId>
713
<artifactId>spring-boot-starter-parent</artifactId>
8-
<version>3.0.0-SNAPSHOT</version>
14+
<!-- <version>${springdata.commons}</version> -->
15+
<version>3.0.0-SNAPSHOT</version>
916
<relativePath/> <!-- lookup parent from repository -->
1017
</parent>
1118
<groupId>com.example</groupId>
1219
<artifactId>demo</artifactId>
1320
<version>0.0.1-SNAPSHOT</version>
1421
<name>demo</name>
1522
<description>Demo project for Spring Boot</description>
16-
<properties>
17-
<java.version>11</java.version>
18-
</properties>
1923
<dependencies>
2024
<dependency>
2125
<groupId>org.springframework.boot</groupId>
@@ -26,7 +30,7 @@
2630
<dependency>
2731
<groupId>org.springframework.data</groupId>
2832
<artifactId>spring-data-couchbase</artifactId>
29-
<version>5.0.0-SNAPSHOT</version>
33+
<version>${springdata.couchbase}</version>
3034
</dependency>
3135

3236
<dependency>
@@ -35,11 +39,13 @@
3539
<scope>test</scope>
3640
</dependency>
3741

42+
<!--
3843
<dependency>
3944
<groupId>com.fasterxml.jackson.datatype</groupId>
4045
<artifactId>jackson-datatype-jsr310</artifactId>
4146
<version>2.10.1</version>
4247
</dependency>
48+
-->
4349

4450
</dependencies>
4551

@@ -48,9 +54,6 @@
4854
<plugin>
4955
<groupId>org.springframework.boot</groupId>
5056
<artifactId>spring-boot-maven-plugin</artifactId>
51-
<!--
52-
<version>3.0.0-SNAPSHOT</version>
53-
-->
5457
</plugin>
5558
</plugins>
5659
</build>
@@ -83,13 +86,4 @@
8386
</pluginRepository>
8487
</pluginRepositories>
8588

86-
<!--
87-
<pluginRepositories>
88-
<pluginRepository>
89-
<id>spring-plugins-release</id>
90-
<url>https://repo.spring.io/plugins-release</url>
91-
</pluginRepository>
92-
</pluginRepositories>
93-
-->
94-
9589
</project>

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

Lines changed: 1 addition & 15 deletions
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

Lines changed: 4 additions & 4 deletions
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

Lines changed: 20 additions & 0 deletions
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 {

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

Lines changed: 17 additions & 2 deletions
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;
@@ -10,13 +25,13 @@
1025
/**
1126
* Components of the type CommandLineRunner are called right after the application start up. So the method *run* is
1227
* called as soon as the application starts.
28+
*
29+
* @author Michael Reiche
1330
*/
1431
@Component
1532
public class CmdRunner implements CommandLineRunner {
1633

1734
@Autowired AirportRepository airportRepository;
18-
@Autowired
19-
IndexDetailRepository indexDetailRepository;
2035
@Autowired CouchbaseTemplate template;
2136
@Autowired CouchbaseClientFactory couchbaseClientFactory;
2237
@Autowired AirportService airportService;

0 commit comments

Comments
 (0)