private void assertThatCannotLoad(String jarName, String className) {
    String artifactId = JarFileUtils.getArtifactId(jarName);
    assertThat(
        ClassPathLoader.getLatest().getJarDeploymentService().getDeployed(artifactId)
            .isSuccessful())
                .isFalse();
    assertThatThrownBy(() -> ClassPathLoader.getLatest().forName(className))
        .isExactlyInstanceOf(ClassNotFoundException.class);
  }
Unit tests for DeployCommand, UndeployCommand, ListDeployedCommand

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