RunApplication implements Command<DeployApplicationRequest> { String getMavenCommand(DeployApplicationRequest request) { if (!StringUtils.isBlank(request.getMainService())) { return String.format("maven:%s::%s", request.getModuleId(), request.getMainService()); } return String.format("maven:%s", request.getModuleId()); } RunApplication(final io.vertx.core.Vertx vertx, final DeployConfig deployConfig); @Override Observable<DeployApplicationRequest> executeAsync(final DeployApplicationRequest request);  }
@Test public void getMavenCommandNoMainServiceNormalMavenCommand() { String result = new RunApplication(Vertx.vertx(), config).getMavenCommand(new DeployApplicationRequest("group", "artifact", "version", "classifier", "type")); assertThat(result, is("maven:group:artifact:version")); }
@Test public void getMavenCommandWithMainServiceMavenCommandWithMainService() { String result = new RunApplication(Vertx.vertx(), config) .getMavenCommand(new DeployApplicationRequest("group", "artifact", "version", "classifier", "type") .withMainService("main_service")); assertThat(result, is("maven:group:artifact:version::main_service")); }
@Test public void getMavenCommandWithEmptyMainServiceNormalMavenCommand() { String result = new RunApplication(Vertx.vertx(), config) .getMavenCommand(new DeployApplicationRequest("group", "artifact", "version", "classifier", "type").withMainService(" ")); assertThat(result, is("maven:group:artifact:version")); }