@@ -127,6 +127,9 @@ public class ReactiveInsertByIdOperationSupport implements ReactiveInsertByIdOpe
|
||||
if (this.expiry != null) {
|
||||
throw new IllegalArgumentException("withExpiry is not supported in a transaction");
|
||||
}
|
||||
if (this.durabilityLevel != null && this.durabilityLevel != DurabilityLevel.NONE) {
|
||||
throw new IllegalArgumentException("withDurability is not supported in a transaction");
|
||||
}
|
||||
if (this.options != null) {
|
||||
throw new IllegalArgumentException("withOptions is not supported in a transaction");
|
||||
}
|
||||
|
||||
@@ -134,6 +134,9 @@ public class ReactiveRemoveByIdOperationSupport implements ReactiveRemoveByIdOpe
|
||||
throw new IllegalArgumentException(
|
||||
"withDurability PersistTo and ReplicateTo overload is not supported in a transaction");
|
||||
}
|
||||
if (this.durabilityLevel != null && this.durabilityLevel != DurabilityLevel.NONE) {
|
||||
throw new IllegalArgumentException("withDurability is not supported in a transaction");
|
||||
}
|
||||
if (this.options != null) {
|
||||
throw new IllegalArgumentException("withOptions is not supported in a transaction");
|
||||
}
|
||||
|
||||
@@ -146,6 +146,9 @@ public class ReactiveReplaceByIdOperationSupport implements ReactiveReplaceByIdO
|
||||
if (this.expiry != null) {
|
||||
throw new IllegalArgumentException("withExpiry is not supported in a transaction");
|
||||
}
|
||||
if (this.durabilityLevel != null && this.durabilityLevel != DurabilityLevel.NONE) {
|
||||
throw new IllegalArgumentException("withDurability is not supported in a transaction");
|
||||
}
|
||||
if (this.options != null) {
|
||||
throw new IllegalArgumentException("withOptions is not supported in a transaction");
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Function;
|
||||
|
||||
import com.couchbase.client.core.msg.kv.DurabilityLevel;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.DisplayName;
|
||||
@@ -53,6 +54,7 @@ import com.couchbase.client.java.kv.ReplicateTo;
|
||||
* will be rejected at runtime.
|
||||
*
|
||||
* @author Graham Pople
|
||||
* @author Michael Reiche
|
||||
*/
|
||||
@IgnoreWhen(missesCapabilities = Capabilities.QUERY, clusterTypes = ClusterType.MOCKED)
|
||||
@SpringJUnitConfig(classes = { TransactionsConfig.class,
|
||||
@@ -103,6 +105,14 @@ public class CouchbaseTransactionalUnsettableParametersIntegrationTests extends
|
||||
});
|
||||
}
|
||||
|
||||
@DisplayName("Using insertById().withDurability(durabilityLevel) in a transaction is rejected at runtime")
|
||||
@Test
|
||||
public void insertWithDurability2() {
|
||||
test((ops) -> {
|
||||
ops.insertById(Person.class).withDurability(DurabilityLevel.MAJORITY).one(WalterWhite);
|
||||
});
|
||||
}
|
||||
|
||||
@DisplayName("Using insertById().withOptions in a transaction is rejected at runtime")
|
||||
@Test
|
||||
public void insertWithOptions() {
|
||||
@@ -127,6 +137,14 @@ public class CouchbaseTransactionalUnsettableParametersIntegrationTests extends
|
||||
});
|
||||
}
|
||||
|
||||
@DisplayName("Using replaceById().withDurability(durabilityLevel) in a transaction is rejected at runtime")
|
||||
@Test
|
||||
public void replaceWithDurability2() {
|
||||
test((ops) -> {
|
||||
ops.replaceById(Person.class).withDurability(DurabilityLevel.MAJORITY).one(WalterWhite);
|
||||
});
|
||||
}
|
||||
|
||||
@DisplayName("Using replaceById().withOptions in a transaction is rejected at runtime")
|
||||
@Test
|
||||
public void replaceWithOptions() {
|
||||
@@ -143,6 +161,14 @@ public class CouchbaseTransactionalUnsettableParametersIntegrationTests extends
|
||||
});
|
||||
}
|
||||
|
||||
@DisplayName("Using removeById().withDurability(durabilityLevel) in a transaction is rejected at runtime")
|
||||
@Test
|
||||
public void removeWithDurability2() {
|
||||
test((ops) -> {
|
||||
ops.removeById(Person.class).withDurability(DurabilityLevel.MAJORITY).oneEntity(WalterWhite);
|
||||
});
|
||||
}
|
||||
|
||||
@DisplayName("Using removeById().withOptions in a transaction is rejected at runtime")
|
||||
@Test
|
||||
public void removeWithOptions() {
|
||||
|
||||
Reference in New Issue
Block a user