@Override
    protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> properties) throws Exception {
        AS400ConnectionPool connectionPool;
        if (properties.containsKey(CONNECTION_POOL)) {
            LOG.trace("AS400ConnectionPool instance specified in the URI - will look it up.");

            // We have chosen to handle the connectionPool option ourselves, so
            // we must remove it from the given parameter list (see
            // http://camel.apache.org/writing-components.html)
            String poolId = properties.remove(CONNECTION_POOL).toString();
            connectionPool
                    = EndpointHelper.resolveReferenceParameter(getCamelContext(), poolId, AS400ConnectionPool.class, true);
        } else {
            LOG.trace("No AS400ConnectionPool instance specified in the URI - one will be provided.");
            connectionPool = getConnectionPool();
        }

        String type = remaining.substring(remaining.lastIndexOf('.') + 1).toUpperCase();
        Jt400Endpoint endpoint = new Jt400Endpoint(uri, this, connectionPool);
        setProperties(endpoint, properties);
        endpoint.setType(Jt400Type.valueOf(type));
        return endpoint;
    }
@Test
    public void testCreatePgmSecuredEndpoint() throws Exception {
        Endpoint endpoint = component
                .createEndpoint(
                        "jt400://user:password@host/qsys.lib/library.lib/queue.pgm?connectionPool=#mockPool&secured=true");
        assertNotNull(endpoint);
        assertTrue(endpoint instanceof Jt400Endpoint);
        assertTrue(((Jt400Endpoint) endpoint).isSecured());
    }