Skip to content

Commit

Permalink
[test] Avoid using deprecated fields
Browse files Browse the repository at this point in the history
  • Loading branch information
dmandalidis committed Dec 21, 2024
1 parent dd7c85a commit e13881a
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 22 deletions.
38 changes: 19 additions & 19 deletions src/main/java/org/mandas/docker/client/DefaultDockerClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@

package org.mandas.docker.client;

import static java.nio.charset.StandardCharsets.UTF_8;
import static java.util.Collections.unmodifiableSet;
import static java.util.Objects.requireNonNull;
import static java.util.Optional.ofNullable;
import static jakarta.ws.rs.HttpMethod.DELETE;
import static jakarta.ws.rs.HttpMethod.GET;
import static jakarta.ws.rs.HttpMethod.POST;
Expand All @@ -36,6 +32,10 @@
import static jakarta.ws.rs.core.MediaType.APPLICATION_OCTET_STREAM;
import static jakarta.ws.rs.core.MediaType.APPLICATION_OCTET_STREAM_TYPE;
import static jakarta.ws.rs.core.MediaType.TEXT_PLAIN_TYPE;
import static java.nio.charset.StandardCharsets.UTF_8;
import static java.util.Collections.unmodifiableSet;
import static java.util.Objects.requireNonNull;
import static java.util.Optional.ofNullable;
import static org.mandas.docker.client.ObjectMapperProvider.objectMapper;
import static org.mandas.docker.client.VersionCompare.compareVersion;

Expand Down Expand Up @@ -67,21 +67,7 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import jakarta.ws.rs.ProcessingException;
import jakarta.ws.rs.WebApplicationException;
import jakarta.ws.rs.client.Client;
import jakarta.ws.rs.client.Entity;
import jakarta.ws.rs.client.Invocation;
import jakarta.ws.rs.client.ResponseProcessingException;
import jakarta.ws.rs.client.WebTarget;
import jakarta.ws.rs.core.GenericType;
import jakarta.ws.rs.core.MediaType;
import jakarta.ws.rs.core.MultivaluedHashMap;
import jakarta.ws.rs.core.MultivaluedMap;
import jakarta.ws.rs.core.Response;
import jakarta.ws.rs.core.Response.Status.Family;

import org.apache.commons.compress.utils.IOUtils;
import org.apache.commons.io.IOUtils;
import org.mandas.docker.client.auth.RegistryAuthSupplier;
import org.mandas.docker.client.exceptions.BadParamException;
import org.mandas.docker.client.exceptions.ConflictException;
Expand Down Expand Up @@ -156,6 +142,20 @@
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonProcessingException;

import jakarta.ws.rs.ProcessingException;
import jakarta.ws.rs.WebApplicationException;
import jakarta.ws.rs.client.Client;
import jakarta.ws.rs.client.Entity;
import jakarta.ws.rs.client.Invocation;
import jakarta.ws.rs.client.ResponseProcessingException;
import jakarta.ws.rs.client.WebTarget;
import jakarta.ws.rs.core.GenericType;
import jakarta.ws.rs.core.MediaType;
import jakarta.ws.rs.core.MultivaluedHashMap;
import jakarta.ws.rs.core.MultivaluedMap;
import jakarta.ws.rs.core.Response;
import jakarta.ws.rs.core.Response.Status.Family;

public class DefaultDockerClient implements DockerClient {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1771,7 +1771,7 @@ public void testListImages() throws Exception {
}
}
assertNotNull(busybox);
assertThat(busybox.virtualSize(), greaterThan(0L));
assertThat(busybox.size(), greaterThan(0L));
assertThat(busybox.created(), not(emptyOrNullString()));
assertThat(busybox.id(), not(emptyOrNullString()));
assertThat(busybox.repoTags(), notNullValue());
Expand Down Expand Up @@ -2858,7 +2858,7 @@ public void testMacAddress() throws Exception {
sut.startContainer(container.id());
final ContainerInfo containerInfo = sut.inspectContainer(container.id());
assertThat(containerInfo, notNullValue());
assertThat(containerInfo.networkSettings().macAddress(), equalTo("12:34:56:78:9a:bc"));
assertThat(containerInfo.networkSettings().networks().get("bridge").macAddress(), equalTo("12:34:56:78:9a:bc"));
}

@Test(expected = NetworkNotFoundException.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public void test1_32_WithoutNullables() throws Exception {
assertThat(spec.taskTemplate(), is(notNullValue()));
assertThat(spec.mode(), is(nullValue()));
assertThat(spec.updateConfig(), is(nullValue()));
assertThat(spec.networks(), is(nullValue()));
assertThat(spec.taskTemplate().networks(), is(nullValue()));
assertThat(spec.endpointSpec(), is(nullValue()));
}
}

0 comments on commit e13881a

Please sign in to comment.