test_class.declarator: dubboMonitorFactory
test_class.modifier: private
test_class.original_string: private DubboMonitorFactory dubboMonitorFactory;
test_class.type: DubboMonitorFactory
test_class.var_name: dubboMonitorFactory
test_class.declarator: proxyFactory
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private ProxyFactory proxyFactory;
test_class.type: ProxyFactory
test_class.var_name: proxyFactory
test_class.file: dubbo-monitor/dubbo-monitor-default/src/test/java/org/apache/dubbo/monitor/dubbo/DubboMonitorFactoryTest.java
test_class.identifier: DubboMonitorFactoryTest
test_case.body: @Test
      public void testCreateMonitor() {
          URL urlWithoutPath = URL.valueOf("http://10.10.10.11");
          Monitor monitor = dubboMonitorFactory.createMonitor(urlWithoutPath);
          assertThat(monitor, not(nullValue()));
  
          URL urlWithFilterKey = URL.valueOf("http://10.10.10.11/").addParameter(REFERENCE_FILTER_KEY, "testFilter");
          monitor = dubboMonitorFactory.createMonitor(urlWithFilterKey);
  
          assertThat(monitor, not(nullValue()));
          ArgumentCaptor<Invoker> invokerArgumentCaptor = ArgumentCaptor.forClass(Invoker.class);
          verify(proxyFactory, atLeastOnce()).getProxy(invokerArgumentCaptor.capture());
  
          Invoker invoker = invokerArgumentCaptor.getValue();
          assertThat(invoker.getUrl().getParameter(REFERENCE_FILTER_KEY), containsString("testFilter"));
      }
test_case.class_method_signature: DubboMonitorFactoryTest.testCreateMonitor()
test_case.full_signature: @Test public void testCreateMonitor()
test_case.identifier: testCreateMonitor
test_case.invocations: valueOf createMonitor assertThat not nullValue addParameter valueOf createMonitor assertThat not nullValue forClass getProxy verify atLeastOnce capture getValue assertThat getParameter getUrl containsString
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testCreateMonitor()
focal_class.declarator: protocol
focal_class.modifier: private
focal_class.original_string: private Protocol protocol;
focal_class.type: Protocol
focal_class.var_name: protocol
focal_class.declarator: proxyFactory
focal_class.modifier: private
focal_class.original_string: private ProxyFactory proxyFactory;
focal_class.type: ProxyFactory
focal_class.var_name: proxyFactory
focal_class.file: dubbo-monitor/dubbo-monitor-default/src/main/java/org/apache/dubbo/monitor/dubbo/DubboMonitorFactory.java
focal_class.identifier: DubboMonitorFactory
focal_class.class_method_signature: DubboMonitorFactory.setProtocol(Protocol protocol)
focal_class.full_signature: public void setProtocol(Protocol protocol)
focal_class.identifier: setProtocol
focal_class.modifiers: public
focal_class.parameters: (Protocol protocol)
focal_class.return: void
focal_class.signature: void setProtocol(Protocol protocol)
focal_class.class_method_signature: DubboMonitorFactory.setProxyFactory(ProxyFactory proxyFactory)
focal_class.full_signature: public void setProxyFactory(ProxyFactory proxyFactory)
focal_class.identifier: setProxyFactory
focal_class.modifiers: public
focal_class.parameters: (ProxyFactory proxyFactory)
focal_class.return: void
focal_class.signature: void setProxyFactory(ProxyFactory proxyFactory)
focal_class.class_method_signature: DubboMonitorFactory.createMonitor(URL url)
focal_class.full_signature: @Override protected Monitor createMonitor(URL url)
focal_class.identifier: createMonitor
focal_class.modifiers: @Override protected
focal_class.parameters: (URL url)
focal_class.return: Monitor
focal_class.signature: Monitor createMonitor(URL url)
focal_class.superclass: extends AbstractMonitorFactory
focal_method.body: @Override
      protected Monitor createMonitor(URL url) {
          URLBuilder urlBuilder = URLBuilder.from(url);
          urlBuilder.setProtocol(url.getParameter(PROTOCOL_KEY, DUBBO_PROTOCOL));
          if (StringUtils.isEmpty(url.getPath())) {
              urlBuilder.setPath(MonitorService.class.getName());
          }
          String filter = url.getParameter(REFERENCE_FILTER_KEY);
          if (StringUtils.isEmpty(filter)) {
              filter = "";
          } else {
              filter = filter + ",";
          }
          urlBuilder.addParameters(CHECK_KEY, String.valueOf(false),
                  REFERENCE_FILTER_KEY, filter + "-monitor");
          Invoker<MonitorService> monitorInvoker = protocol.refer(MonitorService.class, urlBuilder.build());
          MonitorService monitorService = proxyFactory.getProxy(monitorInvoker);
          return new DubboMonitor(monitorInvoker, monitorService);
      }
focal_method.class_method_signature: DubboMonitorFactory.createMonitor(URL url)
focal_method.full_signature: @Override protected Monitor createMonitor(URL url)
focal_method.identifier: createMonitor
focal_method.invocations: from setProtocol getParameter isEmpty getPath setPath getName getParameter isEmpty addParameters valueOf refer build getProxy
focal_method.modifiers: @Override protected
focal_method.parameters: (URL url)
focal_method.return: Monitor
focal_method.signature: Monitor createMonitor(URL url)