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

[issue 1269] (2.0.x) Bumping Fabric8 version to 6.9.2 #1296

Merged
merged 21 commits into from
Mar 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
fef9ab1
[issues-1269] Bumping Fabric8 version to 6.9.2
fabiobrz Dec 6, 2023
0d5e7fe
[issues-1269] Bump CI JDK version to 11
fabiobrz Dec 7, 2023
389d2ab
[issues-1269] Bump Maven wrapper version to 3.9.6
fabiobrz Dec 7, 2023
fa9d117
[issues-1269] Bump Wildfly Arquillian remote container dependency, wh…
fabiobrz Dec 7, 2023
1feca5f
[issues-1269] Fixing the Timespan class in order to properly set TIME…
fabiobrz Dec 8, 2023
c02e283
[issues-1269] Fixing the CubeCOnfiguration model that is no longer va…
fabiobrz Dec 8, 2023
f54f9f8
[issues-1269] Fixing the tests in core module
fabiobrz Dec 8, 2023
9e88770
[issues-1269] Fixing the tests in docker module
fabiobrz Dec 8, 2023
addbb5c
[issues-1269] Fixing the tests in docker moduleù
fabiobrz Dec 15, 2023
1c5c2ee
[issues-1269] Fixing the tests in kubernetes moduleù
fabiobrz Dec 15, 2023
27b15a8
[issues-1269] Downgrade okhttp3 version to 3.12.12, to be compatible …
fabiobrz Dec 15, 2023
290d0d3
[issues-1269] - TEMP - Fixing hamcrest dependency artifactId and scop…
fabiobrz Dec 19, 2023
afc4340
[issues-1269] Fix Java custom DNS SPI removal
fabiobrz Dec 22, 2023
03ffe78
[issues-1269] Fix Istio integration and tests
fabiobrz Dec 22, 2023
84ed36f
[issues-1269] Fix KubernetesAssistant delete method return logic
fabiobrz Dec 22, 2023
8c5aab1
[issues-1269] Fixing sundr.io dependencies
fabiobrz Dec 28, 2023
5148aab
[issues-1269] - Adding the kubernetest-client depenency to kubernetes…
fabiobrz Dec 28, 2023
8602f80
[issues-1269] Removing TODOs
fabiobrz Dec 28, 2023
44f76f1
[issue 1269] - Fixing MockTest.java
fabiobrz Jan 12, 2024
81f1905
[issue 1269] - Resume DockerHealthAwaitStrategyTest
fabiobrz Jan 12, 2024
8338c4f
[issue 1269] - Remove okhttp, replacing it with JdkHtppClient in func…
fabiobrz Feb 1, 2024
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
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,5 @@ workflows:
- build:
matrix:
parameters:
jdk-version: ["8.0"] # TODO: Add JDK 11.0 when builds for JDK8 work
category: ["docker"] # TODO: Add builds for kubernetes and openshift
jdk-version: ["11.0"] # TODO: Add JDK 11.0 when builds for JDK8 work
category: ["docker"] # TODO: Add builds for kubernetes and openshift
2 changes: 1 addition & 1 deletion .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.3.9/apache-maven-3.3.9-bin.zip
distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.9.6/apache-maven-3.9.6-bin.zip
2 changes: 1 addition & 1 deletion core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-library</artifactId>
<artifactId>hamcrest</artifactId>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public String getDisplayChar() {
final List<TimeUnit> timeUnits = Arrays.asList(TimeUnit.values());
Collections.reverse(timeUnits);

TIME_UNIT_ORDER = (TimeUnit[]) timeUnits.toArray();
TIME_UNIT_ORDER = timeUnits.toArray(new TimeUnit[timeUnits.size()]);
}

