@@ -24,7 +24,8 @@ public class CollectionHandleDefaultsTest {
2424 /** All defaults are {@code null} if none were set. */
2525 @ Test
2626 public void test_defaults () {
27- Assertions .assertThat (HANDLE_NONE .consistencyLevel ()).isNull ();
27+ Assertions .assertThat (HANDLE_NONE .consistencyLevel ()).as ("default ConsistencyLevel" ).isNull ();
28+ Assertions .assertThat (HANDLE_NONE .tenant ()).as ("default tenant" ).isNull ();
2829 }
2930
3031 /**
@@ -39,7 +40,7 @@ public void test_withConsistencyLevel() {
3940 }
4041
4142 /**
42- * {@link CollectionHandleAsync#withConsistencyLevel } should create a copy with
43+ * {@link CollectionHandleAsync#withTenant } should create a copy with
4344 * different defaults but not modify the original.
4445 */
4546 @ Test
@@ -48,4 +49,26 @@ public void test_withConsistencyLevel_async() {
4849 Assertions .assertThat (handle .consistencyLevel ()).isEqualTo (ConsistencyLevel .QUORUM );
4950 Assertions .assertThat (HANDLE_NONE_ASYNC .consistencyLevel ()).isNull ();
5051 }
52+
53+ /**
54+ * {@link CollectionHandle#withTenant} should create a copy with
55+ * different defaults but not modify the original.
56+ */
57+ @ Test
58+ public void test_withTenant () {
59+ var handle = HANDLE_NONE .withTenant ("john_doe" );
60+ Assertions .assertThat (handle .tenant ()).isEqualTo ("john_doe" );
61+ Assertions .assertThat (HANDLE_NONE .consistencyLevel ()).isNull ();
62+ }
63+
64+ /**
65+ * {@link CollectionHandleAsync#withTenant} should create a copy with
66+ * different defaults but not modify the original.
67+ */
68+ @ Test
69+ public void test_withTenant_async () {
70+ var handle = HANDLE_NONE_ASYNC .withTenant ("john_doe" );
71+ Assertions .assertThat (handle .tenant ()).isEqualTo ("john_doe" );
72+ Assertions .assertThat (HANDLE_NONE_ASYNC .consistencyLevel ()).isNull ();
73+ }
5174}
0 commit comments