Skip to content

Commit

Permalink
Mark remaining test classes private (dropwizard#4273)
Browse files Browse the repository at this point in the history
This is the last batch which Sonar is unhappy about.

Since JUnit 5, test classes and methods needn't be public
  • Loading branch information
rhowe authored Sep 14, 2021
1 parent 5716754 commit 4907ed5
Show file tree
Hide file tree
Showing 87 changed files with 94 additions and 94 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

public class LayoutIntegrationTests {
class LayoutIntegrationTests {

static {
BootstrapLogging.bootstrap(Level.INFO, new EventJsonLayoutBaseFactory());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import static org.assertj.core.api.Assertions.entry;
import static org.mockito.Mockito.when;

public class AccessJsonLayoutTest {
class AccessJsonLayoutTest {

private String remoteHost = "nw-4.us.crawl.io";
private String serverName = "sw-2.us.api.example.io";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

public class EventJsonLayoutTest {
class EventJsonLayoutTest {
private static final String timestamp = "2018-01-02T15:19:21.000+0000";
private static final String logger = "com.example.user.service";
private static final String message = "User[18] has been registered";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import static org.assertj.core.api.Assertions.assertThat;

public class ExceptionFormatTest {
class ExceptionFormatTest {

@Test
void testDefaults() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

import static org.assertj.core.api.Assertions.assertThat;

public class JsonFormatterTest {
class JsonFormatterTest {

private final SortedMap<String, Object> map = new TreeMap<>(Maps.of(
"name", "Jim",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.entry;

public class MapBuilderTest {
class MapBuilderTest {

private int size = 4;
private TimestampFormatter timestampFormatter = new TimestampFormatter("yyyy-MM-dd'T'HH:mm:ss.SSSZ", ZoneId.of("UTC"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import static org.assertj.core.api.Assertions.assertThat;

public class TimestampFormatterTest {
class TimestampFormatterTest {

private final long timestamp = 1513956631000L;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import org.junit.jupiter.api.Test;

public class AutoCloseableManagerTest {
class AutoCloseableManagerTest {

private final AutoCloseable managed = mock(AutoCloseable.class);
private final AutoCloseableManager closeableManager = new AutoCloseableManager(this.managed);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

import io.dropwizard.util.Duration;

public class ExecutorServiceManagerTest {
class ExecutorServiceManagerTest {

private static final Duration TEST_DURATION = Duration.seconds(1L);
private final ExecutorService exec = mock(ExecutorService.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import static org.mockito.Mockito.inOrder;
import static org.mockito.Mockito.mock;

public class JettyManagedTest {
class JettyManagedTest {
private final Managed managed = mock(Managed.class);
private final JettyManaged jettyManaged = new JettyManaged(managed);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;

public class LifecycleEnvironmentTest {
class LifecycleEnvironmentTest {

private final LifecycleEnvironment environment = new LifecycleEnvironment(new MetricRegistry());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

public class ScheduledExecutorServiceBuilderTest {
class ScheduledExecutorServiceBuilderTest {

private static final Duration DEFAULT_SHUTDOWN_PERIOD = Duration.seconds(5L);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

import static org.assertj.core.api.Assertions.assertThat;

public class AppenderFactoryCustomTimeZoneTest {
class AppenderFactoryCustomTimeZoneTest {

static {
BootstrapLogging.bootstrap();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

import static org.assertj.core.api.Assertions.assertThat;

public class ConsoleAppenderFactoryTest {
class ConsoleAppenderFactoryTest {
static {
BootstrapLogging.bootstrap();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.Assumptions.assumeTrue;

public class DefaultLoggingFactoryPrintErrorMessagesTest {
class DefaultLoggingFactoryPrintErrorMessagesTest {
private DefaultLoggingFactory factory;
private ByteArrayOutputStream output;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

import static org.assertj.core.api.Assertions.assertThat;

public class DefaultLoggingFactoryTest {
class DefaultLoggingFactoryTest {
private final ObjectMapper objectMapper = Jackson.newObjectMapper();
private final YamlConfigurationFactory<DefaultLoggingFactory> factory = new YamlConfigurationFactory<>(
DefaultLoggingFactory.class,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;

public class DropwizardLayoutTest {
class DropwizardLayoutTest {
private final LoggerContext context = mock(LoggerContext.class);
private final TimeZone timeZone = TimeZone.getTimeZone("UTC");
private final DropwizardLayout layout = new DropwizardLayout(context, timeZone);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

import static org.assertj.core.api.Assertions.assertThat;

public class ExternalLoggingFactoryTest {
class ExternalLoggingFactoryTest {

@Test
void canBeDeserialized() throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

import static org.assertj.core.api.Assertions.assertThat;

public class PrefixedExtendedThrowableProxyConverterTest {
class PrefixedExtendedThrowableProxyConverterTest {
private final PrefixedExtendedThrowableProxyConverter converter = new PrefixedExtendedThrowableProxyConverter();
private final ThrowableProxy proxy = new ThrowableProxy(new IOException("noo"));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
/**
* Tests {@link PrefixedRootCauseFirstThrowableProxyConverter}.
*/
public class PrefixedRootCauseFirstThrowableProxyConverterTest {
class PrefixedRootCauseFirstThrowableProxyConverterTest {

private final PrefixedRootCauseFirstThrowableProxyConverter converter
= new PrefixedRootCauseFirstThrowableProxyConverter();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

import static org.assertj.core.api.Assertions.assertThat;

public class PrefixedThrowableProxyConverterTest {
class PrefixedThrowableProxyConverterTest {
private final PrefixedThrowableProxyConverter converter = new PrefixedThrowableProxyConverter();
private final ThrowableProxy proxy = new ThrowableProxy(new IOException("noo"));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatCode;

public class SyslogAppenderFactoryTest {
class SyslogAppenderFactoryTest {

static {
BootstrapLogging.bootstrap();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

import static org.assertj.core.api.Assertions.assertThat;

public class TlsSocketAppenderFactoryTest {
class TlsSocketAppenderFactoryTest {

public TcpServer tcpServer = new TcpServer(createServerSocket());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.Assertions.fail;

public class UdpSocketAppenderFactoryTest {
class UdpSocketAppenderFactoryTest {

private static final int UDP_PORT = 32144;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import static java.nio.charset.StandardCharsets.UTF_8;
import static org.assertj.core.api.Assertions.assertThat;

public class DropwizardUdpSocketAppenderTest {
class DropwizardUdpSocketAppenderTest {

private OutputStreamAppender<ILoggingEvent> udpStreamAppender;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;

public class GraphiteReporterFactoryTest {
class GraphiteReporterFactoryTest {

private final GraphiteReporter.Builder builderSpy = mock(GraphiteReporter.Builder.class);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;

public class BaseReporterFactoryTest {
class BaseReporterFactoryTest {
private static final Set<String> INCLUDES = Sets.of("inc", "both", "inc.+");
private static final Set<String> EXCLUDES = Sets.of("exc", "both", "exc.+");
private static final Set<String> EMPTY = Collections.emptySet();

public static Stream<Arguments> data() {
static Stream<Arguments> data() {

return Stream.of(
/*
Expand Down Expand Up @@ -85,7 +85,7 @@ public ScheduledReporter build(MetricRegistry registry) {

@ParameterizedTest
@MethodSource("data")
public void testDefaultMatching(Set<String> includes, Set<String> excludes, String name,
void testDefaultMatching(Set<String> includes, Set<String> excludes, String name,
boolean expectedDefaultResult, boolean expectedRegexResult,
boolean expectedSubstringResult, String msg) {
factory.setIncludes(includes);
Expand All @@ -100,7 +100,7 @@ public void testDefaultMatching(Set<String> includes, Set<String> excludes, Stri

@ParameterizedTest
@MethodSource("data")
public void testRegexMatching(Set<String> includes, Set<String> excludes, String name,
void testRegexMatching(Set<String> includes, Set<String> excludes, String name,
boolean expectedDefaultResult, boolean expectedRegexResult,
boolean expectedSubstringResult, String msg) {
factory.setIncludes(includes);
Expand All @@ -115,7 +115,7 @@ public void testRegexMatching(Set<String> includes, Set<String> excludes, String

@ParameterizedTest
@MethodSource("data")
public void tesSubstringMatching(Set<String> includes, Set<String> excludes, String name,
void tesSubstringMatching(Set<String> includes, Set<String> excludes, String name,
boolean expectedDefaultResult, boolean expectedRegexResult,
boolean expectedSubstringResult, String msg) {
factory.setIncludes(includes);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import static org.assertj.core.api.Assertions.assertThat;

public class ConsoleReporterFactoryTest {
class ConsoleReporterFactoryTest {
@Test
void isDiscoverable() throws Exception {
assertThat(new DiscoverableSubtypeResolver().getDiscoveredSubtypes())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

import static org.assertj.core.api.Assertions.assertThat;

public class CsvReporterFactoryTest {
class CsvReporterFactoryTest {
private final ObjectMapper objectMapper = Jackson.newObjectMapper();
private final YamlConfigurationFactory<MetricsFactory> factory =
new YamlConfigurationFactory<>(MetricsFactory.class,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

import static org.assertj.core.api.Assertions.assertThat;

public class MetricAttributesTest {
class MetricAttributesTest {

private static final EnumSet<MetricAttribute> ALL = EnumSet.allOf(MetricAttribute.class);
private static final EnumSet<MetricAttribute> NONE = EnumSet.noneOf(MetricAttribute.class);
Expand All @@ -36,7 +36,7 @@ public ScheduledReporter build(MetricRegistry registry) {

@ParameterizedTest
@MethodSource("data")
public void testGetDisabledAttributes(EnumSet<MetricAttribute> includes, EnumSet<MetricAttribute> excludes,
void testGetDisabledAttributes(EnumSet<MetricAttribute> includes, EnumSet<MetricAttribute> excludes,
EnumSet<MetricAttribute> expectedResult) {
factory.setIncludesAttributes(includes);
factory.setExcludesAttributes(excludes);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

import static org.assertj.core.api.Assertions.assertThat;

public class MetricsFactoryTest {
class MetricsFactoryTest {
static {
BootstrapLogging.bootstrap();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoMoreInteractions;

public class ScheduledReporterManagerTest {
class ScheduledReporterManagerTest {

@Test
void testStopWithoutReporting() throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import static org.assertj.core.api.Assertions.assertThat;

public class Slf4jReporterFactoryTest {
class Slf4jReporterFactoryTest {
@Test
void isDiscoverable() throws Exception {
assertThat(new DiscoverableSubtypeResolver().getDiscoveredSubtypes())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import java.sql.SQLException;
import java.util.UUID;

public class AbstractMigrationTest {
class AbstractMigrationTest {

static {
SqlGeneratorFactory.getInstance().unregister(AddColumnGeneratorSQLite.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import static org.assertj.core.api.Assertions.assertThat;

@NotThreadSafe
public class CloseableLiquibaseTest {
class CloseableLiquibaseTest {

CloseableLiquibase liquibase;
ManagedPooledDataSource dataSource;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import static org.assertj.core.api.Assertions.assertThat;

@NotThreadSafe
public class DbCalculateChecksumCommandTest extends AbstractMigrationTest {
class DbCalculateChecksumCommandTest extends AbstractMigrationTest {

private final DbCalculateChecksumCommand<TestMigrationConfiguration> migrateCommand = new DbCalculateChecksumCommand<>(
TestMigrationConfiguration::getDataSource, TestMigrationConfiguration.class, "migrations.xml");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import static org.assertj.core.api.Assertions.assertThat;

@NotThreadSafe
public class DbClearChecksumsCommandTest extends AbstractMigrationTest {
class DbClearChecksumsCommandTest extends AbstractMigrationTest {

private final DbClearChecksumsCommand<TestMigrationConfiguration> clearChecksums = new DbClearChecksumsCommand<>(
TestMigrationConfiguration::getDataSource, TestMigrationConfiguration.class, "migrations.xml");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import static org.assertj.core.api.Assertions.assertThat;

@NotThreadSafe
public class DbDumpCommandTest extends AbstractMigrationTest {
class DbDumpCommandTest extends AbstractMigrationTest {

private static final List<String> ATTRIBUTE_NAMES = Arrays.asList("columns", "foreign-keys", "indexes",
"primary-keys", "sequences", "tables", "unique-constraints", "views");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import static org.assertj.core.api.Assertions.assertThat;

@NotThreadSafe
public class DbGenerateDocsCommandTest extends AbstractMigrationTest {
class DbGenerateDocsCommandTest extends AbstractMigrationTest {

private final DbGenerateDocsCommand<TestMigrationConfiguration> generateDocsCommand = new DbGenerateDocsCommand<>(
TestMigrationConfiguration::getDataSource, TestMigrationConfiguration.class, "migrations.xml");
Expand Down
Loading

0 comments on commit 4907ed5

Please sign in to comment.