MicroserverEnvironment { public ModuleBean getModuleBean(Module module) { return modulePort.getOrElse(module.getContext(),null); } MicroserverEnvironment(Properties propertyFactory, Collection<ModuleBean> modules);  MicroserverEnvironment(Properties propertyFactory); ModuleBean getModuleBean(Module module); void assureModule(Module module);  }
@Test public void testGetModuleBean() { MicroserverEnvironment microserverEnvironment = new MicroserverEnvironment(new Properties(), Arrays.asList(new ModuleBean(8081, "host1", () -> "test"))); assertThat(microserverEnvironment.getModuleBean(()-> "test").getPort(), is(8081)); }