Skip to content

Commit

Permalink
Rename CmdExecCodeAllResult -> CmdExecCodeAll
Browse files Browse the repository at this point in the history
  • Loading branch information
renner committed Jul 12, 2017
1 parent a337d13 commit 94a9a08
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/main/java/com/suse/salt/netapi/calls/modules/Cmd.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.suse.salt.netapi.calls.modules;

import com.suse.salt.netapi.calls.LocalCall;
import com.suse.salt.netapi.results.CmdExecCodeAllResult;
import com.suse.salt.netapi.results.CmdExecCodeAll;

import com.google.gson.reflect.TypeToken;

Expand All @@ -16,10 +16,10 @@ public class Cmd {

private Cmd() { }

public static LocalCall<CmdExecCodeAllResult> execCodeAll(String lang, String code) {
public static LocalCall<CmdExecCodeAll> execCodeAll(String lang, String code) {
LinkedHashMap<String, Object> args = new LinkedHashMap<>();
return new LocalCall<>("cmd.exec_code_all", Optional.of(Arrays.asList(lang, code)),
Optional.of(args), new TypeToken<CmdExecCodeAllResult>(){});
Optional.of(args), new TypeToken<CmdExecCodeAll>(){});
}

public static LocalCall<String> run(String cmd) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* Result structure as returned by cmd.exec_code_all to be parsed from event data.
*/
public class CmdExecCodeAllResult {
public class CmdExecCodeAll {

private long pid;
private int retcode;
Expand Down
8 changes: 4 additions & 4 deletions src/test/java/com/suse/salt/netapi/calls/modules/CmdTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import com.suse.salt.netapi.client.SaltClient;
import com.suse.salt.netapi.datatypes.target.MinionList;
import com.suse.salt.netapi.exception.SaltException;
import com.suse.salt.netapi.results.CmdExecCodeAllResult;
import com.suse.salt.netapi.results.CmdExecCodeAll;
import com.suse.salt.netapi.results.Result;
import com.suse.salt.netapi.utils.ClientUtils;
import com.github.tomakehurst.wiremock.junit.WireMockRule;
Expand Down Expand Up @@ -125,7 +125,7 @@ public void testCmdExecCode() throws SaltException {
@Test
public void testCmdExecCodeAll() throws SaltException {
// First we get the call to use in the tests
LocalCall<CmdExecCodeAllResult> call =
LocalCall<CmdExecCodeAll> call =
Cmd.execCodeAll("python", "import sys; print sys.version");
assertEquals("cmd.exec_code_all", call.getPayload().get("fun"));

Expand All @@ -136,11 +136,11 @@ public void testCmdExecCodeAll() throws SaltException {
.withHeader("Content-Type", "application/json")
.withBody(JSON_EXEC_CODE_ALL_RESPONSE)));

Map<String, Result<CmdExecCodeAllResult>> response =
Map<String, Result<CmdExecCodeAll>> response =
call.callSync(client, new MinionList("minion"));

assertNotNull(response.get("minion"));
CmdExecCodeAllResult result = response.get("minion").result().get();
CmdExecCodeAll result = response.get("minion").result().get();
assertEquals(27299, result.getPid());
assertEquals(0, result.getRetcode());
assertEquals("", result.getStderr());
Expand Down

0 comments on commit 94a9a08

Please sign in to comment.