You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@eventmesh.apache.org by "devCod3r (via GitHub)" <gi...@apache.org> on 2023/04/07 12:52:43 UTC

[GitHub] [eventmesh] devCod3r opened a new pull request, #3659: Issue #3159: Modified response variable in RedirectClientByPathHandlerTest class

devCod3r opened a new pull request, #3659:
URL: https://github.com/apache/eventmesh/pull/3659

   Fixes #3159
   
   ### Motivation
   
   *Found a call to a method which will perform a byte to String (or String to byte) conversion, and will assume that the default platform encoding is suitable. This will cause the application behaviour to vary between platforms.*
   *Above issue is the reason why this change is introduced.*
   *Issue #3159*
   
   
   ### Modifications
   
   *Modified response variable of RedirectClientByPathHandlerTest class present in Line 127*
   *Earlier value of response variable used to be outputStream.toString()*
   *New value of response variable is outputStream.toString(StandardCharsets.UTF_8.name());*
   
   
   ### Documentation
   
   - Does this pull request introduce a new feature?
   - Ans: no
   - If a feature is not applicable for documentation, explain why?
   - Ans: Modified a variable in RedirectClientByPathHandlerTest class.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: dev-help@eventmesh.apache.org


[GitHub] [eventmesh] devCod3r commented on a diff in pull request #3659: Issue #3159: Modified response variable in RedirectClientByPathHandlerTest class

Posted by "devCod3r (via GitHub)" <gi...@apache.org>.
devCod3r commented on code in PR #3659:
URL: https://github.com/apache/eventmesh/pull/3659#discussion_r1161474700


##########
eventmesh-runtime/src/test/java/org/apache/eventmesh/runtime/admin/handler/RedirectClientByPathHandlerTest.java:
##########
@@ -124,7 +124,7 @@ public void testHandle() throws IOException {
                 clientMockedStatic.when(() -> EventMeshTcp2Client.redirectClient2NewEventMesh(any(), anyString(), anyInt(), any(),
                     any())).thenThrow(new RuntimeException());
                 redirectClientByPathHandler.handle(mockExchange);
-                String response = outputStream.toString();
+                String response = outputStream.toString(StandardCharsets.UTF_8.name());

Review Comment:
   Hi @mxsm / @Alonexc / @xwm1992 - Should I go ahead with the above mentioned changes as well?
   
   I.e. replacing StandardCharsets.UTF_8 with Constants.DEFAULT_CHARSET on line 107 and 117 along with the changes made for this issue on line 128 [RedirectClientByPathHandlerTest]



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: issues-help@eventmesh.apache.org


[GitHub] [eventmesh] devCod3r closed pull request #3659: Issue #3159: Modified response variable in RedirectClientByPathHandlerTest class

Posted by "devCod3r (via GitHub)" <gi...@apache.org>.
devCod3r closed pull request #3659: Issue #3159: Modified response variable in RedirectClientByPathHandlerTest class
URL: https://github.com/apache/eventmesh/pull/3659


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: dev-help@eventmesh.apache.org


[GitHub] [eventmesh] mxsm commented on a diff in pull request #3659: Issue #3159: Modified response variable in RedirectClientByPathHandlerTest class

Posted by "mxsm (via GitHub)" <gi...@apache.org>.
mxsm commented on code in PR #3659:
URL: https://github.com/apache/eventmesh/pull/3659#discussion_r1160772818


##########
eventmesh-runtime/src/test/java/org/apache/eventmesh/runtime/admin/handler/RedirectClientByPathHandlerTest.java:
##########
@@ -124,7 +124,7 @@ public void testHandle() throws IOException {
                 clientMockedStatic.when(() -> EventMeshTcp2Client.redirectClient2NewEventMesh(any(), anyString(), anyInt(), any(),
                     any())).thenThrow(new RuntimeException());
                 redirectClientByPathHandler.handle(mockExchange);
-                String response = outputStream.toString();
+                String response = outputStream.toString(StandardCharsets.UTF_8.name());

Review Comment:
   replace with Constants.DEFAULT_CHARSET



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: issues-help@eventmesh.apache.org


[GitHub] [eventmesh] devCod3r commented on a diff in pull request #3659: Issue #3159: Modified response variable in RedirectClientByPathHandlerTest class

Posted by "devCod3r (via GitHub)" <gi...@apache.org>.
devCod3r commented on code in PR #3659:
URL: https://github.com/apache/eventmesh/pull/3659#discussion_r1160815322


##########
eventmesh-runtime/src/test/java/org/apache/eventmesh/runtime/admin/handler/RedirectClientByPathHandlerTest.java:
##########
@@ -124,7 +124,7 @@ public void testHandle() throws IOException {
                 clientMockedStatic.when(() -> EventMeshTcp2Client.redirectClient2NewEventMesh(any(), anyString(), anyInt(), any(),
                     any())).thenThrow(new RuntimeException());
                 redirectClientByPathHandler.handle(mockExchange);
-                String response = outputStream.toString();
+                String response = outputStream.toString(StandardCharsets.UTF_8.name());

Review Comment:
   Hi @mxsm, In that case should I make the changes on Line 107 and 117 of the same file where the format is similar to the one I submitted for PR.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: issues-help@eventmesh.apache.org


[GitHub] [eventmesh] Alonexc commented on pull request #3659: Issue #3159: Modified response variable in RedirectClientByPathHandlerTest class

Posted by "Alonexc (via GitHub)" <gi...@apache.org>.
Alonexc commented on PR #3659:
URL: https://github.com/apache/eventmesh/pull/3659#issuecomment-1502560494

   This pr has duplicate fixes with pr #3665.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: issues-help@eventmesh.apache.org


[GitHub] [eventmesh] devCod3r commented on a diff in pull request #3659: Issue #3159: Modified response variable in RedirectClientByPathHandlerTest class

Posted by "devCod3r (via GitHub)" <gi...@apache.org>.
devCod3r commented on code in PR #3659:
URL: https://github.com/apache/eventmesh/pull/3659#discussion_r1161116180


##########
eventmesh-runtime/src/test/java/org/apache/eventmesh/runtime/admin/handler/RedirectClientByPathHandlerTest.java:
##########
@@ -124,7 +124,7 @@ public void testHandle() throws IOException {
                 clientMockedStatic.when(() -> EventMeshTcp2Client.redirectClient2NewEventMesh(any(), anyString(), anyInt(), any(),
                     any())).thenThrow(new RuntimeException());
                 redirectClientByPathHandler.handle(mockExchange);
-                String response = outputStream.toString();
+                String response = outputStream.toString(StandardCharsets.UTF_8.name());

Review Comment:
   ![image](https://user-images.githubusercontent.com/124816912/230725433-d1cff15f-eee9-40f8-a7ae-de08a7f43f1d.png)
   ![image](https://user-images.githubusercontent.com/124816912/230725478-382e249a-d587-4d62-b617-f9566e1820d3.png)
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: issues-help@eventmesh.apache.org