@Override
    protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception {
        String metricsName = getMetricsName(remaining);
        MetricsType metricsType = getMetricsType(remaining);

        LOG.debug("Metrics type: {}; name: {}", metricsType, metricsName);
        Endpoint endpoint = new MetricsEndpoint(uri, this, metricRegistry, metricsType, metricsName);
        setProperties(endpoint, parameters);
        return endpoint;
    }
@Test
    public void testCreateEndpoint() throws Exception {
        component.setCamelContext(camelContext);
        when(camelContext.getRegistry()).thenReturn(camelRegistry);
        when(camelContext.resolvePropertyPlaceholders(anyString())).then(returnsFirstArg());
        when(camelRegistry.lookupByNameAndType(MetricsComponent.METRIC_REGISTRY_NAME, MetricRegistry.class))
                .thenReturn(metricRegistry);
        when(camelContext.getCamelContextExtension()).thenReturn(ecc);
        when(PluginHelper.getBeanIntrospection(ecc)).thenReturn(new DefaultBeanIntrospection());
        when(PluginHelper.getConfigurerResolver(ecc)).thenReturn((name, context) -> null);

        Map<String, Object> params = new HashMap<>();
        Long value = System.currentTimeMillis();
        params.put("mark", value);
        component.init();
        Endpoint result = component.createEndpoint("metrics:meter:long.meter", "meter:long.meter", params);
        assertThat(result, is(notNullValue()));
        assertThat(result, is(instanceOf(MetricsEndpoint.class)));
        MetricsEndpoint me = (MetricsEndpoint) result;
        assertThat(me.getMark(), is(value));
        assertThat(me.getMetricsName(), is("long.meter"));
        assertThat(me.getRegistry(), is(metricRegistry));
        inOrder.verify(camelContext, times(1)).getRegistry();
        inOrder.verify(camelRegistry, times(1)).lookupByNameAndType(MetricsComponent.METRIC_REGISTRY_NAME,
                MetricRegistry.class);
        inOrder.verify(camelContext, times(1)).getTypeConverter();
        inOrder.verifyNoMoreInteractions();
    }