Skip to content

Commit

Permalink
Fixing imports and making objects final
Browse files Browse the repository at this point in the history
  • Loading branch information
bkuzmic committed Dec 26, 2018
1 parent 42a47bc commit 768ac1c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
10 changes: 6 additions & 4 deletions src/main/java/com/amihaiemil/docker/RtNetworks.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@

import java.io.IOException;
import java.net.URI;
import javax.json.*;
import javax.json.Json;
import javax.json.JsonObject;
import javax.json.JsonObjectBuilder;
import org.apache.http.HttpStatus;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpPost;
Expand Down Expand Up @@ -78,7 +80,7 @@ public Network create(final String name)
@Override
public Network create(final String name, final JsonObject filters)
throws IOException, UnexpectedResponseException {
JsonObjectBuilder json = Json.createObjectBuilder();
final JsonObjectBuilder json = Json.createObjectBuilder();
json.add("Name", name);
filters.forEach(json::add);
return this.createNetwork(json);
Expand Down Expand Up @@ -138,7 +140,7 @@ private Network createNetwork(final JsonObjectBuilder json)
json.build().toString(), ContentType.APPLICATION_JSON
)
);
JsonObject createResult = this.client.execute(
final JsonObject createResult = this.client.execute(
create,
new ReadJsonObject(
new MatchStatus(
Expand All @@ -147,7 +149,7 @@ private Network createNetwork(final JsonObjectBuilder json)
)
)
);
if (createResult.size() > 0) {
if (!createResult.isEmpty()) {
return new RtNetwork(createResult,
this.client,
URI.create(
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/com/amihaiemil/docker/RtNetworksTestCase.java
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public void pruneThrowsErrorOnResponse500() throws Exception {
*/
@Test
public void createOk() throws Exception {
Network network = new ListedNetworks(
final Network network = new ListedNetworks(
new AssertRequest(
new Response(
HttpStatus.SC_CREATED,
Expand Down Expand Up @@ -150,7 +150,7 @@ public void createWithParametersOk() throws Exception {
final JsonObject labels = Json.createObjectBuilder()
.add("label1", "label one")
.add("label2", "label two").build();
Network network =
final Network network =
new ListedNetworks(
new AssertRequest(
new Response(
Expand Down

0 comments on commit 768ac1c

Please sign in to comment.