adding functionality for starting microservices in debug.
diff --git a/src/main/java/org/apache/fineract/cn/test/servicestarter/IntegrationTestEnvironment.java b/src/main/java/org/apache/fineract/cn/test/servicestarter/IntegrationTestEnvironment.java
index f6a3a0c..645aede 100644
--- a/src/main/java/org/apache/fineract/cn/test/servicestarter/IntegrationTestEnvironment.java
+++ b/src/main/java/org/apache/fineract/cn/test/servicestarter/IntegrationTestEnvironment.java
@@ -41,7 +41,6 @@
 public class IntegrationTestEnvironment extends ExternalResource {
 
 
-
   static String getJava()
   {
     final String javaHome = System.getProperty("java.home");
@@ -56,6 +55,7 @@
 
   private final String tenantName;
   private int nextPort;
+  private int nextDebugPort;
   private final Set<Integer> ports;
   private final RsaKeyPairFactory.KeyPairHolder keyPairHolder;
   private final SystemSecurityEnvironment systemSecurityEnvironment;
@@ -94,6 +94,7 @@
     this.dataStoreTenantInitializers = dataStoreTenantInitializers;
 
     nextPort = 2020;
+    nextDebugPort = 3020;
     this.ports = new HashSet<>();
     //Prevent the following ports from being allocated to Microservices.
     this.ports.add(0);
@@ -128,6 +129,16 @@
     return nextPort;
   }
 
+  Integer getFreshDebugPort() {
+    while (ports.contains(nextDebugPort) || !available(nextDebugPort))
+    {
+      nextDebugPort += 1;
+    }
+
+    ports.add(nextDebugPort);
+    return nextDebugPort;
+  }
+
   private static boolean available(int port) {
     try (final Socket ignored = new Socket("localhost", port)) {
       return false;
diff --git a/src/main/java/org/apache/fineract/cn/test/servicestarter/Microservice.java b/src/main/java/org/apache/fineract/cn/test/servicestarter/Microservice.java
index 60f898f..51a4450 100644
--- a/src/main/java/org/apache/fineract/cn/test/servicestarter/Microservice.java
+++ b/src/main/java/org/apache/fineract/cn/test/servicestarter/Microservice.java
@@ -50,7 +50,8 @@
   private ApiFactory apiFactory;
   private Process process;
   private T api;
-  private String debuggingParams = null;
+  private Integer debuggingPort = null;
+  private boolean debugSuspend = false;
   private long maxWait = MAX_WAIT_DEFAULT;
 
   public Microservice(
@@ -90,7 +91,15 @@
   }
 
   public Microservice<T> debug(boolean suspend, int port) {
-    this.debuggingParams = "-agentlib:jdwp=transport=dt_socket,server=y,suspend=" + (suspend ? "y" : "n") + ",address=" + port;
+    this.debuggingPort = port;
+    this.debugSuspend = suspend;
+
+    return this;
+  }
+
+  public Microservice<T> runInDebug() {
+    this.debuggingPort = integrationTestEnvironment.getFreshDebugPort();
+    this.debugSuspend = false;
 
     return this;
   }
@@ -155,11 +164,11 @@
     final File jarFile = artifactResolver.getJarFile(artifactName, "org.apache.fineract.cn." + artifactName, "service-boot", artifactVersion);
 
     final ProcessBuilder processBuilder;
-    if (debuggingParams == null) {
+    if (debuggingPort == null) {
       processBuilder = new ProcessBuilder(IntegrationTestEnvironment.getJava(), "-jar", jarFile.getAbsolutePath());
     }
     else {
-      processBuilder = new ProcessBuilder(IntegrationTestEnvironment.getJava(), debuggingParams,
+      processBuilder = new ProcessBuilder(IntegrationTestEnvironment.getJava(), "-agentlib:jdwp=transport=dt_socket,server=y,suspend=" + (debugSuspend ? "y" : "n") + ",address=" + debuggingPort,
               "-jar", jarFile.getAbsolutePath());
     }
     processEnvironment.populateProcessEnvironment(processBuilder);
@@ -194,4 +203,21 @@
   public String name() {
     return applicationName;
   }
+
+  public Integer debuggingPort() {
+    return debuggingPort;
+  }
+
+  public String toString() {
+    final StringBuilder ret = new StringBuilder(applicationName);
+    ret.append(" address:");
+    ret.append(this.getProcessEnvironment().serverURI());
+
+    if (debuggingPort != null) {
+      ret.append(", debuggingPort: ");
+      ret.append(debuggingPort);
+    }
+
+    return ret.toString();
+  }
 }