@Test public void shouldShowMap() throws Exception { Logger logger = mock( Logger.class ); when( logger.isDebugEnabled() ).thenReturn( true ); doNothing().when( logger ).debug( anyString() ); AbstractSurefireMojo mojo = spy( this.mojo ); when( mojo.getConsoleLogger() ).thenReturn( new PluginConsoleLogger( logger ) ); Map<String, String> map = new LinkedHashMap<>(); map.put( "ABC", "123" ); map.put( "XYZ", "987" ); invokeMethod( mojo, "showMap", map, "prefix" ); ArgumentCaptor<String> argument = ArgumentCaptor.forClass( String.class ); verify( logger, times( 2 ) ).debug( argument.capture() ); assertThat( argument.getAllValues() ) .containsExactly( "Setting prefix [ABC]=[123]", "Setting prefix [XYZ]=[987]" ); }
@Nonnull protected final PluginConsoleLogger getConsoleLogger() { if ( consoleLogger == null ) { synchronized ( this ) { if ( consoleLogger == null ) { consoleLogger = new PluginConsoleLogger( logger ); } } } return consoleLogger; }
AbstractSurefireMojo extends AbstractMojo implements SurefireExecutionParameters { @Nonnull protected final PluginConsoleLogger getConsoleLogger() { if ( consoleLogger == null ) { synchronized ( this ) { if ( consoleLogger == null ) { consoleLogger = new PluginConsoleLogger( logger ); } } } return consoleLogger; } }
AbstractSurefireMojo extends AbstractMojo implements SurefireExecutionParameters { @Nonnull protected final PluginConsoleLogger getConsoleLogger() { if ( consoleLogger == null ) { synchronized ( this ) { if ( consoleLogger == null ) { consoleLogger = new PluginConsoleLogger( logger ); } } } return consoleLogger; }  }
AbstractSurefireMojo extends AbstractMojo implements SurefireExecutionParameters { @Nonnull protected final PluginConsoleLogger getConsoleLogger() { if ( consoleLogger == null ) { synchronized ( this ) { if ( consoleLogger == null ) { consoleLogger = new PluginConsoleLogger( logger ); } } } return consoleLogger; }  @Override abstract List<String> getIncludes(); abstract File getIncludesFile(); @Override abstract void setIncludes( List<String> includes ); abstract File getExcludesFile(); abstract File[] getSuiteXmlFiles(); abstract void setSuiteXmlFiles( File[] suiteXmlFiles ); abstract String getRunOrder(); abstract void setRunOrder( String runOrder ); abstract Long getRunOrderRandomSeed(); abstract void setRunOrderRandomSeed( Long runOrderRandomSeed ); @Override void execute(); static SurefireProperties createCopyAndReplaceForkNumPlaceholder(
        SurefireProperties effectiveSystemProperties, int threadNumber ); RepositorySystem getRepositorySystem(); void setRepositorySystem( RepositorySystem repositorySystem ); DependencyResolver getDependencyResolver(); void setDependencyResolver( DependencyResolver dependencyResolver ); TestListResolver getSpecificTests(); @Override List<String> getExcludes(); @Override void setExcludes( List<String> excludes ); @Override ArtifactRepository getLocalRepository(); @Override void setLocalRepository( ArtifactRepository localRepository ); Properties getSystemProperties(); @SuppressWarnings( "UnusedDeclaration" ) void setSystemProperties( Properties systemProperties ); Map<String, String> getSystemPropertyVariables(); @SuppressWarnings( "UnusedDeclaration" ) void setSystemPropertyVariables( Map<String, String> systemPropertyVariables ); abstract File getSystemPropertiesFile(); @SuppressWarnings( "UnusedDeclaration" ) abstract void setSystemPropertiesFile( File systemPropertiesFile ); void setProperties( Properties properties ); Map<String, Artifact> getPluginArtifactMap(); @SuppressWarnings( "UnusedDeclaration" ) void setPluginArtifactMap( Map<String, Artifact> pluginArtifactMap ); Map<String, Artifact> getProjectArtifactMap(); @SuppressWarnings( "UnusedDeclaration" ) void setProjectArtifactMap( Map<String, Artifact> projectArtifactMap ); String getReportNameSuffix(); @SuppressWarnings( "UnusedDeclaration" ) void setReportNameSuffix( String reportNameSuffix ); boolean isRedirectTestOutputToFile(); @SuppressWarnings( "UnusedDeclaration" ) void setRedirectTestOutputToFile( boolean redirectTestOutputToFile ); Boolean getFailIfNoTests(); void setFailIfNoTests( boolean failIfNoTests ); String getForkMode(); @SuppressWarnings( "UnusedDeclaration" ) void setForkMode( String forkMode ); String getJvm(); String getArgLine(); @SuppressWarnings( "UnusedDeclaration" ) void setArgLine( String argLine ); Map<String, String> getEnvironmentVariables(); @SuppressWarnings( "UnusedDeclaration" ) void setEnvironmentVariables( Map<String, String> environmentVariables ); File getWorkingDirectory(); @SuppressWarnings( "UnusedDeclaration" ) void setWorkingDirectory( File workingDirectory ); boolean isChildDelegation(); @SuppressWarnings( "UnusedDeclaration" ) void setChildDelegation( boolean childDelegation ); String getGroups(); @SuppressWarnings( "UnusedDeclaration" ) void setGroups( String groups ); String getExcludedGroups(); @SuppressWarnings( "UnusedDeclaration" ) void setExcludedGroups( String excludedGroups ); String getJunitArtifactName(); @SuppressWarnings( "UnusedDeclaration" ) void setJunitArtifactName( String junitArtifactName ); String getTestNGArtifactName(); @SuppressWarnings( "UnusedDeclaration" ) void setTestNGArtifactName( String testNGArtifactName ); int getThreadCount(); @SuppressWarnings( "UnusedDeclaration" ) void setThreadCount( int threadCount ); boolean getPerCoreThreadCount(); @SuppressWarnings( "UnusedDeclaration" ) void setPerCoreThreadCount( boolean perCoreThreadCount ); boolean getUseUnlimitedThreads(); @SuppressWarnings( "UnusedDeclaration" ) void setUseUnlimitedThreads( boolean useUnlimitedThreads ); String getParallel(); @SuppressWarnings( "UnusedDeclaration" ) void setParallel( String parallel ); boolean isParallelOptimized(); @SuppressWarnings( "UnusedDeclaration" ) void setParallelOptimized( boolean parallelOptimized ); int getThreadCountSuites(); void setThreadCountSuites( int threadCountSuites ); int getThreadCountClasses(); void setThreadCountClasses( int threadCountClasses ); int getThreadCountMethods(); void setThreadCountMethods( int threadCountMethods ); boolean isTrimStackTrace(); @SuppressWarnings( "UnusedDeclaration" ) void setTrimStackTrace( boolean trimStackTrace ); List<ArtifactRepository> getProjectRemoteRepositories(); @SuppressWarnings( "UnusedDeclaration" ) void setProjectRemoteRepositories( List<ArtifactRepository> projectRemoteRepositories ); List<ArtifactRepository> getRemoteRepositories(); @SuppressWarnings( "UnusedDeclaration" ) void setRemoteRepositories( List<ArtifactRepository> remoteRepositories ); boolean isDisableXmlReport(); @SuppressWarnings( "UnusedDeclaration" ) void setDisableXmlReport( boolean disableXmlReport ); boolean isEnableAssertions(); boolean effectiveIsEnableAssertions(); @SuppressWarnings( "UnusedDeclaration" ) void setEnableAssertions( boolean enableAssertions ); MavenSession getSession(); @SuppressWarnings( "UnusedDeclaration" ) void setSession( MavenSession session ); String getObjectFactory(); @SuppressWarnings( "UnusedDeclaration" ) void setObjectFactory( String objectFactory ); ToolchainManager getToolchainManager(); @SuppressWarnings( "UnusedDeclaration" ) void setToolchainManager( ToolchainManager toolchainManager ); boolean isMavenParallel(); String[] getDependenciesToScan(); void setDependenciesToScan( String[] dependenciesToScan ); PluginDescriptor getPluginDescriptor(); MavenProject getProject(); @SuppressWarnings( "UnusedDeclaration" ) void setProject( MavenProject project ); @Override File getTestSourceDirectory(); @Override void setTestSourceDirectory( File testSourceDirectory ); String getForkCount(); boolean isReuseForks(); String[] getAdditionalClasspathElements(); void setAdditionalClasspathElements( String[] additionalClasspathElements ); String[] getClasspathDependencyExcludes(); void setClasspathDependencyExcludes( String[] classpathDependencyExcludes ); String getClasspathDependencyScopeExclude(); void setClasspathDependencyScopeExclude( String classpathDependencyScopeExclude ); File getProjectBuildDirectory(); void setProjectBuildDirectory( File projectBuildDirectory ); Map<String, String> getJdkToolchain(); void setJdkToolchain( Map<String, String> jdkToolchain ); String getTempDir(); void setTempDir( String tempDir ); }
