Search in sources :

Example 1 with ClientConfig

use of org.apache.rocketmq.client.ClientConfig in project rocketmq by apache.

the class LocalFileOffsetStoreTest method init.

@Before
public void init() {
    System.setProperty("rocketmq.client.localOffsetStoreDir", System.getProperty("java.io.tmpdir") + File.separator + ".rocketmq_offsets");
    String clientId = new ClientConfig().buildMQClientId() + "#TestNamespace" + System.currentTimeMillis();
    when(mQClientFactory.getClientId()).thenReturn(clientId);
}
Also used : ClientConfig(org.apache.rocketmq.client.ClientConfig) Before(org.junit.Before)

Example 2 with ClientConfig

use of org.apache.rocketmq.client.ClientConfig in project rocketmq by apache.

the class RemoteBrokerOffsetStoreTest method init.

@Before
public void init() {
    System.setProperty("rocketmq.client.localOffsetStoreDir", System.getProperty("java.io.tmpdir") + ".rocketmq_offsets");
    String clientId = new ClientConfig().buildMQClientId() + "#TestNamespace" + System.currentTimeMillis();
    when(mQClientFactory.getClientId()).thenReturn(clientId);
    when(mQClientFactory.findBrokerAddressInAdmin(brokerName)).thenReturn(new FindBrokerResult("127.0.0.1", false));
    when(mQClientFactory.getMQClientAPIImpl()).thenReturn(mqClientAPI);
}
Also used : ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) ClientConfig(org.apache.rocketmq.client.ClientConfig) FindBrokerResult(org.apache.rocketmq.client.impl.FindBrokerResult) Before(org.junit.Before)

Example 3 with ClientConfig

use of org.apache.rocketmq.client.ClientConfig in project rocketmq-rocketmq-all-4.1.0-incubating by lirenzuo.

the class LocalFileOffsetStoreTest method init.

@Before
public void init() {
    System.setProperty("rocketmq.client.localOffsetStoreDir", System.getProperty("java.io.tmpdir") + File.separator + ".rocketmq_offsets");
    String clientId = new ClientConfig().buildMQClientId() + "#TestNamespace" + System.currentTimeMillis();
    when(mQClientFactory.getClientId()).thenReturn(clientId);
}
Also used : ClientConfig(org.apache.rocketmq.client.ClientConfig) Before(org.junit.Before)

Example 4 with ClientConfig

use of org.apache.rocketmq.client.ClientConfig in project rocketmq-rocketmq-all-4.1.0-incubating by lirenzuo.

the class RemoteBrokerOffsetStoreTest method init.

@Before
public void init() {
    System.setProperty("rocketmq.client.localOffsetStoreDir", System.getProperty("java.io.tmpdir") + ".rocketmq_offsets");
    String clientId = new ClientConfig().buildMQClientId() + "#TestNamespace" + System.currentTimeMillis();
    when(mQClientFactory.getClientId()).thenReturn(clientId);
    when(mQClientFactory.findBrokerAddressInAdmin(brokerName)).thenReturn(new FindBrokerResult("127.0.0.1", false));
    when(mQClientFactory.getMQClientAPIImpl()).thenReturn(mqClientAPI);
}
Also used : ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) ClientConfig(org.apache.rocketmq.client.ClientConfig) FindBrokerResult(org.apache.rocketmq.client.impl.FindBrokerResult) Before(org.junit.Before)

Aggregations

ClientConfig (org.apache.rocketmq.client.ClientConfig)4 Before (org.junit.Before)4 FindBrokerResult (org.apache.rocketmq.client.impl.FindBrokerResult)2 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)2