Skip to content

Commit

Permalink
formatting and responding to CodeRabbitAI comment
Browse files Browse the repository at this point in the history
  • Loading branch information
iain-henderson committed Aug 29, 2023
1 parent 6fa78d7 commit e5b2308
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 31 deletions.
3 changes: 1 addition & 2 deletions core/src/main/java/feign/Logger.java
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,7 @@ protected static String resolveProtocolVersion(Request.ProtocolVersion protocolV
/**
* Controls the level of logging.
*/
public enum Level
{
public enum Level {
/**
* No logging.
*/
Expand Down
26 changes: 13 additions & 13 deletions core/src/main/java/feign/Request.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,39 +31,39 @@
*/
public final class Request implements Serializable {

public enum HttpMethod
{
public enum HttpMethod {
GET, HEAD, POST(true), PUT(true), DELETE, CONNECT, OPTIONS, TRACE, PATCH(true);

private final boolean withBody;
private final boolean withBody;

HttpMethod() {
HttpMethod() {
this(false);
}

HttpMethod(boolean withBody) {
HttpMethod(boolean withBody) {
this.withBody = withBody;
}

public boolean isWithBody() {
return this.withBody;
}}
public boolean isWithBody() {
return this.withBody;
}
}

public enum ProtocolVersion{
public enum ProtocolVersion {

HTTP_1_0("HTTP/1.0"), HTTP_1_1("HTTP/1.1"), HTTP_2("HTTP/2.0"), MOCK;
HTTP_1_0("HTTP/1.0"), HTTP_1_1("HTTP/1.1"), HTTP_2("HTTP/2.0"), MOCK;

final String protocolVersion;

ProtocolVersion() {
ProtocolVersion() {
protocolVersion = name();
}

ProtocolVersion(String protocolVersion) {
ProtocolVersion(String protocolVersion) {
this.protocolVersion = protocolVersion;
}

@Override
@Override
public String toString() {
return protocolVersion;
}
Expand Down
19 changes: 10 additions & 9 deletions core/src/main/java/feign/template/Template.java
Original file line number Diff line number Diff line change
Expand Up @@ -326,21 +326,22 @@ public String next() {
}
}

public enum EncodingOptions
{
public enum EncodingOptions {
REQUIRED(true), NOT_REQUIRED(false);

private final boolean shouldEncode;
private final boolean shouldEncode;

EncodingOptions(boolean shouldEncode) {
EncodingOptions(boolean shouldEncode) {
this.shouldEncode = shouldEncode;
}

public boolean isEncodingRequired() {
return this.shouldEncode;
}}
public boolean isEncodingRequired() {
return this.shouldEncode;
}
}

public enum ExpansionOptions{ALLOW_UNRESOLVED,REQUIRED
}
public enum ExpansionOptions {
ALLOW_UNRESOLVED, REQUIRED
}

}
3 changes: 1 addition & 2 deletions core/src/test/java/feign/FeignTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@ public class FeignTest {
@Rule
public final MockWebServer server = new MockWebServer();

private Decoder mockDecoder = mock(Decoder.class);

@Test
public void iterableQueryParams() throws Exception {
server.enqueue(new MockResponse().setBody("foo"));
Expand Down Expand Up @@ -1010,6 +1008,7 @@ public void supportComplexHeaders() throws Exception {

@Test
public void decodeVoid() throws Exception {
Decoder mockDecoder = mock(Decoder.class);
server.enqueue(new MockResponse().setResponseCode(200).setBody("OK"));

TestInterface api = new TestInterfaceBuilder().decodeVoid().decoder(mockDecoder)
Expand Down
10 changes: 5 additions & 5 deletions core/src/test/java/feign/MultipleLoggerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public void testAppendSeveralFilesToOneJavaLogger() throws Exception {
.appendToFile(tmp.newFile("1.log").getAbsolutePath())
.appendToFile(tmp.newFile("2.log").getAbsolutePath());
java.util.logging.Logger inner = getInnerLogger(logger);
assert(inner.getHandlers().length == 2);
assert (inner.getHandlers().length == 2);
}

@Test
Expand All @@ -47,9 +47,9 @@ public void testJavaLoggerInstantiationWithLoggerName() throws Exception {
Logger.JavaLogger l2 = new Logger.JavaLogger("Second client")
.appendToFile(tmp.newFile("2.log").getAbsolutePath());
java.util.logging.Logger logger1 = getInnerLogger(l1);
assert(logger1.getHandlers().length == 1);
assert (logger1.getHandlers().length == 1);
java.util.logging.Logger logger2 = getInnerLogger(l2);
assert(logger2.getHandlers().length == 1);
assert (logger2.getHandlers().length == 1);
}

@Test
Expand All @@ -59,9 +59,9 @@ public void testJavaLoggerInstantationWithClazz() throws Exception {
Logger.JavaLogger l2 = new Logger.JavaLogger(Integer.class)
.appendToFile(tmp.newFile("2.log").getAbsolutePath());
java.util.logging.Logger logger1 = getInnerLogger(l1);
assert(logger1.getHandlers().length == 1);
assert (logger1.getHandlers().length == 1);
java.util.logging.Logger logger2 = getInnerLogger(l2);
assert(logger2.getHandlers().length == 1);
assert (logger2.getHandlers().length == 1);
}

}

0 comments on commit e5b2308

Please sign in to comment.