Alonexc commented on code in PR #3691:
URL: https://github.com/apache/eventmesh/pull/3691#discussion_r1162226894
##########
eventmesh-examples/src/main/java/org/apache/eventmesh/tcp/common/EventMeshTestUtils.java:
##########
@@ -49,120 +52,101 @@ public class EventMeshTestUtils {
private static final String DEFAULT_TTL_MS = "30000";
+
+ private static UserAgent getUserAgent(Integer port, String subsystem1,
Integer pid){
+ return UserAgent.builder()
+ .env(UtilsConstants.ENV)
+ .host(UtilsConstants.HOST)
+ .password(generateRandomString(UtilsConstants.PASSWORD_LENGTH))
+ .username(UtilsConstants.USER_NAME)
+ .group(UtilsConstants.GROUP)
+ .path(UtilsConstants.PATH)
+ .port(port)
+ .subsystem(subsystem1)
+ .pid(pid)
+ .version(UtilsConstants.VERSION)
+ .idc(UtilsConstants.IDC)
+ .build();
+ }
+
+
// generate pub-client
- public static UserAgent generateClient1() {
- final UserAgent agent = UserAgent.builder()
- .env(UtilsConstants.ENV)
- .host(UtilsConstants.HOST)
- .password(generateRandomString(UtilsConstants.PASSWORD_LENGTH))
- .username(UtilsConstants.USER_NAME)
- .group(UtilsConstants.GROUP)
- .path(UtilsConstants.PATH)
- .port(UtilsConstants.PORT_1)
- .subsystem(UtilsConstants.SUB_SYSTEM_1)
- .pid(UtilsConstants.PID_1)
- .version(UtilsConstants.VERSION)
- .idc(UtilsConstants.IDC)
- .build();
+ public static UserAgent generateClient1() {
+ final UserAgent agent = getUserAgent(UtilsConstants.PORT_1,
UtilsConstants.SUB_SYSTEM_1, UtilsConstants.PID_1);
return MessageUtils.generatePubClient(agent);
}
// generate sub-client
public static UserAgent generateClient2() {
- final UserAgent agent = UserAgent.builder()
- .env(UtilsConstants.ENV)
- .host(UtilsConstants.HOST)
- .password(generateRandomString(UtilsConstants.PASSWORD_LENGTH))
- .username(UtilsConstants.USER_NAME)
- .group(UtilsConstants.GROUP)
- .path(UtilsConstants.PATH)
- .port(UtilsConstants.PORT_2)
- .subsystem(UtilsConstants.SUB_SYSTEM_2)
- .pid(UtilsConstants.PID_2)
- .version(UtilsConstants.VERSION)
- .idc(UtilsConstants.IDC)
- .build();
+ final UserAgent agent = getUserAgent(UtilsConstants.PORT_2,
UtilsConstants.SUB_SYSTEM_2, UtilsConstants.PID_2);
return MessageUtils.generateSubClient(agent);
}
- public static Package syncRR() {
+ private static Package getPackageMsg(Command requestToServer,
EventMeshMessage eventMeshMessage){
final Package msg = new Package();
- msg.setHeader(new Header(Command.REQUEST_TO_SERVER, 0, null,
generateRandomString(SEQ_LENGTH)));
- msg.setBody(generateSyncRRMqMsg());
+ msg.setHeader(new
Header(requestToServer,0,null,generateRandomString(SEQ_LENGTH)));
Review Comment:
Leave a space after the comma.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]