Skip to content
This repository has been archived by the owner on Sep 21, 2021. It is now read-only.

Commit

Permalink
Handling possible null (#462)
Browse files Browse the repository at this point in the history
* Debugging null in unit test

* Improving mock to avoid flaky test, attempt 1

* Improving mock to avoid flaky test, attempt 2
  • Loading branch information
diemol authored Mar 4, 2018
1 parent b08a0c8 commit feb800d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ public ContainerCreationStatus createContainer(String zaleniumContainerName, Str

// Create the container
Pod createdPod = doneablePod.done();
String containerName = createdPod.getMetadata().getName();
String containerName = createdPod.getMetadata() == null ? containerIdPrefix : createdPod.getMetadata().getName();
return new ContainerCreationStatus(true, containerName, nodePort);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ public static KubernetesContainerClient getMockedKubernetesContainerClient() {
Pod zaleniumPod = new PodBuilder()
.withNewMetadata()
.withLabels(zaleniumPodLabels)
.addToLabels(zaleniumPodLabels)
.withNamespace("test")
.withGenerateName(hostName)
.withName(hostName)
.and().build();

Expand Down

0 comments on commit feb800d

Please sign in to comment.