@Test
public void testAddWorkerModule() {
NetworkConfig network = new DefaultNetworkConfig("test");
assertEquals("test", network.getName());
ModuleConfig module1 = network.addModule("module1", "com.test~test-module~1.0");
assertEquals("module1", module1.getName());
assertTrue(module1.getType().equals(ComponentConfig.Type.MODULE));
assertEquals("com.test~test-module~1.0", module1.getModule());
assertEquals(new JsonObject(), module1.getConfig());
assertEquals(1, module1.getInstances());
ModuleConfig module2 = network.addModule("module2", "com.test~test-module~2.0", new JsonObject().putString("foo", "bar"));
assertEquals("module2", module2.getName());
assertTrue(module2.getType().equals(ComponentConfig.Type.MODULE));
assertEquals("com.test~test-module~2.0", module2.getModule());
assertEquals("bar", module2.getConfig().getString("foo"));
assertEquals(1, module2.getInstances());
ModuleConfig module3 = network.addModule("module3", "com.test~test-module~3.0", 2);
assertEquals("module3", module3.getName());
assertTrue(module3.getType().equals(ComponentConfig.Type.MODULE));
assertEquals("com.test~test-module~3.0", module3.getModule());
assertEquals(new JsonObject(), module3.getConfig());
assertEquals(2, module3.getInstances());
ModuleConfig module4 = network.addModule("module4", "com.test~test-module~4.0", new JsonObject().putString("foo", "bar"), 2);
assertEquals("module4", module4.getName());
assertTrue(module4.getType().equals(ComponentConfig.Type.MODULE));
assertEquals("com.test~test-module~4.0", module4.getModule());
assertEquals("bar", module4.getConfig().getString("foo"));
assertEquals(2, module4.getInstances());
}