This is an automated email from the ASF dual-hosted git repository.

xiazcy pushed a commit to branch dotnet-http-interceptors
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git

commit 70de6bf9f5f476ebeb3f7579dcf07d3b5b2e196e
Author: Yang Xia <[email protected]>
AuthorDate: Tue Mar 17 15:29:46 2026 -0700

    fix auth tests
---
 .../Driver/AuthIntegrationTests.cs                           | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git 
a/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Driver/AuthIntegrationTests.cs
 
b/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Driver/AuthIntegrationTests.cs
index 802a9fb066..3b5c9eed07 100644
--- 
a/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Driver/AuthIntegrationTests.cs
+++ 
b/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Driver/AuthIntegrationTests.cs
@@ -27,7 +27,6 @@ using System.Threading.Tasks;
 using Gremlin.Net.Driver;
 using Gremlin.Net.Driver.Remote;
 using Gremlin.Net.Process.Traversal;
-using Gremlin.Net.Structure.IO.GraphBinary4;
 using Xunit;
 
 namespace Gremlin.Net.IntegrationTest.Driver
@@ -45,8 +44,7 @@ namespace Gremlin.Net.IntegrationTest.Driver
         {
             var gremlinServer = new GremlinServer(TestHost, TestSecurePort, 
enableSsl: true);
             return new GremlinClient(gremlinServer,
-                new GraphBinaryMessageSerializer(),
-                new ConnectionSettings { SkipCertificateValidation = true },
+                connectionSettings: new ConnectionSettings { 
SkipCertificateValidation = true },
                 interceptors: interceptors);
         }
 
@@ -82,11 +80,12 @@ namespace Gremlin.Net.IntegrationTest.Driver
             using var gremlinClient = CreateSecureClient(
                 new[] { Auth.BasicAuth("stephen", "wrongpassword") });
 
+            // The server returns auth errors as JSON (not GraphBinary), so 
Connection
+            // extracts the message and throws HttpRequestException.
             var ex = await Assert.ThrowsAsync<HttpRequestException>(
                 () => gremlinClient.SubmitAsync<long>("g.inject(1).count()"));
 
-            // Verify this is an HTTP 401 error, not a connection refused error
-            Assert.Contains("401", ex.Message);
+            Assert.Contains("incorrect", ex.Message, 
StringComparison.OrdinalIgnoreCase);
         }
 
         [Fact]
@@ -97,8 +96,7 @@ namespace Gremlin.Net.IntegrationTest.Driver
             var ex = await Assert.ThrowsAsync<HttpRequestException>(
                 () => gremlinClient.SubmitAsync<long>("g.inject(1).count()"));
 
-            // Verify this is an HTTP 401 error, not a connection refused error
-            Assert.Contains("401", ex.Message);
+            Assert.Contains("credentials", ex.Message, 
StringComparison.OrdinalIgnoreCase);
         }
     }
 }

Reply via email to