Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing jetbrain annotations #3100

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
0dda941
Add functionality to retrieve container by its name
Jan 31, 2020
543218b
Fix test message
Jan 31, 2020
7c341e1
Split up negative and positive tests, additional check added
Jan 31, 2020
e097aae
Small adjustments
Jan 31, 2020
aa065dc
Renaming to better method name
Feb 3, 2020
1ff69ce
Bump assertj-core from 3.14.0 to 3.15.0 in /modules/database-commons …
dependabot-preview[bot] Jan 29, 2020
d31d2aa
Bump assertj-core from 3.14.0 to 3.15.0 in /modules/neo4j (#2306)
dependabot-preview[bot] Jan 29, 2020
081bd04
Bump assertj-core from 3.14.0 to 3.15.0 in /modules/pulsar (#2305)
dependabot-preview[bot] Jan 29, 2020
20c8dc3
Bump assertj-core from 3.14.0 to 3.15.0 in /modules/vault (#2304)
dependabot-preview[bot] Jan 29, 2020
aee4feb
Bump assertj-core from 3.14.0 to 3.15.0 in /modules/kafka (#2303)
dependabot-preview[bot] Jan 29, 2020
f59da63
Bump assertj-core from 3.14.0 to 3.15.0 in /core (#2308)
dependabot-preview[bot] Jan 29, 2020
f2f1375
Add junit-jupiter dependency in junit 5 quickstart docs (#2301)
Dark0096 Jan 29, 2020
3e214e7
Bump mariadb-java-client from 2.5.3 to 2.5.4 in /modules/mariadb (#2298)
dependabot-preview[bot] Jan 29, 2020
594738b
Bump junit-jupiter-api from 5.5.2 to 5.6.0 in /modules/junit-ju… (#2271)
dependabot-preview[bot] Jan 29, 2020
a4c5892
Bump java-client from 2.7.11 to 2.7.12 in /modules/couchbase (#2323)
dependabot-preview[bot] Feb 5, 2020
d03aeef
Add small delay in while loop to avoid spamming logs (ResourceR… (#2287)
worldtiki Feb 5, 2020
6cd1e35
Fix localstack cloudwatchlogs service (#2316)
MariuszCwikla Feb 5, 2020
d360f44
adds OrientDB 3.0.x module (#1414)
Feb 5, 2020
9f74b88
Pin mkdocs dependencies to avoid version incompatibility (#2335)
rnorth Feb 7, 2020
62249f7
Add Presto container (#2196)
findepi Feb 8, 2020
803eb68
Bump aws-java-sdk-logs from 1.11.636 to 1.11.717 in /modules/lo… (#2327)
dependabot-preview[bot] Feb 8, 2020
a70e1c6
Bump lombok from 1.18.10 to 1.18.12 in /examples (#2333)
dependabot-preview[bot] Feb 8, 2020
9c3ab54
Bump postgresql from 42.2.9 to 42.2.10 in /modules/spock (#2329)
dependabot-preview[bot] Feb 8, 2020
5543c1b
Bump postgresql from 42.2.9 to 42.2.10 in /modules/postgresql (#2328)
dependabot-preview[bot] Feb 8, 2020
6ec4d1e
Bump postgresql from 42.2.9 to 42.2.10 in /modules/junit-jupiter (#2330)
dependabot-preview[bot] Feb 8, 2020
f79e799
Bump aws-java-sdk-logs from 1.11.636 to 1.11.718 in /modules/lo… (#2336)
dependabot-preview[bot] Feb 8, 2020
4172e56
checkMountableFile on Windows (#2296)
bedla Feb 9, 2020
eb83d53
Bump aws-java-sdk-logs from 1.11.718 to 1.11.722 in /modules/lo… (#2353)
dependabot-preview[bot] Feb 15, 2020
03d52a5
Bump tomcat-jdbc from 9.0.30 to 9.0.31 in /modules/mysql (#2344)
dependabot-preview[bot] Feb 15, 2020
7b05552
Bump tomcat-jdbc from 9.0.30 to 9.0.31 in /modules/mariadb (#2343)
dependabot-preview[bot] Feb 15, 2020
65f49a1
Bump postgresql from 42.2.9 to 42.2.10 in /examples (#2338)
dependabot-preview[bot] Feb 15, 2020
d6e9776
Kafka: replace deprecated poll method millis param with Duration (#2318)
nshipyakov Feb 16, 2020
4d60a3d
Bump elasticsearch-rest-client from 7.5.2 to 7.6.0 in /modules/… (#2347)
dependabot-preview[bot] Feb 16, 2020
0239bc3
Bump commons-compress from 1.19 to 1.20 in /core (#2337)
dependabot-preview[bot] Feb 16, 2020
a9b46f6
Bump okhttp from 3.14.4 to 3.14.6 in /core (#2243)
dependabot-preview[bot] Feb 16, 2020
cedd6fe
Set sourceJar.from=allSource for modules/spock (#2281)
pertu Feb 16, 2020
e833881
Prune images between module checks (#2376)
bsideup Feb 24, 2020
ff79849
Adding Windows Subsystem for Linux section to the windows docum… (#2282)
rnorth Feb 28, 2020
67bf77f
Merge branch 'master' of https://github.com/artjomka/testcontainers-java
Feb 28, 2020
7268ec6
Merge branch 'master' of https://github.com/testcontainers/testcontai…
Apr 2, 2020
13cf97f
Merge branch 'master' of https://github.com/testcontainers/testcontai…
Apr 14, 2020
6442668
Merge branch 'master' of https://github.com/testcontainers/testcontai…
Apr 19, 2020
2e0847d
Merge branch 'master' of https://github.com/testcontainers/testcontai…
Jun 11, 2020
6b3196a
Merge branch 'master' of https://github.com/testcontainers/testcontai…
Jul 15, 2020
025b284
Trim all string based properties for testcontainers.properties
Jul 30, 2020
3713705
cleaning up
Jul 30, 2020
bb5f94a
PR comments adjustments
Aug 3, 2020
185fb11
Move property trimming to configuration constructor
Aug 11, 2020
b1989e4
Merge remote-tracking branch 'upstream/master' into removing-jetbrain…
Aug 14, 2020
4b0909b
Removing jetbrains annotations dependencies
Aug 10, 2020
b582b9e
Remove wrong import and nullable annotation
Aug 14, 2020
41d0e8f
remove exclusion for library where jetbrains.annotations was dependency
Aug 14, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,8 @@ dependencies {

compile 'junit:junit:4.12'
compile 'org.slf4j:slf4j-api:1.7.30'
compile 'org.jetbrains:annotations:19.0.0'
compile 'org.apache.commons:commons-compress:1.20'
compile ('org.rnorth.duct-tape:duct-tape:1.0.8') {
exclude(group: 'org.jetbrains', module: 'annotations')
}
compile ('org.rnorth.duct-tape:duct-tape:1.0.8')

compile 'org.rnorth.visible-assertions:visible-assertions:2.1.2'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.testcontainers.containers;

import org.jetbrains.annotations.NotNull;
import lombok.NonNull;

/**
* Variant of {@link GenericContainer} that allows a fixed port on the docker host to be mapped to a container port.
Expand All @@ -17,7 +17,7 @@ public class FixedHostPortGenericContainer<SELF extends FixedHostPortGenericCont
* @deprecated it is highly recommended that {@link FixedHostPortGenericContainer} not be used, as it risks port conflicts.
*/
@Deprecated
public FixedHostPortGenericContainer(@NotNull String dockerImageName) {
public FixedHostPortGenericContainer(@NonNull String dockerImageName) {
super(dockerImageName);
}

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

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.MapperFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.github.dockerjava.api.DockerClient;
import com.github.dockerjava.api.command.CreateContainerCmd;
Expand All @@ -28,8 +27,6 @@
import lombok.SneakyThrows;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang.StringUtils;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.junit.runner.Description;
import org.junit.runners.model.Statement;
import org.rnorth.ducttape.ratelimits.RateLimiter;
Expand Down Expand Up @@ -171,14 +168,12 @@ public class GenericContainer<SELF extends GenericContainer<SELF>>

private int startupAttempts = 1;

@Nullable
private String workingDirectory = null;

/**
* The shared memory size to use when starting the container.
* This value is in bytes.
*/
@Nullable
private Long shmSize;

// Maintain order in which entries are added, as earlier target location may be a prefix of a later location.
Expand Down Expand Up @@ -221,7 +216,6 @@ public class GenericContainer<SELF extends GenericContainer<SELF>>
.withConstantThroughput()
.build();

@Nullable
private Map<String, String> tmpFsMapping;

@Setter(AccessLevel.NONE)
Expand Down Expand Up @@ -701,7 +695,6 @@ protected Integer getLivenessCheckPort() {
* @return the ports on which to check if the container is ready
* @deprecated use {@link #getLivenessCheckPortNumbers()} instead
*/
@NotNull
@NonNull
@Deprecated
protected Set<Integer> getLivenessCheckPorts() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import com.github.dockerjava.api.DockerClient;
import com.github.dockerjava.api.command.InspectContainerResponse;
import org.jetbrains.annotations.NotNull;
import lombok.NonNull;
import org.testcontainers.utility.DockerStatus;

import java.time.Duration;
Expand All @@ -14,10 +14,10 @@
*/
public class MinimumDurationRunningStartupCheckStrategy extends StartupCheckStrategy {

@NotNull
@NonNull
private final Duration minimumRunningDuration;

public MinimumDurationRunningStartupCheckStrategy(@NotNull Duration minimumRunningDuration) {
public MinimumDurationRunningStartupCheckStrategy(@NonNull Duration minimumRunningDuration) {
this.minimumRunningDuration = minimumRunningDuration;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
package org.testcontainers.dockerclient;

import com.github.dockerjava.api.DockerClient;
import com.github.dockerjava.api.command.*;
import com.github.dockerjava.api.command.CreateContainerCmd;
import com.github.dockerjava.api.command.CreateNetworkCmd;
import com.github.dockerjava.api.command.KillContainerCmd;
import com.github.dockerjava.api.command.RemoveContainerCmd;
import com.github.dockerjava.api.command.RemoveNetworkCmd;
import com.github.dockerjava.api.command.StartContainerCmd;
import com.github.dockerjava.api.command.StopContainerCmd;
import com.github.dockerjava.api.command.SyncDockerCmd;
import lombok.NonNull;
import lombok.experimental.Delegate;
import lombok.extern.slf4j.Slf4j;
import org.jetbrains.annotations.NotNull;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Proxy;
Expand All @@ -29,7 +36,7 @@ public AuditLoggingDockerClient(DockerClient wrappedClient) {
}

@Override
public CreateContainerCmd createContainerCmd(@NotNull String image) {
public CreateContainerCmd createContainerCmd(@NonNull String image) {
return wrappedCommand(CreateContainerCmd.class,
wrappedClient.createContainerCmd(image),
(cmd, res) -> doLog("CREATE", image, res.getId(), cmd),
Expand All @@ -38,31 +45,31 @@ public CreateContainerCmd createContainerCmd(@NotNull String image) {
}

@Override
public StartContainerCmd startContainerCmd(@NotNull String containerId) {
public StartContainerCmd startContainerCmd(@NonNull String containerId) {
return wrappedCommand(StartContainerCmd.class,
wrappedClient.startContainerCmd(containerId),
(cmd, res) -> doLog("START", null, containerId, cmd),
(cmd, e) -> doLog("START", null, containerId, cmd, e));
}

@Override
public RemoveContainerCmd removeContainerCmd(@NotNull String containerId) {
public RemoveContainerCmd removeContainerCmd(@NonNull String containerId) {
return wrappedCommand(RemoveContainerCmd.class,
wrappedClient.removeContainerCmd(containerId),
(cmd, res) -> doLog("REMOVE", null, containerId, cmd),
(cmd, e) -> doLog("REMOVE", null, containerId, cmd, e));
}

@Override
public StopContainerCmd stopContainerCmd(@NotNull String containerId) {
public StopContainerCmd stopContainerCmd(@NonNull String containerId) {
return wrappedCommand(StopContainerCmd.class,
wrappedClient.stopContainerCmd(containerId),
(cmd, res) -> doLog("STOP", null, containerId, cmd),
(cmd, e) -> doLog("STOP", null, containerId, cmd, e));
}

@Override
public KillContainerCmd killContainerCmd(@NotNull String containerId) {
public KillContainerCmd killContainerCmd(@NonNull String containerId) {
return wrappedCommand(KillContainerCmd.class,
wrappedClient.killContainerCmd(containerId),
(cmd, res) -> doLog("KILL", null, containerId, cmd),
Expand All @@ -78,7 +85,7 @@ public CreateNetworkCmd createNetworkCmd() {
}

@Override
public RemoveNetworkCmd removeNetworkCmd(@NotNull String networkId) {
public RemoveNetworkCmd removeNetworkCmd(@NonNull String networkId) {
return wrappedCommand(RemoveNetworkCmd.class,
wrappedClient.removeNetworkCmd(networkId),
(cmd, res) -> doLog("REMOVE_NETWORK", null, null, cmd),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.StringUtils;
import org.jetbrains.annotations.Nullable;
import org.rnorth.ducttape.TimeoutException;
import org.rnorth.ducttape.ratelimits.RateLimiter;
import org.rnorth.ducttape.ratelimits.RateLimiterBuilder;
Expand Down Expand Up @@ -176,10 +175,10 @@ public static DockerClientProviderStrategy getFirstValidStrategy(List<DockerClie

return Stream.of(strategy);
} catch (Exception | ExceptionInInitializerError | NoClassDefFoundError e) {
@Nullable String throwableMessage = e.getMessage();
String throwableMessage = e.getMessage();
@SuppressWarnings("ThrowableResultOfMethodCallIgnored")
Throwable rootCause = Throwables.getRootCause(e);
@Nullable String rootCauseMessage = rootCause.getMessage();
String rootCauseMessage = rootCause.getMessage();

String failureDescription;
if (throwableMessage != null && throwableMessage.equals(rootCauseMessage)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.SystemUtils;
import org.jetbrains.annotations.Nullable;

import java.net.URI;
import java.nio.file.Files;
Expand All @@ -25,7 +24,6 @@ public final class RootlessDockerClientProviderStrategy extends DockerClientProv
public static final int PRIORITY = UnixSocketClientProviderStrategy.PRIORITY + 1;

@Getter(lazy = true)
@Nullable
private final Path socketPath = resolveSocketPath();

private Path resolveSocketPath() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import com.github.dockerjava.transport.SSLConfig;
import lombok.Builder;
import lombok.Value;
import org.jetbrains.annotations.Nullable;

import java.net.URI;

Expand All @@ -13,6 +12,5 @@ public class TransportConfig {

URI dockerHost;

@Nullable
SSLConfig sslConfig;
}
33 changes: 16 additions & 17 deletions core/src/main/java/org/testcontainers/utility/AuditLogger.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.github.dockerjava.api.command.DockerCmd;
import lombok.NonNull;
import lombok.experimental.UtilityClass;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.slf4j.MDC;

import java.util.List;
Expand All @@ -25,24 +24,24 @@
@UtilityClass
public class AuditLogger {

private static final ObjectMapper objectMapper = new ObjectMapper();
public static final String MDC_PREFIX = AuditLogger.class.getCanonicalName();
private final ObjectMapper objectMapper = new ObjectMapper();
public final String MDC_PREFIX = AuditLogger.class.getCanonicalName();

public static void doLog(@NotNull String action,
@Nullable String image,
@Nullable String containerId,
@NotNull DockerCmd<?> cmd) {
public static void doLog(@NonNull String action,
String image,
String containerId,
@NonNull DockerCmd<?> cmd) {

doLog(action, image, containerId, cmd, null);
}

public static void doLog(@NotNull String action,
@Nullable String image,
@Nullable String containerId,
@NotNull DockerCmd<?> cmd,
@Nullable Exception e) {
public static void doLog(@NonNull String action,
String image,
String containerId,
@NonNull DockerCmd<?> cmd,
Exception e) {

if (! log.isTraceEnabled()) {
if (!log.isTraceEnabled()) {
return;
}

Expand All @@ -69,10 +68,10 @@ public static void doLog(@NotNull String action,
MDC.remove(MDC_PREFIX + ".Exception");
}

public static void doComposeLog(@NotNull String[] commandParts,
@Nullable List<String> env) {
public static void doComposeLog(@NonNull String[] commandParts,
List<String> env) {

if (! log.isTraceEnabled()) {
if (!log.isTraceEnabled()) {
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import com.github.dockerjava.api.model.AuthConfig;
import com.google.common.base.MoreObjects;
import lombok.NonNull;
import lombok.experimental.UtilityClass;
import org.jetbrains.annotations.NotNull;

import static com.google.common.base.Strings.isNullOrEmpty;

Expand All @@ -27,7 +27,7 @@ public static String toSafeString(AuthConfig authConfig) {
.toString();
}

@NotNull
@NonNull
private static String obfuscated(String value) {
return isNullOrEmpty(value) ? "blank" : "hidden non-blank value";
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.testcontainers.utility;

import org.jetbrains.annotations.NotNull;
import lombok.NonNull;
import org.slf4j.Logger;
import org.zeroturnaround.exec.InvalidExitValueException;
import org.zeroturnaround.exec.ProcessExecutor;
Expand Down Expand Up @@ -72,7 +72,7 @@ public static boolean executableExists(String executable) {
return false;
}

@NotNull
@NonNull
public static String[] getSystemPath() {
return System.getenv("PATH").split(Pattern.quote(File.pathSeparator));
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
package org.testcontainers.utility;

import java.util.ArrayList;
import java.util.List;

import com.google.common.annotations.VisibleForTesting;
import lombok.NonNull;

import org.jetbrains.annotations.NotNull;
import java.util.ArrayList;
import java.util.List;

public final class ComparableVersion implements Comparable<ComparableVersion> {

Expand All @@ -18,7 +17,7 @@ public ComparableVersion(String version) {
}

@Override
public int compareTo(@NotNull ComparableVersion other) {
public int compareTo(@NonNull ComparableVersion other) {
for (int i=0; i<Math.min(this.parts.length, other.parts.length); i++) {
int thisPart = this.parts[i];
int otherPart = other.parts[i];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.jetbrains.annotations.NotNull;
import lombok.NonNull;

import java.util.regex.Pattern;

Expand All @@ -23,7 +23,7 @@ public final class DockerImageName {
private final String rawName;
private final String registry;
private final String repo;
@NotNull private final Versioning versioning;
@NonNull private final Versioning versioning;

/**
* Parses a docker image name from a provided string.
Expand Down Expand Up @@ -85,7 +85,7 @@ public DockerImageName(String fullImageName) {
* @deprecated use {@link DockerImageName#parse(String)}.{@link DockerImageName#withTag(String)} instead
*/
@Deprecated
public DockerImageName(String nameWithoutTag, @NotNull String version) {
public DockerImageName(String nameWithoutTag, @NonNull String version) {
this.rawName = nameWithoutTag;
final int slashIndex = nameWithoutTag.indexOf('/');

Expand Down
Loading