Search in sources :

Example 1 with PluginServiceInfoModelJson

use of org.killbill.billing.util.nodes.json.PluginServiceInfoModelJson in project killbill by killbill.

the class TestNodeInfoMapper method testNodeInfoSerialization.

@Test(groups = "fast")
public void testNodeInfoSerialization() throws Exception {
    final PluginServiceInfoModelJson svc = new PluginServiceInfoModelJson("typeName", "registrationName");
    final Set<PluginServiceInfoModelJson> services1 = new HashSet<PluginServiceInfoModelJson>();
    services1.add(svc);
    final List<PluginInfoModelJson> pluginInfos = new ArrayList<PluginInfoModelJson>();
    final PluginInfoModelJson info1 = new PluginInfoModelJson("sym1", "key1", "name1", "vers1", PluginState.STOPPED, true, services1);
    pluginInfos.add(info1);
    final NodeInfoModelJson input = new NodeInfoModelJson("nodeName", clock.getUTCNow(), clock.getUTCNow(), "1.0", "1.0", "1.0", "1.0", "1.0", pluginInfos);
    final String nodeInfoStr = nodeInfoMapper.serializeNodeInfo(input);
    final NodeInfoModelJson res = nodeInfoMapper.deserializeNodeInfo(nodeInfoStr);
    Assert.assertEquals(res, input);
}
Also used : NodeInfoModelJson(org.killbill.billing.util.nodes.json.NodeInfoModelJson) PluginInfoModelJson(org.killbill.billing.util.nodes.json.PluginInfoModelJson) ArrayList(java.util.ArrayList) PluginServiceInfoModelJson(org.killbill.billing.util.nodes.json.PluginServiceInfoModelJson) HashSet(java.util.HashSet) Test(org.testng.annotations.Test)

Aggregations

ArrayList (java.util.ArrayList)1 HashSet (java.util.HashSet)1 NodeInfoModelJson (org.killbill.billing.util.nodes.json.NodeInfoModelJson)1 PluginInfoModelJson (org.killbill.billing.util.nodes.json.PluginInfoModelJson)1 PluginServiceInfoModelJson (org.killbill.billing.util.nodes.json.PluginServiceInfoModelJson)1 Test (org.testng.annotations.Test)1