AbstractSurefireMojo extends AbstractMojo implements SurefireExecutionParameters { @Nonnull protected final PluginConsoleLogger getConsoleLogger() { if ( consoleLogger == null ) { synchronized ( this ) { if ( consoleLogger == null ) { consoleLogger = new PluginConsoleLogger( logger ); } } } return consoleLogger; }  @Override abstract List<String> getIncludes(); abstract File getIncludesFile(); @Override abstract void setIncludes( List<String> includes ); abstract File getExcludesFile(); abstract File[] getSuiteXmlFiles(); abstract void setSuiteXmlFiles( File[] suiteXmlFiles ); abstract String getRunOrder(); abstract void setRunOrder( String runOrder ); abstract Long getRunOrderRandomSeed(); abstract void setRunOrderRandomSeed( Long runOrderRandomSeed ); @Override void execute(); static SurefireProperties createCopyAndReplaceForkNumPlaceholder(
        SurefireProperties effectiveSystemProperties, int threadNumber ); RepositorySystem getRepositorySystem(); void setRepositorySystem( RepositorySystem repositorySystem ); DependencyResolver getDependencyResolver(); void setDependencyResolver( DependencyResolver dependencyResolver ); TestListResolver getSpecificTests(); @Override List<String> getExcludes(); @Override void setExcludes( List<String> excludes ); @Override ArtifactRepository getLocalRepository(); @Override void setLocalRepository( ArtifactRepository localRepository ); Properties getSystemProperties(); @SuppressWarnings( "UnusedDeclaration" ) void setSystemProperties( Properties systemProperties ); Map<String, String> getSystemPropertyVariables(); @SuppressWarnings( "UnusedDeclaration" ) void setSystemPropertyVariables( Map<String, String> systemPropertyVariables ); abstract File getSystemPropertiesFile(); @SuppressWarnings( "UnusedDeclaration" ) abstract void setSystemPropertiesFile( File systemPropertiesFile ); void setProperties( Properties properties ); Map<String, Artifact> getPluginArtifactMap(); @SuppressWarnings( "UnusedDeclaration" ) void setPluginArtifactMap( Map<String, Artifact> pluginArtifactMap ); Map<String, Artifact> getProjectArtifactMap(); @SuppressWarnings( "UnusedDeclaration" ) void setProjectArtifactMap( Map<String, Artifact> projectArtifactMap ); String getReportNameSuffix(); @SuppressWarnings( "UnusedDeclaration" ) void setReportNameSuffix( String reportNameSuffix ); boolean isRedirectTestOutputToFile(); @SuppressWarnings( "UnusedDeclaration" ) void setRedirectTestOutputToFile( boolean redirectTestOutputToFile ); Boolean getFailIfNoTests(); void setFailIfNoTests( boolean failIfNoTests ); String getForkMode(); @SuppressWarnings( "UnusedDeclaration" ) void setForkMode( String forkMode ); String getJvm(); String getArgLine(); @SuppressWarnings( "UnusedDeclaration" ) void setArgLine( String argLine ); Map<String, String> getEnvironmentVariables(); @SuppressWarnings( "UnusedDeclaration" ) void setEnvironmentVariables( Map<String, String> environmentVariables ); File getWorkingDirectory(); @SuppressWarnings( "UnusedDeclaration" ) void setWorkingDirectory( File workingDirectory ); boolean isChildDelegation(); @SuppressWarnings( "UnusedDeclaration" ) void setChildDelegation( boolean childDelegation ); String getGroups(); @SuppressWarnings( "UnusedDeclaration" ) void setGroups( String groups ); String getExcludedGroups(); @SuppressWarnings( "UnusedDeclaration" ) void setExcludedGroups( String excludedGroups ); String getJunitArtifactName(); @SuppressWarnings( "UnusedDeclaration" ) void setJunitArtifactName( String junitArtifactName ); String getTestNGArtifactName(); @SuppressWarnings( "UnusedDeclaration" ) void setTestNGArtifactName( String testNGArtifactName ); int getThreadCount(); @SuppressWarnings( "UnusedDeclaration" ) void setThreadCount( int threadCount ); boolean getPerCoreThreadCount(); @SuppressWarnings( "UnusedDeclaration" ) void setPerCoreThreadCount( boolean perCoreThreadCount ); boolean getUseUnlimitedThreads(); @SuppressWarnings( "UnusedDeclaration" ) void setUseUnlimitedThreads( boolean useUnlimitedThreads ); String getParallel(); @SuppressWarnings( "UnusedDeclaration" ) void setParallel( String parallel ); boolean isParallelOptimized(); @SuppressWarnings( "UnusedDeclaration" ) void setParallelOptimized( boolean parallelOptimized ); int getThreadCountSuites(); void setThreadCountSuites( int threadCountSuites ); int getThreadCountClasses(); void setThreadCountClasses( int threadCountClasses ); int getThreadCountMethods(); void setThreadCountMethods( int threadCountMethods ); boolean isTrimStackTrace(); @SuppressWarnings( "UnusedDeclaration" ) void setTrimStackTrace( boolean trimStackTrace ); List<ArtifactRepository> getProjectRemoteRepositories(); @SuppressWarnings( "UnusedDeclaration" ) void setProjectRemoteRepositories( List<ArtifactRepository> projectRemoteRepositories ); List<ArtifactRepository> getRemoteRepositories(); @SuppressWarnings( "UnusedDeclaration" ) void setRemoteRepositories( List<ArtifactRepository> remoteRepositories ); boolean isDisableXmlReport(); @SuppressWarnings( "UnusedDeclaration" ) void setDisableXmlReport( boolean disableXmlReport ); boolean isEnableAssertions(); boolean effectiveIsEnableAssertions(); @SuppressWarnings( "UnusedDeclaration" ) void setEnableAssertions( boolean enableAssertions ); MavenSession getSession(); @SuppressWarnings( "UnusedDeclaration" ) void setSession( MavenSession session ); String getObjectFactory(); @SuppressWarnings( "UnusedDeclaration" ) void setObjectFactory( String objectFactory ); ToolchainManager getToolchainManager(); @SuppressWarnings( "UnusedDeclaration" ) void setToolchainManager( ToolchainManager toolchainManager ); boolean isMavenParallel(); String[] getDependenciesToScan(); void setDependenciesToScan( String[] dependenciesToScan ); PluginDescriptor getPluginDescriptor(); MavenProject getProject(); @SuppressWarnings( "UnusedDeclaration" ) void setProject( MavenProject project ); @Override File getTestSourceDirectory(); @Override void setTestSourceDirectory( File testSourceDirectory ); String getForkCount(); boolean isReuseForks(); String[] getAdditionalClasspathElements(); void setAdditionalClasspathElements( String[] additionalClasspathElements ); String[] getClasspathDependencyExcludes(); void setClasspathDependencyExcludes( String[] classpathDependencyExcludes ); String getClasspathDependencyScopeExclude(); void setClasspathDependencyScopeExclude( String classpathDependencyScopeExclude ); File getProjectBuildDirectory(); void setProjectBuildDirectory( File projectBuildDirectory ); Map<String, String> getJdkToolchain(); void setJdkToolchain( Map<String, String> jdkToolchain ); String getTempDir(); void setTempDir( String tempDir );  }