Flaugh24 commented on code in PR #1267: URL: https://github.com/apache/ignite-3/pull/1267#discussion_r1015333965
########## modules/cli/src/main/java/org/apache/ignite/internal/cli/commands/node/NodeUrl.java: ########## @@ -0,0 +1,33 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ignite.internal.cli.commands.node; + +import java.net.URL; + +/** Node URL. */ +public class NodeUrl { + private URL nodeUrl; + + public NodeUrl(URL nodeUrl) { + this.nodeUrl = nodeUrl; + } + + public String getNodeUrl() { Review Comment: Done ########## modules/cli/src/integrationTest/java/org/apache/ignite/internal/cli/commands/NodeNameTest.java: ########## @@ -0,0 +1,97 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ignite.internal.cli.commands; + +import static org.junit.jupiter.api.Assertions.assertAll; + +import jakarta.inject.Inject; +import java.time.Duration; +import java.util.Optional; +import org.apache.ignite.internal.cli.Await; +import org.apache.ignite.internal.cli.NodeNameRegistry; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; + +/** Tests for ignite node commands with a provided node name. */ +public class NodeNameTest extends CliCommandTestNotInitializedIntegrationBase { + + @Inject + NodeNameRegistry nodeNameRegistry; + private String nodeName; + + @BeforeEach + void setUp() { + nodeNameRegistry.startPullingUpdates("http://localhost:10301"); + // wait to pulling node names + Await.await(() -> !nodeNameRegistry.getAllNames().isEmpty(), Duration.ofSeconds(5)); + Optional<String> nodeName = nodeNameRegistry.getAllNames().stream().findFirst(); + Assertions.assertTrue(nodeName.isPresent()); + this.nodeName = nodeName.get(); + Review Comment: Done -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
