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

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


The following commit(s) were added to refs/heads/master-http by this push:
     new 97058fd887 Updated tests that depended on PARTIAL_CONTENT status CTR
97058fd887 is described below

commit 97058fd887ba1eba29e60b5131a5ef25125e961f
Author: Ken Hu <[email protected]>
AuthorDate: Wed Jun 12 21:42:15 2024 -0700

    Updated tests that depended on PARTIAL_CONTENT status CTR
    
    These tests needed updating because the PARTIAL_CONTENT status is not
    used for HTTP and was from the previous WebSocket subprotocol. For the
    newer HTTP handlers, there isn't a way to signal which ResponseMessage
    is the one that contains the actual error due to the addition of
    trailers at the end. So, the conditionals are slightly changed to look
    for error in any response.
---
 .../gremlin/server/GremlinServerIntegrateTest.java   | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git 
a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java
 
b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java
index 04b267c443..b798847504 100644
--- 
a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java
+++ 
b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java
@@ -509,8 +509,8 @@ public class GremlinServerIntegrateTest extends 
AbstractGremlinServerIntegration
             final CountDownLatch latch = new CountDownLatch(1);
             final AtomicBoolean pass = new AtomicBoolean(false);
             client.submit(request, result -> {
-                if (result.getStatus().getCode() != 
HttpResponseStatus.PARTIAL_CONTENT) {
-                    pass.set(HttpResponseStatus.BAD_REQUEST == 
result.getStatus().getCode());
+                if (HttpResponseStatus.BAD_REQUEST == 
result.getStatus().getCode()) {
+                    pass.set(true);
                     latch.countDown();
                 }
             });
@@ -528,8 +528,8 @@ public class GremlinServerIntegrateTest extends 
AbstractGremlinServerIntegration
             final CountDownLatch latch = new CountDownLatch(1);
             final AtomicBoolean pass = new AtomicBoolean(false);
             client.submit(request, result -> {
-                if (result.getStatus().getCode() != 
HttpResponseStatus.PARTIAL_CONTENT) {
-                    pass.set(HttpResponseStatus.BAD_REQUEST == 
result.getStatus().getCode());
+                if (HttpResponseStatus.BAD_REQUEST == 
result.getStatus().getCode()) {
+                    pass.set(true);
                     latch.countDown();
                 }
             });
@@ -551,8 +551,8 @@ public class GremlinServerIntegrateTest extends 
AbstractGremlinServerIntegration
             final CountDownLatch latch = new CountDownLatch(1);
             final AtomicBoolean pass = new AtomicBoolean(false);
             client.submit(request, result -> {
-                if (result.getStatus().getCode() != 
HttpResponseStatus.PARTIAL_CONTENT) {
-                    pass.set(HttpResponseStatus.BAD_REQUEST == 
result.getStatus().getCode());
+                if (HttpResponseStatus.BAD_REQUEST == 
result.getStatus().getCode()) {
+                    pass.set(true);
                     latch.countDown();
                 }
             });
@@ -570,8 +570,8 @@ public class GremlinServerIntegrateTest extends 
AbstractGremlinServerIntegration
             final CountDownLatch latch = new CountDownLatch(1);
             final AtomicBoolean pass = new AtomicBoolean(false);
             client.submit(request, result -> {
-                if (result.getStatus().getCode() != 
HttpResponseStatus.PARTIAL_CONTENT) {
-                    pass.set(HttpResponseStatus.OK == 
result.getStatus().getCode() && (((int) ((List) 
result.getResult().getData()).get(0) == 246)));
+                if (HttpResponseStatus.OK == result.getStatus().getCode()) {
+                    pass.set((((int) result.getResult().getData().get(0) == 
246)));
                     latch.countDown();
                 }
             });
@@ -592,8 +592,8 @@ public class GremlinServerIntegrateTest extends 
AbstractGremlinServerIntegration
             final CountDownLatch latch = new CountDownLatch(1);
             final AtomicBoolean pass = new AtomicBoolean(false);
             client.submit(request, result -> {
-                if (result.getStatus().getCode() != 
HttpResponseStatus.PARTIAL_CONTENT) {
-                    pass.set(HttpResponseStatus.BAD_REQUEST == 
result.getStatus().getCode());
+                if (HttpResponseStatus.BAD_REQUEST == 
result.getStatus().getCode()) {
+                    pass.set(true);
                     latch.countDown();
                 }
             });

Reply via email to