Skip to content

Commit

Permalink
Remove unused imports and make other static analysis fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Karl DeBisschop authored and kdebisschop committed Apr 20, 2020
1 parent 19e0de0 commit cb81709
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 22 deletions.
2 changes: 0 additions & 2 deletions src/main/java/com/bioraft/rundeck/rancher/Errors.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ private Errors() {

public enum ErrorCause implements FailureReason {
UNSUPPORTED_OPERATING_SYSTEM,
UNSUPPORTED_NODE_TYPE,
INVALID_CONFIGURATION,
INVALID_JSON,
IO_EXCEPTION,
Expand All @@ -48,7 +47,6 @@ public enum ErrorCause implements FailureReason {
INTERRUPTED,
INVALID_STACK_NAME,
INVALID_ENVIRONMENT_NAME,
AUTHENTICATION_FAILURE,
CONNECTION_FAILURE
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
import static com.bioraft.rundeck.rancher.Constants.CONFIG_SECRETKEY_PATH;

public class RancherCredentials {
private String accessKey;
private String secretKey;
private final String accessKey;
private final String secretKey;

public RancherCredentials(ExecutionContext context, Map<String, String> nodeAttributes) throws IOException {
Storage storage = new Storage(context);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ public class RancherNodeExecutorPlugin implements NodeExecutor, Describable {
DESC = builder.build();
}

private RancherWebSocketListener socketListener;
private RancherWebSocketListener fileCopier;
private Storage storage;
private final RancherWebSocketListener socketListener;
private final RancherWebSocketListener fileCopier;
private final Storage storage;
private String accessKey;
private String secretKey;
private ExecutionListener listener;
Expand Down
5 changes: 0 additions & 5 deletions src/main/java/com/bioraft/rundeck/rancher/Service.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import java.util.Map;

import static org.junit.Assert.*;
import static org.mockito.ArgumentMatchers.any;
import static com.bioraft.rundeck.rancher.TestHelper.*;
import static org.mockito.Mockito.*;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,15 +163,13 @@ public void testPostFailure() throws IOException, NodeStepException {
}

@Test(expected = NodeStepException.class)
public void testNoKey() throws IOException, NodeStepException {
public void testNoKey() throws NodeStepException {
cfg.put("action", "restart");
map.remove(CONFIG_ACCESSKEY_PATH);
// ObjectMapper mapper = new ObjectMapper();

// String text = readFromInputStream(getResourceStream("service.json"));
// ObjectNode json1 = (ObjectNode) mapper.readTree(text);

// when(client.get(any())).thenReturn(json1);
// ObjectMapper mapper = new ObjectMapper();
// String text = readFromInputStream(getResourceStream("service.json"));
// ObjectNode json1 = (ObjectNode) mapper.readTree(text);
// when(client.get(any())).thenReturn(json1);

try {
RancherManageService subject = new RancherManageService(client);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import static com.bioraft.rundeck.rancher.Constants.*;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.mockito.ArgumentMatchers.*;
import static org.mockito.Mockito.*;

@RunWith(MockitoJUnitRunner.class)
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/com/bioraft/rundeck/rancher/TestHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public static JsonNode resourceToJson(String resource) {
return null;
}
}

private static String getResourceStream(String resource) {
String path = "src/test/resources/" + resource;
try {
Expand Down

0 comments on commit cb81709

Please sign in to comment.