Skip to content

Commit 06500e1

Browse files
committed
Revert commits for DATACOUCH-650 that shouldn't had been backported to 4.1.x.
See #1042
1 parent 8991562 commit 06500e1

File tree

5 files changed

+6
-68
lines changed

5 files changed

+6
-68
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<properties>
2121
<couchbase>3.0.10</couchbase>
2222
<couchbase.osgi>3.0.10</couchbase.osgi>
23-
<springdata.commons>2.5.0-SNAPSHOT</springdata.commons>
23+
<springdata.commons>2.4.3-SNAPSHOT</springdata.commons>
2424
<java-module-name>spring.data.couchbase</java-module-name>
2525
</properties>
2626

src/main/java/org/springframework/data/couchbase/repository/support/SimpleCouchbaseRepository.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,6 @@ public void delete(T entity) {
124124
couchbaseOperations.removeById().one(entityInformation.getId(entity));
125125
}
126126

127-
@Override
128-
public void deleteAllById(Iterable<? extends ID> ids) {
129-
Assert.notNull(ids, "The given Iterable of ids must not be null!");
130-
couchbaseOperations.removeById().all(Streamable.of(ids).map(Objects::toString).toList());
131-
}
132-
133127
@Override
134128
public void deleteAll(Iterable<? extends T> entities) {
135129
Assert.notNull(entities, "The given Iterable of entities must not be null!");

src/main/java/org/springframework/data/couchbase/repository/support/SimpleReactiveCouchbaseRepository.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -166,11 +166,6 @@ public Mono<Void> delete(T entity) {
166166
return operations.removeById().one(entityInformation.getId(entity)).then();
167167
}
168168

169-
@Override
170-
public Mono<Void> deleteAllById(Iterable<? extends ID> ids) {
171-
return operations.removeById().all(Streamable.of(ids).map(Object::toString).toList()).then();
172-
}
173-
174169
@Override
175170
public Mono<Void> deleteAll(Iterable<? extends T> entities) {
176171
return operations.removeById().all(Streamable.of(entities).map(entityInformation::getId).toList()).then();

src/test/java/org/springframework/data/couchbase/repository/CouchbaseRepositoryQueryIntegrationTests.java

Lines changed: 3 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,19 @@
1717
package org.springframework.data.couchbase.repository;
1818

1919
import static java.util.Arrays.*;
20-
import static org.assertj.core.api.Assertions.*;
2120
import static org.junit.jupiter.api.Assertions.*;
2221

2322
import java.util.ArrayList;
24-
import java.util.Arrays;
2523
import java.util.List;
2624
import java.util.Locale;
2725
import java.util.concurrent.Callable;
2826
import java.util.concurrent.ExecutorService;
2927
import java.util.concurrent.Executors;
3028
import java.util.concurrent.Future;
31-
import java.util.stream.Collectors;
3229

3330
import org.junit.jupiter.api.BeforeEach;
3431
import org.junit.jupiter.api.Test;
32+
3533
import org.springframework.beans.factory.annotation.Autowired;
3634
import org.springframework.context.annotation.Configuration;
3735
import org.springframework.dao.DataIntegrityViolationException;
@@ -40,17 +38,15 @@
4038
import org.springframework.data.couchbase.domain.Address;
4139
import org.springframework.data.couchbase.domain.Airport;
4240
import org.springframework.data.couchbase.domain.AirportRepository;
43-
import org.springframework.data.couchbase.domain.ReactiveUserRepository;
44-
import org.springframework.data.couchbase.domain.User;
45-
import org.springframework.data.couchbase.domain.UserRepository;
4641
import org.springframework.data.couchbase.domain.Person;
4742
import org.springframework.data.couchbase.domain.PersonRepository;
43+
import org.springframework.data.couchbase.domain.User;
44+
import org.springframework.data.couchbase.domain.UserRepository;
4845
import org.springframework.data.couchbase.repository.config.EnableCouchbaseRepositories;
4946
import org.springframework.data.couchbase.util.Capabilities;
5047
import org.springframework.data.couchbase.util.ClusterAwareIntegrationTests;
5148
import org.springframework.data.couchbase.util.ClusterType;
5249
import org.springframework.data.couchbase.util.IgnoreWhen;
53-
import org.springframework.data.util.StreamUtils;
5450
import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;
5551

5652
import com.couchbase.client.core.error.IndexExistsException;
@@ -282,30 +278,10 @@ void threadSafeStringParametersTest() throws Exception {
282278
}
283279
}
284280

285-
@Test // DATACOUCH-650
286-
void deleteAllById() {
287-
288-
Airport vienna = new Airport("airports::vie", "vie", "LOWW");
289-
Airport frankfurt = new Airport("airports::fra", "fra", "EDDF");
290-
Airport losAngeles = new Airport("airports::lax", "lax", "KLAX");
291-
292-
try {
293-
airportRepository.saveAll(asList(vienna, frankfurt, losAngeles));
294-
295-
airportRepository.deleteAllById(asList(vienna.getId(), losAngeles.getId()));
296-
297-
298-
assertThat(airportRepository.findAll()).containsExactly(frankfurt);
299-
} finally {
300-
airportRepository.deleteAll();
301-
}
302-
}
303-
304281
private void sleep(int millis) {
305282
try {
306283
Thread.sleep(millis); // so they are executed out-of-order
307284
} catch (InterruptedException ie) {
308-
;
309285
}
310286
}
311287

src/test/java/org/springframework/data/couchbase/repository/ReactiveCouchbaseRepositoryQueryIntegrationTests.java

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,7 @@
1616

1717
package org.springframework.data.couchbase.repository;
1818

19-
import static java.util.Arrays.asList;
20-
import static org.junit.jupiter.api.Assertions.assertEquals;
21-
import static org.junit.jupiter.api.Assertions.assertFalse;
22-
import static org.junit.jupiter.api.Assertions.assertThrows;
23-
import static org.junit.jupiter.api.Assertions.assertTrue;
24-
25-
import reactor.core.publisher.Flux;
26-
import reactor.test.StepVerifier;
19+
import static org.junit.jupiter.api.Assertions.*;
2720

2821
import java.util.List;
2922
import java.util.concurrent.Callable;
@@ -34,6 +27,7 @@
3427

3528
import org.junit.jupiter.api.BeforeEach;
3629
import org.junit.jupiter.api.Test;
30+
3731
import org.springframework.beans.factory.annotation.Autowired;
3832
import org.springframework.context.annotation.Configuration;
3933
import org.springframework.dao.DataIntegrityViolationException;
@@ -155,27 +149,6 @@ void count() {
155149
}
156150
}
157151

158-
@Test
159-
// DATACOUCH-650
160-
void deleteAllById() {
161-
162-
Airport vienna = new Airport("airports::vie", "vie", "LOWW");
163-
Airport frankfurt = new Airport("airports::fra", "fra", "EDDF");
164-
Airport losAngeles = new Airport("airports::lax", "lax", "KLAX");
165-
166-
try {
167-
airportRepository.saveAll(asList(vienna, frankfurt, losAngeles)).as(StepVerifier::create)
168-
.expectNext(vienna, frankfurt, losAngeles).verifyComplete();
169-
170-
airportRepository.deleteAllById(asList(vienna.getId(), losAngeles.getId())).as(StepVerifier::create)
171-
.verifyComplete();
172-
173-
airportRepository.findAll().as(StepVerifier::create).expectNext(frankfurt).verifyComplete();
174-
} finally {
175-
airportRepository.deleteAll().block();
176-
}
177-
}
178-
179152
@Configuration
180153
@EnableReactiveCouchbaseRepositories("org.springframework.data.couchbase")
181154
static class Config extends AbstractCouchbaseConfiguration {

0 commit comments

Comments
 (0)