Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Added some new tests#9823

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
TheRealHaui wants to merge1 commit intoapache:develop
base:develop
Choose a base branch
Loading
fromTheRealHaui:add-some-tests
Open
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -40,6 +40,7 @@
import org.junit.Test;

import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.mockito.ArgumentMatchers.anyLong;
import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.Mockito.mock;
Expand DownExpand Up@@ -101,6 +102,34 @@ public void testFetchMasterAddrByClusterName() throws InterruptedException, MQBr
assertThat(result.size()).isEqualTo(0);
}

@Test
public void testFetchMasterAndSlaveAddrByClusterName() throws InterruptedException, MQBrokerException, RemotingTimeoutException, RemotingSendRequestException, RemotingConnectException {
Set<String> result = CommandUtil.fetchMasterAndSlaveAddrByClusterName(defaultMQAdminExtImpl, "default-cluster");
assertThat(result.size()).isEqualTo(1);
assertThat(result.iterator().next()).isEqualTo("127.0.0.1:10911");
}

@Test
public void testFetchMasterAddrByBrokerNameThrowsException() {
assertThatThrownBy( () -> {
CommandUtil.fetchMasterAddrByBrokerName(defaultMQAdminExtImpl, "default-cluster");
})
.isInstanceOf(Exception.class)
.hasMessageContaining("No broker address for broker name");
}

@Test
public void testFetchMasterAndSlaveAddrByBrokerName() throws InterruptedException, MQBrokerException, RemotingTimeoutException, RemotingSendRequestException, RemotingConnectException {
Set<String> result = CommandUtil.fetchMasterAndSlaveAddrByBrokerName(defaultMQAdminExtImpl, "default-cluster");
assertThat(result.size()).isEqualTo(0);
}

@Test
public void testFetchBrokerNameByAddr() throws Exception {
String result = CommandUtil.fetchBrokerNameByAddr(defaultMQAdminExtImpl, "127.0.0.1:10911");
assertThat(result).isEqualTo("default-broker");
}

@Test
public void testFetchBrokerNameByClusterName() throws Exception {
Set<String> result = CommandUtil.fetchBrokerNameByClusterName(defaultMQAdminExtImpl, "default-cluster");
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp