Skip to content

Commit

Permalink
Fixed some formatting in NetworkAddressRulesTest
Browse files Browse the repository at this point in the history
(cherry picked from commit 91353df)
  • Loading branch information
Tom Akehurst authored and Mahoney committed Sep 5, 2023
1 parent 295ad5c commit 5412ed1
Showing 1 changed file with 5 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,7 @@ void allowsAddressIncludedAndNotExcluded() {

@Test
void onlyAllowSingleIp() {
NetworkAddressRules rules =
NetworkAddressRules.builder()
.allow("10.1.1.1")
.build();
NetworkAddressRules rules = NetworkAddressRules.builder().allow("10.1.1.1").build();

assertThat(rules.isAllowed("10.1.1.1"), is(true));
assertThat(rules.isAllowed("10.1.1.0"), is(false));
Expand All @@ -53,10 +50,7 @@ void onlyAllowSingleIp() {

@Test
void onlyDenySingleIp() {
NetworkAddressRules rules =
NetworkAddressRules.builder()
.deny("10.1.1.1")
.build();
NetworkAddressRules rules = NetworkAddressRules.builder().deny("10.1.1.1").build();

assertThat(rules.isAllowed("10.1.1.1"), is(false));
assertThat(rules.isAllowed("10.1.1.0"), is(true));
Expand All @@ -66,10 +60,7 @@ void onlyDenySingleIp() {
@Test
void allowAndDenySingleIps() {
NetworkAddressRules rules =
NetworkAddressRules.builder()
.deny("10.1.1.1")
.allow("10.1.1.3")
.build();
NetworkAddressRules.builder().deny("10.1.1.1").allow("10.1.1.3").build();

assertThat(rules.isAllowed("10.1.1.0"), is(false));
assertThat(rules.isAllowed("10.1.1.1"), is(false));
Expand All @@ -81,10 +72,7 @@ void allowAndDenySingleIps() {
@Test
void allowRangeAndDenySingleIp() {
NetworkAddressRules rules =
NetworkAddressRules.builder()
.allow("10.1.1.1-10.1.1.3")
.deny("10.1.1.2")
.build();
NetworkAddressRules.builder().allow("10.1.1.1-10.1.1.3").deny("10.1.1.2").build();

assertThat(rules.isAllowed("10.1.1.0"), is(false));
assertThat(rules.isAllowed("10.1.1.1"), is(true));
Expand All @@ -96,10 +84,7 @@ void allowRangeAndDenySingleIp() {
@Test
void denyRangeAndAllowSingleIp() {
NetworkAddressRules rules =
NetworkAddressRules.builder()
.deny("10.1.1.1-10.1.1.3")
.allow("10.1.1.2")
.build();
NetworkAddressRules.builder().deny("10.1.1.1-10.1.1.3").allow("10.1.1.2").build();

assertThat(rules.isAllowed("10.1.1.0"), is(false));
assertThat(rules.isAllowed("10.1.1.1"), is(false));
Expand Down

0 comments on commit 5412ed1

Please sign in to comment.