Skip to content

Commit 791e40a

Browse files
authored
chore: Cleanup redundant setting of nodes.webProxyEndpointsEnabled in node create, update tests (#19833)
Signed-off-by: Matt Hess <matt.hess@swirldslabs.com>
1 parent 3866b10 commit 791e40a

File tree

2 files changed

+14
-49
lines changed

2 files changed

+14
-49
lines changed

hedera-node/test-clients/src/main/java/com/hedera/services/bdd/suites/hip869/NodeCreateTest.java

Lines changed: 5 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
import static com.hederahashgraph.api.proto.java.ResponseCodeEnum.UNAUTHORIZED;
4343
import static org.junit.jupiter.api.Assertions.assertEquals;
4444
import static org.junit.jupiter.api.Assertions.assertNotNull;
45-
import static org.junit.jupiter.api.Assertions.assertNull;
4645

4746
import com.google.protobuf.ByteString;
4847
import com.hedera.services.bdd.junit.EmbeddedHapiTest;
@@ -286,17 +285,14 @@ final Stream<DynamicTest> failOnTooManyServiceEndpoints() throws CertificateEnco
286285
* Check that node creation succeeds with gossip and service endpoints using ips and all optional fields are recorded.
287286
* @see <a href="https://github.com/hashgraph/hedera-improvement-proposal/blob/main/HIP/hip-869.md#specification">HIP-869</a>
288287
*/
289-
@LeakyEmbeddedHapiTest(
290-
reason = NEEDS_STATE_ACCESS,
291-
overrides = {"nodes.webProxyEndpointsEnabled"})
288+
@EmbeddedHapiTest(NEEDS_STATE_ACCESS)
292289
final Stream<DynamicTest> allFieldsSetHappyCaseForIps() throws CertificateEncodingException {
293290
final var nodeCreate = canonicalNodeCreate()
294291
.gossipEndpoint(GOSSIP_ENDPOINTS_IPS)
295292
.serviceEndpoint(SERVICES_ENDPOINTS_IPS)
296293
// The web proxy endpoint can never be an IP address
297294
.grpcWebProxyEndpoint(GRPC_PROXY_ENDPOINT_FQDN);
298295
return hapiTest(
299-
overriding("nodes.webProxyEndpointsEnabled", "true"),
300296
newKeyNamed(ED_25519_KEY).shape(KeyShape.ED25519),
301297
nodeCreate,
302298
verifyCanonicalCreate(nodeCreate),
@@ -313,36 +309,18 @@ final Stream<DynamicTest> allFieldsSetHappyCaseForIps() throws CertificateEncodi
313309
*/
314310
@LeakyEmbeddedHapiTest(
315311
reason = NEEDS_STATE_ACCESS,
316-
overrides = {"nodes.gossipFqdnRestricted", "nodes.webProxyEndpointsEnabled"})
312+
overrides = {"nodes.gossipFqdnRestricted"})
317313
final Stream<DynamicTest> allFieldsSetHappyCaseForDomains() throws CertificateEncodingException {
318314
final var nodeCreate = canonicalNodeCreate();
319-
return hapiTest(
320-
overridingTwo("nodes.gossipFqdnRestricted", "false", "nodes.webProxyEndpointsEnabled", "true"),
321-
newKeyNamed(ED_25519_KEY).shape(KeyShape.ED25519),
322-
nodeCreate,
323-
verifyCanonicalCreate(nodeCreate),
324-
viewNode("nodeCreate", node -> {
325-
assertEqualServiceEndpoints(GOSSIP_ENDPOINTS_FQDNS, node.gossipEndpoint());
326-
assertEqualServiceEndpoints(SERVICES_ENDPOINTS_FQDNS, node.serviceEndpoint());
327-
assertEqualServiceEndpoint(GRPC_PROXY_ENDPOINT_FQDN, node.grpcProxyEndpoint());
328-
}));
329-
}
330-
331-
@LeakyEmbeddedHapiTest(
332-
reason = NEEDS_STATE_ACCESS,
333-
overrides = {"nodes.gossipFqdnRestricted"})
334-
final Stream<DynamicTest> allFieldsButProxyEndpointSet() throws CertificateEncodingException {
335-
final var nodeCreate = canonicalNodeCreate().withNoWebProxyEndpoint();
336315
return hapiTest(
337316
overriding("nodes.gossipFqdnRestricted", "false"),
338317
newKeyNamed(ED_25519_KEY).shape(KeyShape.ED25519),
339318
nodeCreate,
340319
verifyCanonicalCreate(nodeCreate),
341-
// nodes.webProxyEndpointsEnabled should default to false, resulting in a null proxy endpoint
342320
viewNode("nodeCreate", node -> {
343321
assertEqualServiceEndpoints(GOSSIP_ENDPOINTS_FQDNS, node.gossipEndpoint());
344322
assertEqualServiceEndpoints(SERVICES_ENDPOINTS_FQDNS, node.serviceEndpoint());
345-
assertNull(node.grpcProxyEndpoint());
323+
assertEqualServiceEndpoint(GRPC_PROXY_ENDPOINT_FQDN, node.grpcProxyEndpoint());
346324
}));
347325
}
348326

@@ -355,10 +333,9 @@ final Stream<DynamicTest> webProxySetWhenNotEnabledReturnsNotSupported() throws
355333
nodeCreate.hasKnownStatus(GRPC_WEB_PROXY_NOT_SUPPORTED));
356334
}
357335

