use of io.scalecube.services.ServiceInfo in project scalecube by scalecube.
the class ServiceInfoTest method test_service_info_one_tag.
@Test
public void test_service_info_one_tag() {
Map<String, String> tags = new HashMap<>();
ServiceInfo info = new ServiceInfo("service1", null, tags);
tags.put("key1", "value1");
String metadata = info.toMetadata();
ServiceInfo info2 = ServiceInfo.from(metadata);
assertTrue(info2.getServiceName().equals("service1"));
assertTrue(info2.getTags().get("key1").equals("value1"));
}
use of io.scalecube.services.ServiceInfo in project scalecube by scalecube.
the class ServiceInfoTest method test_service_info_one_tag_with_equals.
@Test
public void test_service_info_one_tag_with_equals() {
Map<String, String> tags = new HashMap<>();
ServiceInfo info = new ServiceInfo("service1", null, tags);
tags.put("key1", "value1=1");
String metadata = info.toMetadata();
ServiceInfo info2 = ServiceInfo.from(metadata);
assertTrue(info2.getServiceName().equals("service1"));
assertTrue(info2.getTags().get("key1").equals("value1=1"));
}
use of io.scalecube.services.ServiceInfo in project scalecube by scalecube.
the class ServiceInfoTest method test_service_info.
@Test
public void test_service_info() {
Map<String, String> tags = new HashMap<>();
tags.put("key1", "value1");
tags.put("key2", "value2");
ServiceInfo info = new ServiceInfo("service1", null, tags);
String metadata = info.toMetadata();
ServiceInfo info2 = ServiceInfo.from(metadata);
assertTrue(info2.getServiceName().equals("service1"));
assertTrue(info2.getTags().get("key1").equals("value1"));
assertTrue(info2.getTags().get("key2").equals("value2"));
}
use of io.scalecube.services.ServiceInfo in project scalecube by scalecube.
the class ServiceInfoTest method test_service_info_no_tags.
@Test
public void test_service_info_no_tags() {
Map<String, String> tags = new HashMap<>();
ServiceInfo info = new ServiceInfo("service1", null, tags);
String metadata = info.toMetadata();
ServiceInfo info2 = ServiceInfo.from(metadata);
assertTrue(info2.getServiceName().equals("service1"));
}
Aggregations