23
23
import java .util .function .Consumer ;
24
24
import java .util .function .Function ;
25
25
26
+ import com .couchbase .client .core .msg .kv .DurabilityLevel ;
26
27
import org .junit .jupiter .api .BeforeAll ;
27
28
import org .junit .jupiter .api .BeforeEach ;
28
29
import org .junit .jupiter .api .DisplayName ;
53
54
* will be rejected at runtime.
54
55
*
55
56
* @author Graham Pople
57
+ * @author Michael Reiche
56
58
*/
57
59
@ IgnoreWhen (missesCapabilities = Capabilities .QUERY , clusterTypes = ClusterType .MOCKED )
58
60
@ SpringJUnitConfig (classes = { TransactionsConfig .class ,
@@ -103,6 +105,14 @@ public void insertWithExpiry() {
103
105
});
104
106
}
105
107
108
+ @ DisplayName ("Using insertById().withDurability(durabilityLevel) in a transaction is rejected at runtime" )
109
+ @ Test
110
+ public void insertWithDurability2 () {
111
+ test ((ops ) -> {
112
+ ops .insertById (Person .class ).withDurability (DurabilityLevel .MAJORITY ).one (WalterWhite );
113
+ });
114
+ }
115
+
106
116
@ DisplayName ("Using insertById().withOptions in a transaction is rejected at runtime" )
107
117
@ Test
108
118
public void insertWithOptions () {
@@ -127,6 +137,14 @@ public void replaceWithExpiry() {
127
137
});
128
138
}
129
139
140
+ @ DisplayName ("Using replaceById().withDurability(durabilityLevel) in a transaction is rejected at runtime" )
141
+ @ Test
142
+ public void replaceWithDurability2 () {
143
+ test ((ops ) -> {
144
+ ops .replaceById (Person .class ).withDurability (DurabilityLevel .MAJORITY ).one (WalterWhite );
145
+ });
146
+ }
147
+
130
148
@ DisplayName ("Using replaceById().withOptions in a transaction is rejected at runtime" )
131
149
@ Test
132
150
public void replaceWithOptions () {
@@ -143,6 +161,14 @@ public void removeWithDurability() {
143
161
});
144
162
}
145
163
164
+ @ DisplayName ("Using removeById().withDurability(durabilityLevel) in a transaction is rejected at runtime" )
165
+ @ Test
166
+ public void removeWithDurability2 () {
167
+ test ((ops ) -> {
168
+ ops .removeById (Person .class ).withDurability (DurabilityLevel .MAJORITY ).oneEntity (WalterWhite );
169
+ });
170
+ }
171
+
146
172
@ DisplayName ("Using removeById().withOptions in a transaction is rejected at runtime" )
147
173
@ Test
148
174
public void removeWithOptions () {
0 commit comments