Skip to content
This repository has been archived by the owner on May 26, 2020. It is now read-only.

Commit

Permalink
Merge cdbb087 into 1195197
Browse files Browse the repository at this point in the history
  • Loading branch information
allanmckenzie committed Oct 31, 2019
2 parents 1195197 + cdbb087 commit 55697ec
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ on [Keep a CHANGELOG](http://keepachangelog.com/). This project adheres to

## [Unreleased]

## [2.2.4] - 2019-10-31
### Changed
- Update to framework 6.2.3

## [2.2.3] - 2019-10-24
### Changed
- Update to framework 6.2.2
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<cpp.repo.name>framework-jmx-command-client</cpp.repo.name>

<framework-api.version>4.1.0</framework-api.version>
<framework.version>6.2.2</framework.version>
<framework.version>6.2.3</framework.version>
<maven-common-bom.version>2.4.0</maven-common-bom.version>
</properties>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import uk.gov.justice.framework.command.client.io.ToConsolePrinter;
import uk.gov.justice.services.jmx.api.SystemCommandInvocationFailedException;
import uk.gov.justice.services.jmx.api.UnsupportedSystemCommandException;
import uk.gov.justice.services.jmx.api.UnrunnableSystemCommandException;
import uk.gov.justice.services.jmx.api.command.SystemCommand;
import uk.gov.justice.services.jmx.api.mbean.SystemCommanderMBean;
import uk.gov.justice.services.jmx.system.command.client.SystemCommanderClient;
Expand Down Expand Up @@ -45,7 +45,7 @@ public void runSystemCommand(final SystemCommand systemCommand, final JmxParamet
toConsolePrinter.printf("System command '%s' with id '%s' successfully sent to %s", commandName, commandId, contextName);
commandPoller.runUntilComplete(systemCommanderMBean, commandId, systemCommand);

} catch (final UnsupportedSystemCommandException e) {
} catch (final UnrunnableSystemCommandException e) {
toConsolePrinter.printf("The command '%s' is not supported on this %s context", commandName, contextName);
throw e;
} catch (final SystemCommandInvocationFailedException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

import uk.gov.justice.framework.command.client.io.ToConsolePrinter;
import uk.gov.justice.services.jmx.api.SystemCommandInvocationFailedException;
import uk.gov.justice.services.jmx.api.UnsupportedSystemCommandException;
import uk.gov.justice.services.jmx.api.UnrunnableSystemCommandException;
import uk.gov.justice.services.jmx.api.command.PingCommand;
import uk.gov.justice.services.jmx.api.command.SystemCommand;
import uk.gov.justice.services.jmx.api.mbean.SystemCommanderMBean;
Expand Down Expand Up @@ -131,7 +131,7 @@ public void shouldLogIfUsingCredentials() throws Exception {
inOrder.verify(commandPoller).runUntilComplete(systemCommanderMBean, commandId, systemCommand);
}

@Test(expected = UnsupportedSystemCommandException.class)
@Test(expected = UnrunnableSystemCommandException.class)
public void shouldLogIfTheCommandIsUnsupported() throws Exception {

final String contextName = "secret";
Expand All @@ -141,7 +141,7 @@ public void shouldLogIfTheCommandIsUnsupported() throws Exception {
final SystemCommand systemCommand = new PingCommand();
final String commandName = systemCommand.getName();

final UnsupportedSystemCommandException unsupportedSystemCommandException = new UnsupportedSystemCommandException("Ooops");
final UnrunnableSystemCommandException unrunnableSystemCommandException = new UnrunnableSystemCommandException("Ooops");

final Credentials credentials = mock(Credentials.class);
final JmxParameters jmxParameters = mock(JmxParameters.class);
Expand All @@ -155,7 +155,7 @@ public void shouldLogIfTheCommandIsUnsupported() throws Exception {
when(credentials.getUsername()).thenReturn(username);
when(systemCommanderClientFactory.create(jmxParameters)).thenReturn(systemCommanderClient);
when(systemCommanderClient.getRemote(contextName)).thenReturn(systemCommanderMBean);
doThrow(unsupportedSystemCommandException).when(systemCommanderMBean).call(systemCommand);
doThrow(unrunnableSystemCommandException).when(systemCommanderMBean).call(systemCommand);

systemCommandInvoker.runSystemCommand(systemCommand, jmxParameters);

Expand Down

0 comments on commit 55697ec

Please sign in to comment.