Skip to content

Commit

Permalink
Merge 4c97b3e into 7e96f30
Browse files Browse the repository at this point in the history
  • Loading branch information
allanmckenzie committed Jul 11, 2019
2 parents 7e96f30 + 4c97b3e commit f93d7e9
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
package uk.gov.justice.services.example.cakeshop.it;

import static java.lang.Integer.valueOf;
import static java.lang.System.getProperty;
import static org.hamcrest.CoreMatchers.hasItem;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
import static uk.gov.justice.services.jmx.system.command.client.connection.JmxParametersBuilder.jmxParameters;
import static uk.gov.justice.services.test.utils.common.host.TestHostProvider.getHost;

import uk.gov.justice.services.eventstore.management.catchup.commands.CatchupCommand;
import uk.gov.justice.services.eventstore.management.indexer.commands.IndexerCatchupCommand;
import uk.gov.justice.services.eventstore.management.rebuild.commands.RebuildCommand;
import uk.gov.justice.services.jmx.command.SystemCommand;
import uk.gov.justice.services.jmx.system.command.client.SystemCommanderClient;
import uk.gov.justice.services.jmx.system.command.client.SystemCommanderClientFactory;
import uk.gov.justice.services.jmx.system.command.client.connection.JmxParametersBuilder;
import uk.gov.justice.services.management.ping.command.PingSystemCommand;
import uk.gov.justice.services.management.shuttering.command.ShutterSystemCommand;
import uk.gov.justice.services.management.shuttering.command.UnshutterSystemCommand;

import java.util.List;

import org.junit.Test;

public class ListSystemCommandsIT {

private static final String HOST = getHost();
private static final int PORT = valueOf(getProperty("random.management.port"));


private final SystemCommanderClientFactory systemCommanderClientFactory = new SystemCommanderClientFactory();

@Test
public void shouldListAllSystemCommands() throws Exception {

final JmxParametersBuilder jmxParameters = jmxParameters()
.withHost(HOST)
.withPort(PORT);

try (final SystemCommanderClient systemCommanderClient = systemCommanderClientFactory.create(jmxParameters.build())) {

final List<SystemCommand> systemCommands = systemCommanderClient.getRemote().listCommands();

assertThat(systemCommands.size(), is(6));
assertThat(systemCommands, hasItem(new PingSystemCommand()));
assertThat(systemCommands, hasItem(new ShutterSystemCommand()));
assertThat(systemCommands, hasItem(new UnshutterSystemCommand()));
assertThat(systemCommands, hasItem(new RebuildCommand()));
assertThat(systemCommands, hasItem(new CatchupCommand()));
assertThat(systemCommands, hasItem(new IndexerCatchupCommand()));
}
}
}
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@
<cpp.repo.name>cake-shop</cpp.repo.name>

<framework-api.version>4.0.0</framework-api.version>
<framework.version>6.0.0-RC2</framework.version>
<event-store.version>2.0.0-RC3</event-store.version>
<framework-generators.version>2.0.0-RC2</framework-generators.version>
<framework.version>6.0.0-RC3</framework.version>
<event-store.version>2.0.0-RC4</event-store.version>
<framework-generators.version>2.0.0-RC3</framework-generators.version>
<file.service.version>1.17.9</file.service.version>

<common-bom.version>2.3.0</common-bom.version>
Expand Down

0 comments on commit f93d7e9

Please sign in to comment.