dsmiley commented on code in PR #4272:
URL: https://github.com/apache/solr/pull/4272#discussion_r3097319973
##########
solr/solrj/src/test/org/apache/solr/client/solrj/impl/ClusterStateProviderTest.java:
##########
@@ -472,29 +472,41 @@ public void testZkClusterStateProviderUrlScheme() throws
Exception {
}
private void testUrlSchemeDefault(SolrZkClient client) throws Exception {
+ if (isSSLMode()) {
+ System.clearProperty(SOLR_SSL_ENABLED);
+ }
try (var zkStateReader = new ZkStateReader(client);
var clusterStateProvider = new
ZkClientClusterStateProvider(zkStateReader)) {
assertEquals("http", clusterStateProvider.getUrlScheme());
+ } finally {
+ if (isSSLMode()) {
+ System.setProperty(SOLR_SSL_ENABLED, "true");
+ }
}
}
private void testUrlSchemeWithSystemProperties(SolrZkClient client) throws
Exception {
- System.setProperty(SOLR_SSL_ENABLED, "true");
Review Comment:
`assumeTrue(isSSLMode())``
##########
solr/core/src/test/org/apache/solr/cloud/overseer/ZkStateReaderTest.java:
##########
@@ -995,4 +995,23 @@ public void testFetchLowestSolrVersion_noLiveNodes()
throws Exception {
var lowestVersion = reader.fetchLowestSolrVersion();
assertFalse("Expected no lowest version when no live nodes exist",
lowestVersion.isPresent());
}
+
+ public void testGetUrlScheme_validSystemProperty() {
+ String expectedUrlScheme = isSSLMode() ? "https" : "http";
+ assertEquals(expectedUrlScheme, fixture.reader.getUrlScheme());
+ }
+
+ public void testGetUrlScheme_noClusterAndSystemProperty() {
+ // By default, the base class sets the system property for ssl
Review Comment:
rather than the flip flop... you could just add an
`assumeFalse(isSSLMode())` -- thus effectively disable the test sometimes
##########
solr/solrj/src/test/org/apache/solr/client/solrj/impl/ClusterStateProviderTest.java:
##########
@@ -472,29 +472,41 @@ public void testZkClusterStateProviderUrlScheme() throws
Exception {
}
private void testUrlSchemeDefault(SolrZkClient client) throws Exception {
+ if (isSSLMode()) {
Review Comment:
ah, right, thanks. Let's make this simple: `assumeFalse(isSSLMode())`
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]