1616
1717package 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 ;
27-
28- import java .util .List ;
29- import java .util .concurrent .Callable ;
30- import java .util .concurrent .ExecutorService ;
31- import java .util .concurrent .Executors ;
32- import java .util .concurrent .Future ;
33- import java .util .stream .Collectors ;
34-
19+ import com .couchbase .client .core .error .IndexExistsException ;
3520import org .junit .jupiter .api .BeforeEach ;
3621import org .junit .jupiter .api .Test ;
3722import org .springframework .beans .factory .annotation .Autowired ;
5035import org .springframework .data .couchbase .util .ClusterType ;
5136import org .springframework .data .couchbase .util .IgnoreWhen ;
5237import org .springframework .test .context .junit .jupiter .SpringJUnitConfig ;
38+ import reactor .test .StepVerifier ;
5339
54- import com .couchbase .client .core .error .IndexExistsException ;
40+ import java .util .List ;
41+ import java .util .concurrent .Callable ;
42+ import java .util .concurrent .ExecutorService ;
43+ import java .util .concurrent .Executors ;
44+ import java .util .concurrent .Future ;
45+ import java .util .stream .Collectors ;
46+
47+ import static java .util .Arrays .*;
48+ import static org .assertj .core .api .Assertions .*;
49+ import static org .junit .jupiter .api .Assertions .*;
5550
5651/**
5752 * template class for Reactive Couchbase operations
6358@ IgnoreWhen (missesCapabilities = Capabilities .QUERY , clusterTypes = ClusterType .MOCKED )
6459public class ReactiveCouchbaseRepositoryQueryIntegrationTests extends ClusterAwareIntegrationTests {
6560
66- @ Autowired CouchbaseClientFactory clientFactory ;
61+ @ Autowired
62+ CouchbaseClientFactory clientFactory ;
6763
68- @ Autowired ReactiveAirportRepository airportRepository ; // intellij flags "Could not Autowire", but it runs ok.
69- @ Autowired ReactiveUserRepository userRepository ; // intellij flags "Could not Autowire", but it runs ok.
64+ @ Autowired
65+ ReactiveAirportRepository airportRepository ; // intellij flags "Could not Autowire", but it runs ok.
66+ @ Autowired
67+ ReactiveUserRepository userRepository ; // intellij flags "Could not Autowire", but it runs ok.
7068
7169 @ BeforeEach
7270 void beforeEach () {
@@ -121,7 +119,7 @@ public void testCas() {
121119
122120 @ Test
123121 void count () {
124- String [] iatas = { "JFK" , "IAD" , "SFO" , "SJC" , "SEA" , "LAX" , "PHX" };
122+ String [] iatas = {"JFK" , "IAD" , "SFO" , "SJC" , "SEA" , "LAX" , "PHX" };
125123 Future [] future = new Future [iatas .length ];
126124 ExecutorService executorService = Executors .newFixedThreadPool (iatas .length );
127125 try {
@@ -131,7 +129,7 @@ void count() {
131129 airportRepository .save (airport ).block ();
132130 }
133131
134- Long airportCount = airportRepository .count ().block ();
132+ Long airportCount = airportCount = airportRepository .count ().block ();
135133 assertEquals (iatas .length , airportCount );
136134
137135 airportCount = airportRepository .countByIataIn ("JFK" , "IAD" , "SFO" ).block ();
@@ -156,23 +154,21 @@ void count() {
156154 }
157155
158156 @ Test
159- // DATACOUCH-650
157+ // DATACOUCH-650
160158 void deleteAllById () {
161159
162160 Airport vienna = new Airport ("airports::vie" , "vie" , "LOWW" );
163161 Airport frankfurt = new Airport ("airports::fra" , "fra" , "EDDF" );
164162 Airport losAngeles = new Airport ("airports::lax" , "lax" , "KLAX" );
165163
166164 try {
167- airportRepository .saveAll (asList (vienna , frankfurt , losAngeles )).as (StepVerifier ::create )
168- .expectNext (vienna , frankfurt , losAngeles ).verifyComplete ();
165+ airportRepository .saveAll (asList (vienna , frankfurt , losAngeles )).as (StepVerifier ::create ).verifyComplete ();
169166
170- airportRepository .deleteAllById (asList (vienna .getId (), losAngeles .getId ())).as (StepVerifier ::create )
171- .verifyComplete ();
167+ airportRepository .deleteAllById (asList (vienna .getId (), losAngeles .getId ())).as (StepVerifier ::create ).verifyComplete ();
172168
173169 airportRepository .findAll ().as (StepVerifier ::create ).expectNext (frankfurt ).verifyComplete ();
174170 } finally {
175- airportRepository .deleteAll (). block () ;
171+ airportRepository .deleteAll ();
176172 }
177173 }
178174
0 commit comments