Browse Source

Refactor.

pull/500/head
Olga MaciaszekSharma 4 years ago
parent
commit
b4fb3fe7b4
  1. 18
      spring-cloud-openfeign-core/src/test/java/org/springframework/cloud/openfeign/FeignHttpClientUrlTests.java
  2. 18
      spring-cloud-openfeign-core/src/test/java/org/springframework/cloud/openfeign/FeignHttpClientUrlTestsWithLoadBalancer.java
  3. 18
      spring-cloud-openfeign-core/src/test/java/org/springframework/cloud/openfeign/FeignHttpClientUrlTestsWithRetryableLoadBalancer.java
  4. 1
      src/checkstyle/checkstyle-suppressions.xml

18
spring-cloud-openfeign-core/src/test/java/org/springframework/cloud/openfeign/FeignHttpClientUrlTests.java

@ -79,8 +79,8 @@ class FeignHttpClientUrlTests {
@Test @Test
void testUrlHttpClient() { void testUrlHttpClient() {
assertThat(this.urlClient).as("UrlClient was null").isNotNull(); assertThat(urlClient).as("UrlClient was null").isNotNull();
Hello hello = this.urlClient.getHello(); Hello hello = urlClient.getHello();
assertThat(hello).as("hello was null").isNotNull(); assertThat(hello).as("hello was null").isNotNull();
assertThat(hello).as("first hello didn't match") assertThat(hello).as("first hello didn't match")
.isEqualTo(new Hello("hello world 1")); .isEqualTo(new Hello("hello world 1"));
@ -88,7 +88,7 @@ class FeignHttpClientUrlTests {
@Test @Test
void testBeanUrl() { void testBeanUrl() {
Hello hello = this.beanClient.getHello(); Hello hello = beanClient.getHello();
assertThat(hello).as("hello was null").isNotNull(); assertThat(hello).as("hello was null").isNotNull();
assertThat(hello).as("first hello didn't match") assertThat(hello).as("first hello didn't match")
.isEqualTo(new Hello("hello world 1")); .isEqualTo(new Hello("hello world 1"));
@ -96,7 +96,7 @@ class FeignHttpClientUrlTests {
@Test @Test
void testBeanUrlNoProtocol() { void testBeanUrlNoProtocol() {
Hello hello = this.beanClientNoProtocol.getHello(); Hello hello = beanClientNoProtocol.getHello();
assertThat(hello).as("hello was null").isNotNull(); assertThat(hello).as("hello was null").isNotNull();
assertThat(hello).as("first hello didn't match") assertThat(hello).as("first hello didn't match")
.isEqualTo(new Hello("hello world 1")); .isEqualTo(new Hello("hello world 1"));
@ -180,16 +180,16 @@ class FeignHttpClientUrlTests {
private String message; private String message;
public Hello() { Hello() {
} }
public Hello(String message) { Hello(String message) {
this.message = message; this.message = message;
} }
public String getMessage() { public String getMessage() {
return this.message; return message;
} }
public void setMessage(String message) { public void setMessage(String message) {
@ -205,12 +205,12 @@ class FeignHttpClientUrlTests {
return false; return false;
} }
Hello that = (Hello) o; Hello that = (Hello) o;
return Objects.equals(this.message, that.message); return Objects.equals(message, that.message);
} }
@Override @Override
public int hashCode() { public int hashCode() {
return Objects.hash(this.message); return Objects.hash(message);
} }
} }

18
spring-cloud-openfeign-core/src/test/java/org/springframework/cloud/openfeign/FeignHttpClientUrlTestsWithLoadBalancer.java

@ -82,8 +82,8 @@ class FeignHttpClientUrlTestsWithLoadBalancer {
@Test @Test
void testUrlHttpClient() { void testUrlHttpClient() {
assertThat(this.urlClient).as("UrlClient was null").isNotNull(); assertThat(urlClient).as("UrlClient was null").isNotNull();
Hello hello = this.urlClient.getHello(); Hello hello = urlClient.getHello();
assertThat(hello).as("hello was null").isNotNull(); assertThat(hello).as("hello was null").isNotNull();
assertThat(hello).as("first hello didn't match") assertThat(hello).as("first hello didn't match")
.isEqualTo(new Hello("hello world 1")); .isEqualTo(new Hello("hello world 1"));
@ -91,7 +91,7 @@ class FeignHttpClientUrlTestsWithLoadBalancer {
@Test @Test
void testBeanUrl() { void testBeanUrl() {
Hello hello = this.beanClient.getHello(); Hello hello = beanClient.getHello();
assertThat(hello).as("hello was null").isNotNull(); assertThat(hello).as("hello was null").isNotNull();
assertThat(hello).as("first hello didn't match") assertThat(hello).as("first hello didn't match")
.isEqualTo(new Hello("hello world 1")); .isEqualTo(new Hello("hello world 1"));
@ -99,7 +99,7 @@ class FeignHttpClientUrlTestsWithLoadBalancer {
@Test @Test
void testBeanUrlNoProtocol() { void testBeanUrlNoProtocol() {
Hello hello = this.beanClientNoProtocol.getHello(); Hello hello = beanClientNoProtocol.getHello();
assertThat(hello).as("hello was null").isNotNull(); assertThat(hello).as("hello was null").isNotNull();
assertThat(hello).as("first hello didn't match") assertThat(hello).as("first hello didn't match")
.isEqualTo(new Hello("hello world 1")); .isEqualTo(new Hello("hello world 1"));
@ -183,16 +183,16 @@ class FeignHttpClientUrlTestsWithLoadBalancer {
private String message; private String message;
public Hello() { Hello() {
} }
public Hello(String message) { Hello(String message) {
this.message = message; this.message = message;
} }
public String getMessage() { public String getMessage() {
return this.message; return message;
} }
public void setMessage(String message) { public void setMessage(String message) {
@ -208,12 +208,12 @@ class FeignHttpClientUrlTestsWithLoadBalancer {
return false; return false;
} }
Hello that = (Hello) o; Hello that = (Hello) o;
return Objects.equals(this.message, that.message); return Objects.equals(message, that.message);
} }
@Override @Override
public int hashCode() { public int hashCode() {
return Objects.hash(this.message); return Objects.hash(message);
} }
} }

18
spring-cloud-openfeign-core/src/test/java/org/springframework/cloud/openfeign/FeignHttpClientUrlTestsWithRetryableLoadBalancer.java

@ -82,8 +82,8 @@ class FeignHttpClientUrlTestsWithRetryableLoadBalancer {
@Test @Test
void testUrlHttpClient() { void testUrlHttpClient() {
assertThat(this.urlClient).as("UrlClient was null").isNotNull(); assertThat(urlClient).as("UrlClient was null").isNotNull();
Hello hello = this.urlClient.getHello(); Hello hello = urlClient.getHello();
assertThat(hello).as("hello was null").isNotNull(); assertThat(hello).as("hello was null").isNotNull();
assertThat(hello).as("first hello didn't match") assertThat(hello).as("first hello didn't match")
.isEqualTo(new Hello("hello world 1")); .isEqualTo(new Hello("hello world 1"));
@ -91,7 +91,7 @@ class FeignHttpClientUrlTestsWithRetryableLoadBalancer {
@Test @Test
void testBeanUrl() { void testBeanUrl() {
Hello hello = this.beanClient.getHello(); Hello hello = beanClient.getHello();
assertThat(hello).as("hello was null").isNotNull(); assertThat(hello).as("hello was null").isNotNull();
assertThat(hello).as("first hello didn't match") assertThat(hello).as("first hello didn't match")
.isEqualTo(new Hello("hello world 1")); .isEqualTo(new Hello("hello world 1"));
@ -99,7 +99,7 @@ class FeignHttpClientUrlTestsWithRetryableLoadBalancer {
@Test @Test
void testBeanUrlNoProtocol() { void testBeanUrlNoProtocol() {
Hello hello = this.beanClientNoProtocol.getHello(); Hello hello = beanClientNoProtocol.getHello();
assertThat(hello).as("hello was null").isNotNull(); assertThat(hello).as("hello was null").isNotNull();
assertThat(hello).as("first hello didn't match") assertThat(hello).as("first hello didn't match")
.isEqualTo(new Hello("hello world 1")); .isEqualTo(new Hello("hello world 1"));
@ -183,16 +183,16 @@ class FeignHttpClientUrlTestsWithRetryableLoadBalancer {
private String message; private String message;
public Hello() { Hello() {
} }
public Hello(String message) { Hello(String message) {
this.message = message; this.message = message;
} }
public String getMessage() { public String getMessage() {
return this.message; return message;
} }
public void setMessage(String message) { public void setMessage(String message) {
@ -208,12 +208,12 @@ class FeignHttpClientUrlTestsWithRetryableLoadBalancer {
return false; return false;
} }
Hello that = (Hello) o; Hello that = (Hello) o;
return Objects.equals(this.message, that.message); return Objects.equals(message, that.message);
} }
@Override @Override
public int hashCode() { public int hashCode() {
return Objects.hash(this.message); return Objects.hash(message);
} }
} }

1
src/checkstyle/checkstyle-suppressions.xml

@ -16,7 +16,6 @@
<suppress files=".*ProtobufSpringEncoderTest.*" checks="LineLengthCheck"/> <suppress files=".*ProtobufSpringEncoderTest.*" checks="LineLengthCheck"/>
<suppress files=".*ProtobufTest.*" checks="LineLengthCheck"/> <suppress files=".*ProtobufTest.*" checks="LineLengthCheck"/>
<suppress files=".*Hello.*" checks="RedundantModifier"/> <suppress files=".*Hello.*" checks="RedundantModifier"/>
<suppress files=".*FeignHttp.*" checks="RedundantModifier"/>
<!-- Important --> <!-- Important -->
<suppress files=".*HttpEncoding.*" checks="InterfaceIsTypeCheck"/> <suppress files=".*HttpEncoding.*" checks="InterfaceIsTypeCheck"/>
</suppressions> </suppressions>

Loading…
Cancel
Save