Search in sources :

Example 16 with DistroKey

use of com.alibaba.nacos.core.distributed.distro.entity.DistroKey in project nacos by alibaba.

the class DistroConsistencyServiceImplTest method testPutWithoutListener.

@Test
public void testPutWithoutListener() throws NacosException {
    String key = KeyBuilder.buildInstanceListKey(TEST_NAMESPACE, TEST_SERVICE_NAME, true);
    distroConsistencyService.put(key, instances);
    verify(distroProtocol).sync(new DistroKey(key, KeyBuilder.INSTANCE_LIST_KEY_PREFIX), DataOperation.CHANGE, 1000L);
    verify(notifier, never()).addTask(key, DataOperation.CHANGE);
    verify(dataStore).put(eq(key), any(Datum.class));
}
Also used : Datum(com.alibaba.nacos.naming.consistency.Datum) DistroKey(com.alibaba.nacos.core.distributed.distro.entity.DistroKey) Test(org.junit.Test) BaseTest(com.alibaba.nacos.naming.BaseTest)

Aggregations

DistroKey (com.alibaba.nacos.core.distributed.distro.entity.DistroKey)16 DistroData (com.alibaba.nacos.core.distributed.distro.entity.DistroData)5 Datum (com.alibaba.nacos.naming.consistency.Datum)4 Client (com.alibaba.nacos.naming.core.v2.client.Client)4 DistroDelayTask (com.alibaba.nacos.core.distributed.distro.task.delay.DistroDelayTask)3 BaseTest (com.alibaba.nacos.naming.BaseTest)2 Serializer (com.alibaba.nacos.naming.cluster.transport.Serializer)2 UpgradeJudgement (com.alibaba.nacos.naming.core.v2.upgrade.UpgradeJudgement)2 LinkedList (java.util.LinkedList)2 Test (org.junit.Test)2 DistroSyncChangeTask (com.alibaba.nacos.core.distributed.distro.task.execute.DistroSyncChangeTask)1 DistroSyncDeleteTask (com.alibaba.nacos.core.distributed.distro.task.execute.DistroSyncDeleteTask)1 DistroDataResponse (com.alibaba.nacos.naming.cluster.remote.response.DistroDataResponse)1 ClientSyncData (com.alibaba.nacos.naming.core.v2.client.ClientSyncData)1 ClientSyncDatumSnapshot (com.alibaba.nacos.naming.core.v2.client.ClientSyncDatumSnapshot)1 ClientEvent (com.alibaba.nacos.naming.core.v2.event.client.ClientEvent)1 HashMap (java.util.HashMap)1