static {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import org.mockito.junit.MockitoJUnitRunner;
import org.yaml.snakeyaml.Yaml;

import static org.mockito.Mockito.lenient;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
Expand Down Expand Up @@ -67,7 +68,7 @@ public void setup() {
Map<String, Object> content = (Map<String, Object>) yaml.load(CONTENT);

when(cube.getId()).thenReturn(CUBE_ID);
when(cube.configuration()).thenReturn(content);
lenient().when(cube.configuration()).thenReturn(content);
when(cube.getMetadata(HasPortBindings.class)).thenReturn(
new TestPortBindings(new Binding("localhost").addPortBinding(8089, 8090)));
when(container.getName()).thenReturn(CUBE_ID);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import org.mockito.Mock;
import org.mockito.junit.MockitoJUnitRunner;

import static org.mockito.Mockito.lenient;
import static org.mockito.Mockito.when;

@RunWith(MockitoJUnitRunner.class)
Expand Down Expand Up @@ -164,7 +165,7 @@ public void shouldUseOverriddenCubeId() {
Map<String, String> containerConfig = new HashMap<String, String>();
containerConfig.put("cubeId", CUBE_ID);

when(container.getName()).thenReturn(MISSING_CUBE_ID);
lenient().when(container.getName()).thenReturn(MISSING_CUBE_ID);
when(containerDef.getContainerProperties()).thenReturn(containerConfig);

shouldCreateAndStartCubeDuringBeforeStart();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public void shouldUpdateWithIPFromDocker() throws Exception {
public void shouldNotUpdateIfContainerNotMapped() throws Exception {
Binding binding = new Binding(GATEWAY_IP);
binding.addPortBinding(EXPOSED_PORT, EXPOSED_PORT);
Mockito.when(cube.getMetadata(HasPortBindings.class)).thenReturn(new TestPortBindings(binding));
Mockito.lenient().when(cube.getMetadata(HasPortBindings.class)).thenReturn(new TestPortBindings(binding));

bind(ContainerScoped.class,
Container.class,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
import java.util.List;
import org.assertj.core.api.ListAssert;

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

/**
* @author Eddú Meléndez
*/
Expand All @@ -22,12 +20,12 @@ public ImagesAssert containsImages(String... imageIds) {
for (Image image : this.actual) {
imageList.add(image.getId());
}
/** rls TODO https://github.com/arquillian/arquillian-cube/issues/1289
assertThat(this.actual)

org.assertj.core.api.Assertions.assertThat(this.actual)
.extracting("id")
.overridingErrorMessage("%nExpecting:%n <%s>%nto contain:%n <%s>", imageList, Arrays.asList(imageIds))
.contains(imageIds);
**/

return this;
}
}
2 changes: 1 addition & 1 deletion docker/docker/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-library</artifactId>
<artifactId>hamcrest</artifactId>
<scope>test</scope>
</dependency>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ public ExposedPort(int exposed, String type) {
}
}

public ExposedPort(final String exp) {
final ExposedPort parsed = valueOf(exp);
this.exposed = parsed.exposed;
this.type = parsed.type;
}

public static ExposedPort valueOf(String exp) {
int exposed;
String type = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ public Image(String name, String tag) {
this.tag = tag;
}

public Image(final String nameAndTag) {
final Image parsed = valueOf(nameAndTag);
this.name = parsed.name;
this.tag = parsed.tag;
}

public static Image valueOf(String image) {
String name = null;
String tag = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ public Link(String name, String alias) {
this.alias = alias;
}

public Link(final String links) {
final Link parsed = valueOf(links);
this.name = parsed.name;
this.alias = parsed.alias;
}

public static Link valueOf(String links) {
String[] link = links.split(":");
String name = link[0];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ public PortBinding(String host, int bound, ExposedPort exposed) {
this.exposed = exposed;
}

public PortBinding(final String portBinding) {
final PortBinding parsed = valueOf(portBinding);
this.host = parsed.host;
this.bound = parsed.bound;
this.exposed = parsed.exposed;
}

public static PortBinding valueOf(String portBinding) {
ExposedPort exposed;
int bound;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public class DockerHealthAwaitStrategyTest {
@BeforeClass
public static void createDockerClient() {
if (!System.getenv().containsKey(DOCKER_HOST) || System.getenv(DOCKER_HOST).equals("")){
environmentVariables.set(DOCKER_HOST, "unix:///var/run/docker.sock");
environmentVariables.set(DOCKER_HOST, "unix:///var/run/podman.sock");
}
dockerClient = DockerClientBuilder.getInstance().build();
healthSuccessImageId = dockerBuild("DockerHealthAwait/HealthSuccess/Dockerfile");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import static org.hamcrest.collection.IsMapContaining.hasKey;
import static org.junit.Assert.assertThat;
import static org.junit.Assume.assumeThat;
import static org.mockito.Mockito.lenient;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
Expand Down Expand Up @@ -76,8 +77,8 @@ private static Matcher<String> pathEndsWith(String suffix) {
}

private void bindNonExistingDockerSocketOS() {
when(operatingSystem.getDefaultFamily()).thenReturn(operatingSystemFamily);
when(operatingSystem.getFamily()).thenReturn(OperatingSystemFamily.MAC);
lenient().when(operatingSystem.getDefaultFamily()).thenReturn(operatingSystemFamily);
lenient().when(operatingSystem.getFamily()).thenReturn(OperatingSystemFamily.MAC);
when(operatingSystemFamily.getServerUri()).thenReturn("non/existing/path");

bind(ApplicationScoped.class, OperatingSystemInterface.class, operatingSystem);
Expand Down Expand Up @@ -107,8 +108,8 @@ public void shouldChangeServerUriInCaseOfRunningDockerInsideDocker() {
config.put(CubeDockerConfiguration.DOCKER_URI, "https://dockerHost:22222");

when(extensionDef.getExtensionProperties()).thenReturn(config);
when(arquillianDescriptor.extension("docker")).thenReturn(extensionDef);
when(commandLineExecutor.execCommand("boot2docker", "ip")).thenReturn("192.168.0.1");
lenient().when(arquillianDescriptor.extension("docker")).thenReturn(extensionDef);
lenient().when(commandLineExecutor.execCommand("boot2docker", "ip")).thenReturn("192.168.0.1");
when(commandLineExecutor.execCommand("docker-machine")).thenThrow(new RuntimeException());
when(top.isSpinning()).thenReturn(true);

Expand All @@ -127,7 +128,7 @@ public void shouldNotChangeServerUriInCaseODockerInsideDockerIfItIsDisabled() {
when(commandLineExecutor.execCommand("boot2docker", "ip")).thenReturn("192.168.0.1");
when(commandLineExecutor.execCommand("docker-machine")).thenThrow(new RuntimeException());

when(top.isSpinning()).thenReturn(true);
lenient().when(top.isSpinning()).thenReturn(true);

fire(new CubeConfiguration());
assertThat(config, hasEntry(CubeDockerConfiguration.DOCKER_URI, "tcp://192.168.0.1:22222"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import org.arquillian.cube.docker.impl.util.Top;
import org.junit.BeforeClass;
import org.junit.ClassRule;
import org.junit.Rule;
import org.junit.Test;
import org.junit.contrib.java.lang.system.EnvironmentVariables;
import org.junit.runner.RunWith;
Expand All @@ -31,6 +30,7 @@
import static org.hamcrest.CoreMatchers.nullValue;
import static org.junit.Assert.assertThat;
import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.Mockito.lenient;
import static org.mockito.Mockito.when;

@RunWith(MockitoJUnitRunner.class)
Expand Down Expand Up @@ -94,7 +94,7 @@ public void shouldDetectsValidDockerDefault() throws Exception {
String sockUri = isWindows ?sockURL.toExternalForm().replace("file:/", "") : "unix://" + sockURL.toExternalForm();
when(defaultOperatingSystemFamilyInterface.getServerUri()).thenReturn(sockUri);
when(operatingSystemInterface.getDefaultFamily()).thenReturn(defaultOperatingSystemFamilyInterface);
when(operatingSystemInterface.getFamily()).thenReturn(OperatingSystem.MAC_OSX.getFamily());
lenient().when(operatingSystemInterface.getFamily()).thenReturn(OperatingSystem.MAC_OSX.getFamily());

Map<String, String> config = new HashMap<>();

Expand All @@ -116,7 +116,7 @@ public void shouldSkipsInvalidDockerDefault() throws Exception {
new Boot2Docker(boot2dockerCommandLineExecutor),
mockDefaultDocker(),
operatingSystemInterface);
when(boot2dockerCommandLineExecutor.execCommand(ArgumentMatchers.<String>any())).thenReturn("127.0.0.1");
when(boot2dockerCommandLineExecutor.execCommand(anyString(), anyString())).thenReturn("127.0.0.1");

String sockUri = "unix:///a/path-that/does/not/exist";
when(defaultOperatingSystemFamilyInterface.getServerUri()).thenReturn(sockUri);
Expand All @@ -139,11 +139,11 @@ public void shouldNotSetTlsVerifyForTcpSchemeOnOSX() {
mockDefaultDocker(),
operatingSystemInterface);

when(infoCmd.exec()).thenThrow(new ProcessingException("test exception"));
lenient().when(infoCmd.exec()).thenThrow(new ProcessingException("test exception"));
String sockUri = "unix:///a/path-that/does/not/exist";
when(defaultOperatingSystemFamilyInterface.getServerUri()).thenReturn(sockUri);
when(operatingSystemInterface.getDefaultFamily()).thenReturn(defaultOperatingSystemFamilyInterface);
when(operatingSystemInterface.getFamily()).thenReturn(OperatingSystem.MAC_OSX.getFamily());
lenient().when(defaultOperatingSystemFamilyInterface.getServerUri()).thenReturn(sockUri);
lenient().when(operatingSystemInterface.getDefaultFamily()).thenReturn(defaultOperatingSystemFamilyInterface);
lenient().when(operatingSystemInterface.getFamily()).thenReturn(OperatingSystem.MAC_OSX.getFamily());

Map<String, String> config = new HashMap<>();
config.put(CubeDockerConfiguration.DOCKER_URI, "tcp://localhost:2376");
Expand All @@ -161,12 +161,12 @@ public void shouldNotSetTlsVerifyForTcpSchemeOnLinux() {
new Boot2Docker(null),
mockDefaultDocker(),
operatingSystemInterface);
when(infoCmd.exec()).thenThrow(new ProcessingException("test exception"));
lenient().when(infoCmd.exec()).thenThrow(new ProcessingException("test exception"));

String sockUri = "unix:///a/path-that/does/not/exist";
when(defaultOperatingSystemFamilyInterface.getServerUri()).thenReturn(sockUri);
when(operatingSystemInterface.getDefaultFamily()).thenReturn(defaultOperatingSystemFamilyInterface);
when(operatingSystemInterface.getFamily()).thenReturn(OperatingSystem.LINUX_OS.getFamily());
lenient().when(defaultOperatingSystemFamilyInterface.getServerUri()).thenReturn(sockUri);
lenient().when(operatingSystemInterface.getDefaultFamily()).thenReturn(defaultOperatingSystemFamilyInterface);
lenient().when(operatingSystemInterface.getFamily()).thenReturn(OperatingSystem.LINUX_OS.getFamily());

Map<String, String> config = new HashMap<>();
config.put(CubeDockerConfiguration.DOCKER_URI, "tcp://localhost:2376");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import org.mockito.Mock;
import org.mockito.junit.MockitoJUnitRunner;

import static org.mockito.Mockito.lenient;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

Expand Down Expand Up @@ -111,9 +112,9 @@ public void shouldCreateAndStartAutoContainersWhenNoAutoStartIsProvided() {
ContainerRegistry containerRegistry = mock(ContainerRegistry.class);
List<org.jboss.arquillian.container.spi.Container> containers = new ArrayList<>();
org.jboss.arquillian.container.spi.Container container = mock(org.jboss.arquillian.container.spi.Container.class);
when(container.getName()).thenReturn("a");
lenient().when(container.getName()).thenReturn("a");
containers.add(container);
when(containerRegistry.getContainers()).thenReturn(containers);
lenient().when(containerRegistry.getContainers()).thenReturn(containers);

bind(ApplicationScoped.class, ContainerRegistry.class, containerRegistry);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.arquillian.cube.docker.impl.client.container;

import static org.mockito.Mockito.lenient;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
Expand Down Expand Up @@ -89,7 +90,7 @@ public void setup() {
Map<String, Object> content = (Map<String, Object>) yaml.load(CONTENT);

when(cube.getId()).thenReturn(CUBE_ID);
when(cube.configuration()).thenReturn(content);
lenient().when(cube.configuration()).thenReturn(content);
when(container.getName()).thenReturn(CUBE_ID);
when(container.getDeployableContainer()).thenReturn(deployableContainer);
when(deployableContainer.getConfigurationClass()).thenReturn(ContainerConfiguration.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ public void shouldLinkInnerContainersWithoutLink() {
verify(cubeController, times(1)).create("containerWithNonAnnotatedLink");
verify(cubeController, times(1)).start("containerWithNonAnnotatedLink");

verify(cubeContainerObjectTestEnricher, times(1)).enrich(any(TestContainerObjectWithAnnotatedLink.class));
verify(cubeContainerObjectTestEnricher, times(1)).enrich(any(TestContainerObjectWithNonAnnotatedLink.class));
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.lenient;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
Expand Down Expand Up @@ -46,7 +47,7 @@ public void should_start_a_network() {
containerNetworkObjectDslTestEnricher.networkRegistryInstance = () -> networkRegistry;
containerNetworkObjectDslTestEnricher.dockerClientExecutorInstance = () -> dockerClientExecutor;

when(injector.inject(any(Network.class))).then(invocation -> invocation.getArgument(0, Network.class));
lenient().when(injector.inject(any(Network.class))).then(invocation -> invocation.getArgument(0, Network.class));
when(dockerClientExecutor.createNetwork(eq("default"), any(org.arquillian.cube.docker.impl.client.config.Network.class))).thenReturn("default");

containerNetworkObjectDslTestEnricher.enrich(new NetworkTest());
Expand Down
Loading