package com.alibaba.nacos.naming.pojo;

import org.junit.Test;

import java.util.ArrayList;
import java.util.List;

/**
 * @author Nicholas
 */
public class SubscriberTest {

    @Test
    public void subscriberBeanTest() {
        Subscriber subscriber = new Subscriber("127.0.0.1:8080", "agent", "app", "127.0.0.1", "public", "test");
        subscriber.setAddrStr("127.0.0.1:8080");
        subscriber.setIp("127.0.0.1");
        subscriber.setApp("app");
        subscriber.setAgent("agent");
        subscriber.setNamespaceId("public");
        subscriber.setServiceName("test");

        subscriber.getAddrStr();
        subscriber.getIp();
        subscriber.getAgent();
        subscriber.getApp();
        subscriber.getNamespaceId();
        subscriber.getServiceName();

        Subscribers subscribers = new Subscribers();
        List<Subscriber> subscriberList = new ArrayList<>();
        subscriberList.add(subscriber);
        subscribers.setSubscribers(subscriberList);
        subscribers.getSubscribers();
    }
}

@@ -33,16 +33,41 @@
 .pojo;%0A%0A
+import org.junit.Assert;%0A
 import o
@@ -1039,21 +1039,575 @@
 bscribers();
+%0A%0A        Assert.assertNotNull(subscriberList);%0A        Assert.assertEquals(1, subscriberList.size());%0A        Assert.assertEquals(%22127.0.0.1:8080%22, subscriberList.get(0).getAddrStr());%0A        Assert.assertEquals(%22127.0.0.1%22, subscriberList.get(0).getIp());%0A        Assert.assertEquals(%22app%22, subscriberList.get(0).getApp());%0A        Assert.assertEquals(%22agent%22, subscriberList.get(0).getAgent());%0A        Assert.assertEquals(%22public%22, subscriberList.get(0).getNamespaceId());%0A        Assert.assertEquals(%22test%22, subscriberList.get(0).getServiceName());
 %0A    %7D%0A%7D%0A

add assert