358-
@LeakyHapiTest(overrides = {"nodes.webProxyEndpointsEnabled"})
336+
@HapiTest
359337
final Stream<DynamicTest> webProxyAsIpAddressIsRejected() throws CertificateEncodingException {
360338
return hapiTest(
361-
overriding("nodes.webProxyEndpointsEnabled", "true"),
362339
newKeyNamed("adminKey"),
363340
nodeCreate("nodeCreate")
364341
.adminKey("adminKey")
@@ -624,10 +601,9 @@ final Stream<DynamicTest> createNodeFailsWithRegPayer() throws CertificateEncodi
624601
.hasKnownStatus(UNAUTHORIZED));
625602
}
626603

627-
@LeakyHapiTest(overrides = {"nodes.webProxyEndpointsEnabled"})
604+
@HapiTest
628605
final Stream<DynamicTest> createNodeWithDefaultGrpcProxyFails() throws CertificateEncodingException {
629606
return hapiTest(
630-
overriding("nodes.webProxyEndpointsEnabled", "true"),
631607
newKeyNamed("adminKey"),
632608
nodeCreate("testNode")
633609
.adminKey("adminKey")

hedera-node/test-clients/src/main/java/com/hedera/services/bdd/suites/hip869/NodeUpdateTest.java

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -160,10 +160,9 @@ final Stream<DynamicTest> validateServiceEndpoint() throws CertificateEncodingEx
160160
.hasKnownStatus(INVALID_IPV4_ADDRESS));
161161
}
162162

163-
@LeakyHapiTest(overrides = {"nodes.webProxyEndpointsEnabled"})
163+
@HapiTest
164164
final Stream<DynamicTest> validateGrpcProxyEndpoint() throws CertificateEncodingException {
165165
return hapiTest(
166-
overriding("nodes.webProxyEndpointsEnabled", "true"),
167166
newKeyNamed("adminKey"),
168167
nodeCreate("testNode")
169168
.adminKey("adminKey")
@@ -194,9 +193,7 @@ final Stream<DynamicTest> cantUpdateGrpcProxyEndpointIfDisabled() throws Certifi
194193
.hasKnownStatus(GRPC_WEB_PROXY_NOT_SUPPORTED));
195194
}
196195

197-
@LeakyEmbeddedHapiTest(
198-
reason = NEEDS_STATE_ACCESS,
199-
overrides = {"nodes.webProxyEndpointsEnabled"})
196+
@EmbeddedHapiTest(NEEDS_STATE_ACCESS)
200197
final Stream<DynamicTest> updateMultipleFieldsWork() throws CertificateEncodingException {
201198
final var proxyWebEndpoint = toPbj(endpointFor("grpc.web.proxy.com", 123));
202199
final var updateOp = nodeUpdate("testNode")
@@ -212,7 +209,6 @@ final Stream<DynamicTest> updateMultipleFieldsWork() throws CertificateEncodingE
212209
.gossipCaCertificate(gossipCertificates.getLast().getEncoded())
213210
.grpcCertificateHash("grpcCert".getBytes());
214211
return hapiTest(
215-
overriding("nodes.webProxyEndpointsEnabled", "true"),
216212
newKeyNamed("adminKey"),
217213
newKeyNamed("adminKey2"),
218214
nodeCreate("testNode")
@@ -250,8 +246,9 @@ final Stream<DynamicTest> updateMultipleFieldsWork() throws CertificateEncodingE
250246
}));
251247
}
252248

