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

1
src/checkstyle/checkstyle-suppressions.xml

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

Loading…
Cancel
Save