Skip to content

Commit 632dc32

Browse files
authored
[ISSUE #9650] Unified FAQ related URLs (#9651)
* [ISSUE #9650] Unified FAQ related URLs * Update * Update
1 parent 1c23a80 commit 632dc32

2 files changed

Lines changed: 57 additions & 13 deletions

File tree

common/src/main/java/org/apache/rocketmq/common/help/FAQUrl.java

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,32 +18,34 @@
1818

1919
public class FAQUrl {
2020

21-
public static final String APPLY_TOPIC_URL = "https://rocketmq.apache.org/docs/bestPractice/06FAQ";
21+
public static final String DEFAULT_FAQ_URL = "https://rocketmq.apache.org/docs/bestPractice/06FAQ";
2222

23-
public static final String NAME_SERVER_ADDR_NOT_EXIST_URL = "https://rocketmq.apache.org/docs/bestPractice/06FAQ";
23+
public static final String APPLY_TOPIC_URL = DEFAULT_FAQ_URL;
2424

25-
public static final String GROUP_NAME_DUPLICATE_URL = "https://rocketmq.apache.org/docs/bestPractice/06FAQ";
25+
public static final String NAME_SERVER_ADDR_NOT_EXIST_URL = DEFAULT_FAQ_URL;
2626

27-
public static final String CLIENT_PARAMETER_CHECK_URL = "https://rocketmq.apache.org/docs/bestPractice/06FAQ";
27+
public static final String GROUP_NAME_DUPLICATE_URL = DEFAULT_FAQ_URL;
2828

29-
public static final String SUBSCRIPTION_GROUP_NOT_EXIST = "https://rocketmq.apache.org/docs/bestPractice/06FAQ";
29+
public static final String CLIENT_PARAMETER_CHECK_URL = DEFAULT_FAQ_URL;
3030

31-
public static final String CLIENT_SERVICE_NOT_OK = "https://rocketmq.apache.org/docs/bestPractice/06FAQ";
31+
public static final String SUBSCRIPTION_GROUP_NOT_EXIST = DEFAULT_FAQ_URL;
32+
33+
public static final String CLIENT_SERVICE_NOT_OK = DEFAULT_FAQ_URL;
3234

3335
// FAQ: No route info of this topic, TopicABC
34-
public static final String NO_TOPIC_ROUTE_INFO = "https://rocketmq.apache.org/docs/bestPractice/06FAQ";
36+
public static final String NO_TOPIC_ROUTE_INFO = DEFAULT_FAQ_URL;
3537

36-
public static final String LOAD_JSON_EXCEPTION = "https://rocketmq.apache.org/docs/bestPractice/06FAQ";
38+
public static final String LOAD_JSON_EXCEPTION = DEFAULT_FAQ_URL;
3739

38-
public static final String SAME_GROUP_DIFFERENT_TOPIC = "https://rocketmq.apache.org/docs/bestPractice/06FAQ";
40+
public static final String SAME_GROUP_DIFFERENT_TOPIC = DEFAULT_FAQ_URL;
3941

40-
public static final String MQLIST_NOT_EXIST = "https://rocketmq.apache.org/docs/bestPractice/06FAQ";
42+
public static final String MQLIST_NOT_EXIST = DEFAULT_FAQ_URL;
4143

42-
public static final String UNEXPECTED_EXCEPTION_URL = "https://rocketmq.apache.org/docs/bestPractice/06FAQ";
44+
public static final String UNEXPECTED_EXCEPTION_URL = DEFAULT_FAQ_URL;
4345

44-
public static final String SEND_MSG_FAILED = "https://rocketmq.apache.org/docs/bestPractice/06FAQ";
46+
public static final String SEND_MSG_FAILED = DEFAULT_FAQ_URL;
4547

46-
public static final String UNKNOWN_HOST_EXCEPTION = "https://rocketmq.apache.org/docs/bestPractice/06FAQ";
48+
public static final String UNKNOWN_HOST_EXCEPTION = DEFAULT_FAQ_URL;
4749

4850
private static final String TIP_STRING_BEGIN = "\nSee ";
4951
private static final String TIP_STRING_END = " for further details.";
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one or more
3+
* contributor license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright ownership.
5+
* The ASF licenses this file to You under the Apache License, Version 2.0
6+
* (the "License"); you may not use this file except in compliance with
7+
* the License. You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
package org.apache.rocketmq.common.help;
19+
20+
import org.junit.Test;
21+
22+
import static org.junit.Assert.assertEquals;
23+
24+
public class FAQUrlTest {
25+
26+
@Test
27+
public void testSuggestTodo() {
28+
String expected = "\nSee " + FAQUrl.DEFAULT_FAQ_URL + " for further details.";
29+
String actual = FAQUrl.suggestTodo(FAQUrl.DEFAULT_FAQ_URL);
30+
assertEquals(expected, actual);
31+
}
32+
33+
@Test
34+
public void testAttachDefaultURL() {
35+
String errorMsg = "errorMsg";
36+
String expected = errorMsg
37+
+ "\nFor more information, please visit the url, "
38+
+ FAQUrl.UNEXPECTED_EXCEPTION_URL;
39+
String actual = FAQUrl.attachDefaultURL(errorMsg);
40+
assertEquals(expected, actual);
41+
}
42+
}

0 commit comments

Comments
 (0)