@Test
  public void deployJarToOneGroup() throws Exception {
    // Deploy a jar to a single group
    gfshConnector.executeAndAssertThat("deploy --jar=" + jar2 + " --group=" + GROUP1)
        .statusIsSuccess();
    String resultString = gfshConnector.getGfshOutput();

    assertThat(resultString).contains(server1.getName());
    assertThat(resultString).doesNotContain(server2.getName());
    assertThat(resultString).contains(jarName2);

    server1.invoke(() -> assertThatCanLoad(jarName2, class2));
    server2.invoke(() -> assertThatCannotLoad(jarName2, class2));
  }
Unit tests for DeployCommand, UndeployCommand, ListDeployedCommand

@since GemFire 7.0
geode-gfsh/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/DeployWithGroupsDUnitTest.java