@Test public void testPublisherWithNApisShouldCallNtimesMethodProcessApi() throws MojoExecutionException, AppException { final Publication publication = createPublication().setApis( Arrays.asList(new Api().setApiSpecification("api1").setApiConfig("config1"), new Api().setApiSpecification("spec2").setApiConfig("config2"), new Api().setApiSpecification("spec3").setApiConfig("config3"))); when(publicationReader.read(any(String.class), any())).thenReturn(publication); sut.execute(); verify(axwayPublishingAdapter, times(publication.getApis().size())).processApi(any(), anyString()); }
public void execute() throws MojoExecutionException { getLog().info("Starting Axway Publisher"); AxwayPublishingAdapter adapter = getAxwayPublishingAdapter(); PublicationReader publicationReader = getPublicationReader(); try { final Publication publication = publicationReader.read(getStageConfigurationFile(), Publication.class); initApis(publication.getApis()); adapter.initOptionsAndArgs(publication); getLog().info(publication.toString()); publish(publication.getApis(), publication.getStage()); } catch (AbstractPublishingPluginException e) { throw e; } }
Publisher extends AbstractMojo { public void execute() throws MojoExecutionException { getLog().info("Starting Axway Publisher"); AxwayPublishingAdapter adapter = getAxwayPublishingAdapter(); PublicationReader publicationReader = getPublicationReader(); try { final Publication publication = publicationReader.read(getStageConfigurationFile(), Publication.class); initApis(publication.getApis()); adapter.initOptionsAndArgs(publication); getLog().info(publication.toString()); publish(publication.getApis(), publication.getStage()); } catch (AbstractPublishingPluginException e) { throw e; } } }
Publisher extends AbstractMojo { public void execute() throws MojoExecutionException { getLog().info("Starting Axway Publisher"); AxwayPublishingAdapter adapter = getAxwayPublishingAdapter(); PublicationReader publicationReader = getPublicationReader(); try { final Publication publication = publicationReader.read(getStageConfigurationFile(), Publication.class); initApis(publication.getApis()); adapter.initOptionsAndArgs(publication); getLog().info(publication.toString()); publish(publication.getApis(), publication.getStage()); } catch (AbstractPublishingPluginException e) { throw e; } }  }
Publisher extends AbstractMojo { public void execute() throws MojoExecutionException { getLog().info("Starting Axway Publisher"); AxwayPublishingAdapter adapter = getAxwayPublishingAdapter(); PublicationReader publicationReader = getPublicationReader(); try { final Publication publication = publicationReader.read(getStageConfigurationFile(), Publication.class); initApis(publication.getApis()); adapter.initOptionsAndArgs(publication); getLog().info(publication.toString()); publish(publication.getApis(), publication.getStage()); } catch (AbstractPublishingPluginException e) { throw e; } }  void execute(); PublicationReader getPublicationReader(); String getStageConfigurationFile(); void setStageConfigurationFile(final String stageConfiguationFile); MavenProject getProject(); void setProject(final MavenProject project); }
Publisher extends AbstractMojo { public void execute() throws MojoExecutionException { getLog().info("Starting Axway Publisher"); AxwayPublishingAdapter adapter = getAxwayPublishingAdapter(); PublicationReader publicationReader = getPublicationReader(); try { final Publication publication = publicationReader.read(getStageConfigurationFile(), Publication.class); initApis(publication.getApis()); adapter.initOptionsAndArgs(publication); getLog().info(publication.toString()); publish(publication.getApis(), publication.getStage()); } catch (AbstractPublishingPluginException e) { throw e; } }  void execute(); PublicationReader getPublicationReader(); String getStageConfigurationFile(); void setStageConfigurationFile(final String stageConfiguationFile); MavenProject getProject(); void setProject(final MavenProject project);  }