Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove 3 hostname tests that are no longer relevant #229

Merged
merged 2 commits into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified libyggdrasilffi.so
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -71,39 +71,6 @@ public void should_be_disabled_if_hostname_not_in_list() {
assertFalse(engine.isEnabled("test"));
}

@Test
public void should_be_enabled_for_hostName() {
String hostName = "my-super-host";
System.setProperty("hostname", hostName);
// TODO when creating the context, somehow it has to read the hostname. Implementation from SDK strategy https://github.com/Unleash/unleash-client-java/blob/061277bd31293170e28deac4ec750add3a03374b/src/main/java/io/getunleash/strategy/ApplicationHostnameStrategy.java#L18-L28

Map<String, String> params = new HashMap<>();
params.put("hostNames", "MegaHost," + hostName + ",MiniHost, happyHost");

stateHandler.setState(new FeatureToggle(
"test",
true,
ImmutableList.of(new ActivationStrategy("applicationHostname", params))
));
assertTrue(engine.isEnabled("test"));
}

@Test
public void should_handle_weird_casing() {
String hostName = "my-super-host";
System.setProperty("hostname", hostName);

Map<String, String> params = new HashMap<>();

params.put("hostNames", "MegaHost," + hostName.toUpperCase() + ",MiniHost, happyHost");
stateHandler.setState(new FeatureToggle(
"test",
true,
ImmutableList.of(new ActivationStrategy("applicationHostname", params))
));
assertTrue(engine.isEnabled("test"));
}

@Test
public void so_close_but_no_cigar() {
String hostName = "my-super-host";
Expand Down Expand Up @@ -135,21 +102,6 @@ public void should_be_enabled_for_InetAddress() throws UnknownHostException {
assertTrue(engine.isEnabled("test"));
}

@Test
public void should_be_enabled_for_dashed_host() throws UnknownHostException {
String hostName = "super-wiEred-host";
System.setProperty("hostname", hostName);

Map<String, String> params = new HashMap<>();
params.put("hostNames", "MegaHost," + hostName + ",MiniHost, happyHost");
stateHandler.setState(new FeatureToggle(
"test",
true,
ImmutableList.of(new ActivationStrategy("applicationHostname", params))
));
assertTrue(engine.isEnabled("test"));
}

@Test
public void null_test() {
stateHandler.setState(new FeatureToggle(
Expand Down
Binary file modified unleash-engine-all.jar
Binary file not shown.
Loading