File tree 3 files changed +11
-1
lines changed
spring-data-mongodb/src/test/java/org/springframework/data/mongodb
3 files changed +11
-1
lines changed Original file line number Diff line number Diff line change 23
23
import java .util .List ;
24
24
25
25
import org .junit .Before ;
26
+ import org .junit .ClassRule ;
26
27
import org .junit .Ignore ;
27
28
import org .junit .Test ;
28
29
import org .springframework .data .annotation .Id ;
36
37
import org .springframework .data .mongodb .core .query .Criteria ;
37
38
import org .springframework .data .mongodb .core .query .Query ;
38
39
import org .springframework .data .mongodb .test .util .MongoTestUtils ;
40
+ import org .springframework .data .mongodb .test .util .MongoVersionRule ;
39
41
40
42
import com .mongodb .MongoClient ;
41
43
import com .mongodb .client .MongoCollection ;
45
47
*/
46
48
public class MongoTemplateUpdateTests {
47
49
50
+ public static @ ClassRule MongoVersionRule REQUIRES_AT_LEAST_4_2 = MongoVersionRule .REQUIRES_4_2 ;
51
+
48
52
static final String DB_NAME = "update-test" ;
49
53
50
54
MongoClient client ;
Original file line number Diff line number Diff line change 26
26
import java .util .List ;
27
27
28
28
import org .junit .Before ;
29
+ import org .junit .ClassRule ;
29
30
import org .junit .Ignore ;
30
31
import org .junit .Test ;
31
32
import org .springframework .data .annotation .Id ;
39
40
import org .springframework .data .mongodb .core .query .Criteria ;
40
41
import org .springframework .data .mongodb .core .query .Query ;
41
42
import org .springframework .data .mongodb .test .util .MongoTestUtils ;
43
+ import org .springframework .data .mongodb .test .util .MongoVersionRule ;
42
44
43
45
import com .mongodb .reactivestreams .client .MongoClient ;
44
46
import com .mongodb .reactivestreams .client .MongoCollection ;
48
50
*/
49
51
public class ReactiveMongoTemplateUpdateTests {
50
52
53
+ public static @ ClassRule MongoVersionRule REQUIRES_AT_LEAST_4_2 = MongoVersionRule .REQUIRES_4_2 ;
54
+
51
55
static final String DB_NAME = "reactive-update-test" ;
52
56
53
57
MongoClient client ;
Original file line number Diff line number Diff line change @@ -45,6 +45,9 @@ public class MongoVersionRule implements TestRule {
45
45
private static final Version DEFAULT_HIGH = ANY ;
46
46
private static final Version DEFAULT_LOW = new Version (0 , 0 , 0 );
47
47
48
+ public static MongoVersionRule REQUIRES_4_2 = MongoVersionRule
49
+ .atLeast (org .springframework .data .util .Version .parse ("4.2" ));
50
+
48
51
private final AtomicReference <Version > currentVersion = new AtomicReference <>(null );
49
52
private final Version minVersion ;
50
53
private final Version maxVersion ;
@@ -128,7 +131,6 @@ public void evaluate() throws Throwable {
128
131
Version maxVersion = MongoVersionRule .this .maxVersion .equals (ANY ) ? DEFAULT_HIGH
129
132
: MongoVersionRule .this .maxVersion ;
130
133
131
-
132
134
if (description .getAnnotation (MongoVersion .class ) != null ) {
133
135
MongoVersion version = description .getAnnotation (MongoVersion .class );
134
136
if (version != null ) {
You can’t perform that action at this time.
0 commit comments