253-
@EmbeddedHapiTest(NEEDS_STATE_ACCESS)
254-
@LeakyHapiTest(overrides = {"nodes.updateAccountIdAllowed"})
249+
@LeakyEmbeddedHapiTest(
250+
reason = NEEDS_STATE_ACCESS,
251+
overrides = {"nodes.updateAccountIdAllowed"})
255252
final Stream<DynamicTest> updateAccountIdWork() throws CertificateEncodingException {
256253
final var updateOp = nodeUpdate("testNode")
257254
.adminKey("adminKey2")
@@ -301,8 +298,7 @@ final Stream<DynamicTest> updateAccountIdWork() throws CertificateEncodingExcept
301298
"Node grpcCertificateHash should be updated");
302299
assertEquals(toPbj(updateOp.getAdminKey()), node.adminKey(), "Node adminKey should be updated");
303300
assertEquals(toPbj(asAccount(spec, 100)), node.accountId(), "Node accountId should be updated");
304-
}))),
305-
overriding("nodes.updateAccountIdAllowed", "false"));
301+
}))));
306302
}
307303

308304
@HapiTest
@@ -359,12 +355,9 @@ final Stream<DynamicTest> validateGossipEndpointSize() throws CertificateEncodin
359355
.hasKnownStatus(GOSSIP_ENDPOINTS_EXCEEDED_LIMIT));
360356
}
361357

362-
@LeakyEmbeddedHapiTest(
363-
reason = NEEDS_STATE_ACCESS,
364-
overrides = {"nodes.webProxyEndpointsEnabled"})
358+
@EmbeddedHapiTest(NEEDS_STATE_ACCESS)
365359
final Stream<DynamicTest> sentinelUnsetsGrpcWebProxyEndpoint() throws CertificateEncodingException {
366360
return hapiTest(
367-
overriding("nodes.webProxyEndpointsEnabled", "true"),
368361
newKeyNamed("adminKey"),
369362
nodeCreate("testNode")
370363
.adminKey("adminKey")
@@ -379,12 +372,9 @@ final Stream<DynamicTest> sentinelUnsetsGrpcWebProxyEndpoint() throws Certificat
379372
viewNode("testNode", node -> assertNull(node.grpcProxyEndpoint())));
380373
}
381374

382-
@LeakyEmbeddedHapiTest(
383-
reason = NEEDS_STATE_ACCESS,
384-
overrides = {"nodes.webProxyEndpointsEnabled"})
375+
@EmbeddedHapiTest(NEEDS_STATE_ACCESS)
385376
final Stream<DynamicTest> unsetGrpcProxyFieldDoesntEraseExistingGrpcProxy() throws CertificateEncodingException {
386377
return hapiTest(
387-
overriding("nodes.webProxyEndpointsEnabled", "true"),
388378
newKeyNamed("adminKey"),
389379
nodeCreate("testNode")
390380
.adminKey("adminKey")
@@ -453,10 +443,9 @@ final Stream<DynamicTest> signedByAdminKeySuccess() throws CertificateEncodingEx
453443
getTxnRecord("successUpdate").logged());
454444
}
455445

456-
@LeakyHapiTest(overrides = {"nodes.webProxyEndpointsEnabled"})
446+
@HapiTest
457447
final Stream<DynamicTest> webProxyAsIpAddressIsRejected() throws CertificateEncodingException {
458448
return hapiTest(
459-
overriding("nodes.webProxyEndpointsEnabled", "true"),
460449
newKeyNamed("adminKey"),
461450
nodeCreate("testNode")
462451
.adminKey("adminKey")

0 commit comments

Comments
 (0)