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

Refactor HarvesterOptionsTest to use assertj #81

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,22 @@
import java.util.Set;
import java.util.stream.Collectors;

import static org.testng.Assert.*;
import static org.assertj.core.api.Assertions.assertThat;

public class HarvesterOptionsTest {

static Set<String> exclusionStrings = ImmutableSet.of("test_collector", "test:mbean=foo");
static Set<Harvester.Exclusion> exclusions = exclusionStrings.stream()
private static Set<String> exclusionStrings = ImmutableSet.of("test_collector", "test:mbean=foo");
private static Set<Harvester.Exclusion> exclusions = exclusionStrings.stream()
.map(Harvester.Exclusion::create)
.collect(Collectors.toSet());

@org.testng.annotations.Test
@Test
public void testSetExclusions() {
final HarvesterOptions harvesterOptions = new HarvesterOptions();

harvesterOptions.setExclusions(exclusionStrings);

assertEquals(harvesterOptions.exclusions, exclusions);
assertThat(harvesterOptions.exclusions).isEqualTo(exclusions);
}

@Test
Expand All @@ -38,6 +38,6 @@ public void testSetExclusionsFromFile() throws IOException {

harvesterOptions.setExclusions(ImmutableSet.of(String.format("@%s", tempFile)));

assertEquals(harvesterOptions.exclusions, exclusions);
assertThat(harvesterOptions.exclusions).isEqualTo(exclusions);
}
}
}