diff --git a/spring-cloud-bus/src/test/java/org/springframework/cloud/bus/ServiceMatcherTests.java b/spring-cloud-bus/src/test/java/org/springframework/cloud/bus/ServiceMatcherTests.java index d25cd48..49ff087 100644 --- a/spring-cloud-bus/src/test/java/org/springframework/cloud/bus/ServiceMatcherTests.java +++ b/spring-cloud-bus/src/test/java/org/springframework/cloud/bus/ServiceMatcherTests.java @@ -49,119 +49,80 @@ public class ServiceMatcherTests { @Test public void fromSelf() { - assertThat( - matcher.isFromSelf( - new EnvironmentChangeRemoteApplicationEvent(this, "one:two:8888", - "foo:bar:spam", EMPTY_MAP)), - is(true)); + assertThat(matcher.isFromSelf(new EnvironmentChangeRemoteApplicationEvent(this, + "one:two:8888", "foo:bar:spam", EMPTY_MAP)), is(true)); } @Test public void forSelf() { - assertThat( - matcher.isForSelf( - new EnvironmentChangeRemoteApplicationEvent(this, "foo:bar:spam", - "one:two:8888", EMPTY_MAP)), - is(true)); + assertThat(matcher.isForSelf(new EnvironmentChangeRemoteApplicationEvent(this, + "foo:bar:spam", "one:two:8888", EMPTY_MAP)), is(true)); } @Test public void forSelfWithWildcard() { - assertThat( - matcher.isForSelf( - new EnvironmentChangeRemoteApplicationEvent(this, "foo:bar:spam", - "one:two:*", EMPTY_MAP)), - is(true)); + assertThat(matcher.isForSelf(new EnvironmentChangeRemoteApplicationEvent(this, + "foo:bar:spam", "one:two:*", EMPTY_MAP)), is(true)); } @Test public void forSelfWithGlobalWildcard() { - assertThat( - matcher.isForSelf( - new EnvironmentChangeRemoteApplicationEvent(this, "foo:bar:spam", - "**", EMPTY_MAP)), - is(true)); + assertThat(matcher.isForSelf(new EnvironmentChangeRemoteApplicationEvent(this, + "foo:bar:spam", "**", EMPTY_MAP)), is(true)); } @Test public void forSelfWithWildcardName() { - assertThat( - matcher.isForSelf( - new EnvironmentChangeRemoteApplicationEvent(this, "foo:bar:spam", - "o*", EMPTY_MAP)), - is(true)); + assertThat(matcher.isForSelf(new EnvironmentChangeRemoteApplicationEvent(this, + "foo:bar:spam", "o*", EMPTY_MAP)), is(true)); } @Test public void forSelfWithWildcardNameAndProfile() { - assertThat( - matcher.isForSelf( - new EnvironmentChangeRemoteApplicationEvent(this, "foo:bar:spam", - "o*:t*", EMPTY_MAP)), - is(true)); + assertThat(matcher.isForSelf(new EnvironmentChangeRemoteApplicationEvent(this, + "foo:bar:spam", "o*:t*", EMPTY_MAP)), is(true)); } @Test public void forSelfWithWildcardString() { - assertThat( - matcher.isForSelf( - new EnvironmentChangeRemoteApplicationEvent(this, "foo:bar:spam", - "o*", EMPTY_MAP)), - is(true)); + assertThat(matcher.isForSelf(new EnvironmentChangeRemoteApplicationEvent(this, + "foo:bar:spam", "o*", EMPTY_MAP)), is(true)); } @Test public void notForSelfWithWildCardNameAndMismatchingProfile() { - assertThat( - matcher.isForSelf( - new EnvironmentChangeRemoteApplicationEvent(this, "foo:bar:spam", - "o*:f*", EMPTY_MAP)), - is(false)); + assertThat(matcher.isForSelf(new EnvironmentChangeRemoteApplicationEvent(this, + "foo:bar:spam", "o*:f*", EMPTY_MAP)), is(false)); } @Test public void forSelfWithDoubleWildcard() { - assertThat( - matcher.isForSelf( - new EnvironmentChangeRemoteApplicationEvent(this, "foo:bar:spam", - "one:**", EMPTY_MAP)), - is(true)); + assertThat(matcher.isForSelf(new EnvironmentChangeRemoteApplicationEvent(this, + "foo:bar:spam", "one:**", EMPTY_MAP)), is(true)); } @Test public void forSelfWithNoWildcard() { - assertThat( - matcher.isForSelf( - new EnvironmentChangeRemoteApplicationEvent(this, "foo:bar:spam", - "one", EMPTY_MAP)), - is(true)); + assertThat(matcher.isForSelf(new EnvironmentChangeRemoteApplicationEvent(this, + "foo:bar:spam", "one", EMPTY_MAP)), is(true)); } @Test public void forSelfWithProfileNoWildcard() { - assertThat( - matcher.isForSelf( - new EnvironmentChangeRemoteApplicationEvent(this, "foo:bar:spam", - "one:two", EMPTY_MAP)), - is(true)); + assertThat(matcher.isForSelf(new EnvironmentChangeRemoteApplicationEvent(this, + "foo:bar:spam", "one:two", EMPTY_MAP)), is(true)); } @Test public void notForSelf() { - assertThat( - matcher.isForSelf( - new EnvironmentChangeRemoteApplicationEvent(this, "foo:bar:spam", - "one:two:9999", EMPTY_MAP)), - is(false)); + assertThat(matcher.isForSelf(new EnvironmentChangeRemoteApplicationEvent(this, + "foo:bar:spam", "one:two:9999", EMPTY_MAP)), is(false)); } @Test public void notFromSelf() { - assertThat( - matcher.isFromSelf( - new EnvironmentChangeRemoteApplicationEvent(this, "one:two:9999", - "foo:bar:spam", EMPTY_MAP)), - is(false)); + assertThat(matcher.isFromSelf(new EnvironmentChangeRemoteApplicationEvent(this, + "one:two:9999", "foo:bar:spam", EMPTY_MAP)), is(false)); } /** @@ -170,11 +131,8 @@ public class ServiceMatcherTests { @Test public void forSelfWithMultipleProfiles() { context.setId("customerportal:dev,cloud:80"); - assertThat( - matcher.isForSelf( - new EnvironmentChangeRemoteApplicationEvent(this, "foo:bar:spam", - "customerportal:cloud:*", EMPTY_MAP)), - is(true)); + assertThat(matcher.isForSelf(new EnvironmentChangeRemoteApplicationEvent(this, + "foo:bar:spam", "customerportal:cloud:*", EMPTY_MAP)), is(true)); } /** @@ -183,11 +141,8 @@ public class ServiceMatcherTests { @Test public void notForSelfWithMultipleProfiles() { context.setId("customerportal:dev,cloud:80"); - assertThat( - matcher.isForSelf( - new EnvironmentChangeRemoteApplicationEvent(this, "foo:bar:spam", - "bar:cloud:*", EMPTY_MAP)), - is(false)); + assertThat(matcher.isForSelf(new EnvironmentChangeRemoteApplicationEvent(this, + "foo:bar:spam", "bar:cloud:*", EMPTY_MAP)), is(false)); } /** @@ -197,9 +152,8 @@ public class ServiceMatcherTests { public void notForSelfWithMultipleProfilesDifferentPort() { context.setId("customerportal:dev,cloud:80"); assertThat( - matcher.isForSelf( - new EnvironmentChangeRemoteApplicationEvent(this, "foo:bar:spam", - "customerportal:cloud:8008", EMPTY_MAP)), + matcher.isForSelf(new EnvironmentChangeRemoteApplicationEvent(this, + "foo:bar:spam", "customerportal:cloud:8008", EMPTY_MAP)), is(false)); }