Skip to content

Commit 902dd9f

Browse files
committed
RDBC-959: test enable by version annotation
1 parent 36b9414 commit 902dd9f

File tree

8 files changed

+157
-162
lines changed

8 files changed

+157
-162
lines changed

src/test/java/net/ravendb/client/documents/operations/ConnectionStringsTest.java

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import net.ravendb.client.documents.operations.etl.queue.QueueConnectionString;
1717
import net.ravendb.client.documents.operations.etl.queue.RabbitMqConnectionSettings;
1818
import net.ravendb.client.documents.operations.etl.sql.SqlConnectionString;
19+
import net.ravendb.client.infrastructure.EnableOnServer;
1920
import net.ravendb.client.serverwide.ConnectionStringType;
2021
import net.ravendb.client.documents.operations.etl.RavenConnectionString;
2122
import org.junit.jupiter.api.Test;
@@ -25,6 +26,7 @@
2526

2627
public class ConnectionStringsTest extends RemoteTestBase {
2728

29+
@EnableOnServer(thresholdVersion = "7.1")
2830
@Test
2931
public void canCreateGetAndDeleteOpenAiConnectionString() throws Exception {
3032
try (IDocumentStore store = getDocumentStore()) {
@@ -73,6 +75,7 @@ public void canCreateGetAndDeleteOpenAiConnectionString() throws Exception {
7375
}
7476
}
7577

78+
@EnableOnServer(thresholdVersion = "7.1")
7679
@Test
7780
public void canCreateAzureOpenAiConnectionString() {
7881
try (IDocumentStore store = getDocumentStore()) {
@@ -110,6 +113,7 @@ public void canCreateAzureOpenAiConnectionString() {
110113
}
111114
}
112115

116+
@EnableOnServer(thresholdVersion = "7.1")
113117
@Test
114118
public void canCreateOllamaConnectionString() {
115119
try (IDocumentStore store = getDocumentStore()) {
@@ -148,6 +152,7 @@ public void canCreateOllamaConnectionString() {
148152
}
149153
}
150154

155+
@EnableOnServer(thresholdVersion = "7.1")
151156
@Test
152157
public void canCreateGoogleConnectionString() {
153158
try (IDocumentStore store = getDocumentStore()) {
@@ -185,6 +190,7 @@ public void canCreateGoogleConnectionString() {
185190
}
186191
}
187192

193+
@EnableOnServer(thresholdVersion = "7.1")
188194
@Test
189195
public void canCreateHuggingFaceConnectionString() {
190196
try (IDocumentStore store = getDocumentStore()) {
@@ -219,6 +225,7 @@ public void canCreateHuggingFaceConnectionString() {
219225
}
220226
}
221227

228+
@EnableOnServer(thresholdVersion = "7.1")
222229
@Test
223230
public void canCreateMistralAiConnectionString() {
224231
try (IDocumentStore store = getDocumentStore()) {
@@ -252,6 +259,7 @@ public void canCreateMistralAiConnectionString() {
252259
}
253260
}
254261

262+
@EnableOnServer(thresholdVersion = "7.1")
255263
@Test
256264
public void canCreateVertexConnectionString() {
257265
try (IDocumentStore store = getDocumentStore()) {
@@ -298,6 +306,7 @@ public void canCreateVertexConnectionString() {
298306
}
299307
}
300308

309+
@EnableOnServer(thresholdVersion = "7.1")
301310
@Test
302311
public void canGetMultipleAiConnectionStrings() {
303312
try (IDocumentStore store = getDocumentStore()) {
@@ -334,6 +343,7 @@ public void canGetMultipleAiConnectionStrings() {
334343
}
335344
}
336345

346+
@EnableOnServer(thresholdVersion = "7.1")
337347
@Test
338348
public void canGetSpecificAiConnectionString() {
339349
try (IDocumentStore store = getDocumentStore()) {
@@ -359,6 +369,7 @@ public void canGetSpecificAiConnectionString() {
359369
}
360370
}
361371

372+
@EnableOnServer(thresholdVersion = "7.1")
362373
@Test
363374
public void validationFailsWhenNoProviderConfigured() {
364375
AiConnectionString aiConnectionString = new AiConnectionString();
@@ -370,6 +381,7 @@ public void validationFailsWhenNoProviderConfigured() {
370381
assertThat(errors.get(0)).contains("At least one of the following settings must be set");
371382
}
372383

384+
@EnableOnServer(thresholdVersion = "7.1")
373385
@Test
374386
public void validationFailsWhenMultipleProvidersConfigured() {
375387
OpenAiSettings openAiSettings = new OpenAiSettings();
@@ -392,6 +404,7 @@ public void validationFailsWhenMultipleProvidersConfigured() {
392404
assertThat(errors.get(0)).contains("Only one of the following settings can be set");
393405
}
394406

407+
@EnableOnServer(thresholdVersion = "7.1")
395408
@Test
396409
public void validationFailsWhenRequiredFieldsMissing() {
397410
OpenAiSettings openAiSettings = new OpenAiSettings();
@@ -411,6 +424,7 @@ public void validationFailsWhenRequiredFieldsMissing() {
411424
assertThat(errors.stream().anyMatch(e -> e.contains("model"))).isTrue();
412425
}
413426

427+
@EnableOnServer(thresholdVersion = "7.1")
414428
@Test
415429
public void getActiveProviderReturnsCorrectType() {
416430
OpenAiSettings openAiSettings = new OpenAiSettings();
@@ -444,6 +458,7 @@ public void getActiveProviderReturnsCorrectType() {
444458
assertThat(cs4.getActiveProvider()).isEqualTo(AiConnectorType.None);
445459
}
446460

461+
@EnableOnServer(thresholdVersion = "7.1")
447462
@Test
448463
public void compareDetectsModelChanges() {
449464
OpenAiSettings settings1 = new OpenAiSettings();
@@ -467,6 +482,7 @@ public void compareDetectsModelChanges() {
467482
assertThat(AiSettingsCompareDifferences.fromValue(diff)).isEqualTo(AiSettingsCompareDifferences.ModelArchitecture).isNotEqualTo(0);
468483
}
469484

485+
@EnableOnServer(thresholdVersion = "7.1")
470486
@Test
471487
public void compareDetectsEndpointChanges() {
472488
OpenAiSettings settings1 = new OpenAiSettings();
@@ -491,6 +507,7 @@ public void compareDetectsEndpointChanges() {
491507
.isNotEqualTo(0);
492508
}
493509

510+
@EnableOnServer(thresholdVersion = "7.1")
494511
@Test
495512
public void compareDetectsAuthenticationChanges() {
496513
OpenAiSettings settings1 = new OpenAiSettings();
@@ -515,6 +532,7 @@ public void compareDetectsAuthenticationChanges() {
515532
.isNotEqualTo(0);
516533
}
517534

535+
@EnableOnServer(thresholdVersion = "7.1")
518536
@Test
519537
public void compareDetectsProviderChange() {
520538
OpenAiSettings openAiSettings = new OpenAiSettings();
@@ -538,6 +556,7 @@ public void compareDetectsProviderChange() {
538556
assertThat(diff).isEqualTo(AiSettingsCompareDifferences.All.getValue());
539557
}
540558

559+
@EnableOnServer(thresholdVersion = "7.1")
541560
@Test
542561
public void compareReturnsNoneWhenIdentical() {
543562
OpenAiSettings settings1 = new OpenAiSettings();
@@ -565,6 +584,7 @@ public void compareReturnsNoneWhenIdentical() {
565584
assertThat(diff).isEqualTo(AiSettingsCompareDifferences.None.getValue());
566585
}
567586

587+
@EnableOnServer(thresholdVersion = "7.1")
568588
@Test
569589
public void isEqualReturnsTrueForIdenticalConnectionStrings() {
570590
OpenAiSettings settings1 = new OpenAiSettings();
@@ -592,6 +612,7 @@ public void isEqualReturnsTrueForIdenticalConnectionStrings() {
592612
assertThat(cs1.isEqual(cs2)).isTrue();
593613
}
594614

615+
@EnableOnServer(thresholdVersion = "7.1")
595616
@Test
596617
public void isEqualReturnsFalseForDifferentNames() {
597618
OpenAiSettings settings1 = new OpenAiSettings();
@@ -615,6 +636,7 @@ public void isEqualReturnsFalseForDifferentNames() {
615636
assertThat(cs1.isEqual(cs2)).isFalse();
616637
}
617638

639+
@EnableOnServer(thresholdVersion = "7.1")
618640
@Test
619641
public void usingEncryptedCommunicationChannelDetectsHttps() {
620642
OpenAiSettings openAiSettings = new OpenAiSettings();
@@ -643,6 +665,7 @@ public void usingEncryptedCommunicationChannelDetectsHttps() {
643665
assertThat(cs3.usingEncryptedCommunicationChannel()).isTrue();
644666
}
645667

668+
@EnableOnServer(thresholdVersion = "7.1")
646669
@Test
647670
public void getQueryEmbeddingsMaxConcurrentBatchesUsesProviderValue() {
648671
OpenAiSettings settings = new OpenAiSettings();
@@ -657,6 +680,7 @@ public void getQueryEmbeddingsMaxConcurrentBatchesUsesProviderValue() {
657680
assertThat(cs.getQueryEmbeddingsMaxConcurrentBatches(10)).isEqualTo(5);
658681
}
659682

683+
@EnableOnServer(thresholdVersion = "7.1")
660684
@Test
661685
public void getQueryEmbeddingsMaxConcurrentBatchesUsesGlobalValueWhenNotSet() {
662686
OpenAiSettings settings = new OpenAiSettings();
@@ -670,6 +694,7 @@ public void getQueryEmbeddingsMaxConcurrentBatchesUsesGlobalValueWhenNotSet() {
670694
assertThat(cs.getQueryEmbeddingsMaxConcurrentBatches(fallbackValue)).isEqualTo(10);
671695
}
672696

697+
@EnableOnServer(thresholdVersion = "7.1")
673698
@Test
674699
public void temperatureParameterSerializedCorrectly() {
675700
try (IDocumentStore store = getDocumentStore()) {
@@ -693,6 +718,7 @@ public void temperatureParameterSerializedCorrectly() {
693718
}
694719
}
695720

721+
@EnableOnServer(thresholdVersion = "7.1")
696722
@Test
697723
public void vertexSettingsCanExtractProjectId() {
698724
String credentialsJson = "{"
@@ -711,6 +737,7 @@ public void vertexSettingsCanExtractProjectId() {
711737
assertThat(settings.getProjectId()).isEqualTo("my-test-project");
712738
}
713739

740+
@EnableOnServer(thresholdVersion = "7.1")
714741
@Test
715742
public void vertexSettingsThrowsWhenProjectIdMissing() {
716743
String credentialsJson = "{"

0 commit comments

Comments
 (0)