Skip to content

Commit

Permalink
Do not require federationmapping.polling.url to be null before changi…
Browse files Browse the repository at this point in the history
…ng it
  • Loading branch information
zrhoffman committed Mar 8, 2021
1 parent 4461e4d commit ff33192
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
import static org.apache.traffic_control.traffic_router.core.loc.FederationsWatcher.DEFAULT_FEDERATION_DATA_URL;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.endsWith;
import static org.junit.Assert.assertNull;
import static org.hamcrest.Matchers.not;


@Category(IntegrationTest.class)
Expand Down Expand Up @@ -115,7 +115,10 @@ public void testWatchers() {
TrafficRouter trafficRouter = trafficRouterManager.getTrafficRouter();
CacheRegister cacheRegister = trafficRouter.getCacheRegister();
JsonNode config = cacheRegister.getConfig();
assertNull(config.get(federationsWatcher.getWatcherConfigPrefix() + ".polling.url"));
JsonNode pollingUrlNode = config.get(federationsWatcher.getWatcherConfigPrefix() + ".polling.url");
if (pollingUrlNode != null) {
assertThat(pollingUrlNode.asText(), not(endsWith("api/3.0/notAFederationsEndpoint")));
}
assertThat(federationsWatcher.getDataBaseURL(), endsWith(DEFAULT_FEDERATION_DATA_URL.split("api")[1]));
assertThat(steeringWatcher.getDataBaseURL(), endsWith(DEFAULT_STEERING_DATA_URL.split("api")[1]));

Expand Down

0 comments on commit ff33192

Please sign in to comment.