spring-boot-starter-data-jest/src/main/java/com/github/vanroy/springboot/autoconfigure/data/jest/ElasticsearchJestAutoConfiguration.java
private int createInternalNode() throws NodeValidationException {

		if (logger.isInfoEnabled()) {
			logger.info("Create test ES node");
		}

		int port = SocketUtils.findAvailableTcpPort();
		String clusterName = INTERNAL_TEST_CLUSTER_NAME + UUID.randomUUID();

		Settings.Builder settingsBuilder = Settings.builder()
				.put("cluster.name", clusterName)
				.put("http.type", "netty4")
				.put("http.port", String.valueOf(port));

		if (this.esNodeproperties != null) {
			this.esNodeproperties.getProperties().forEach(settingsBuilder::put);
		}

		Collection<Class<? extends Plugin>> plugins = scanPlugins();
		plugins.add(Netty4Plugin.class);

		this.node = new InternalNode(settingsBuilder.build(), plugins).start();

		return Integer.parseInt(settingsBuilder.get("http.port"));
	}
private int createInternalNode() throws NodeValidationException {

		if (logger.isInfoEnabled()) {
			logger.info("Create test ES node");
		}

		int port = SocketUtils.findAvailableTcpPort();
		String clusterName = INTERNAL_TEST_CLUSTER_NAME + UUID.randomUUID();

		Settings.Builder settingsBuilder = Settings.builder()
				.put("cluster.name", clusterName)
				.put("http.type", "netty4")
				.put("http.port", String.valueOf(port));

		if (this.esNodeproperties != null) {
			this.esNodeproperties.getProperties().forEach(settingsBuilder::put);
		}

		Collection<Class<? extends Plugin>> plugins = scanPlugins();
		plugins.add(Netty4Plugin.class);

		this.node = new InternalNode(settingsBuilder.build(), plugins).start();

		return Integer.parseInt(settingsBuilder.get("http.port"));
	}
private int createInternalNode ( ) throws NodeValidationException { if ( logger . isInfoEnabled ( ) ) { logger . info ( "Create test ES node" ) ; } int port = SocketUtils . findAvailableTcpPort ( ) ; String clusterName = INTERNAL_TEST_CLUSTER_NAME + UUID . randomUUID ( ) ; Settings . Builder settingsBuilder = Settings . builder ( ) . put ( "cluster.name" , clusterName ) . put ( "http.type" , "netty4" ) . put ( "http.port" , String . valueOf ( port ) ) ; if ( this . esNodeproperties != null ) { this . esNodeproperties . getProperties ( ) . forEach ( settingsBuilder :: put ) ; } Collection < Class < ? extends Plugin > > plugins = scanPlugins ( ) ; plugins . add ( Netty4Plugin . class ) ; this . node = new InternalNode ( settingsBuilder . build ( ) , plugins ) . start ( ) ; return Integer . parseInt ( settingsBuilder . get ( "http.port" ) ) ; }
Create internal Elasticsearch node.
@return HTTP port of node
Create internal Elasticsearch node .