Skip to content
This repository has been archived by the owner on Jul 23, 2024. It is now read-only.

Commit

Permalink
Fix unit test for PlanStatusWorkFlowChecker
Browse files Browse the repository at this point in the history
Signed-off-by: Gloria Ciavarrini <gciavarrini@redhat.com>
  • Loading branch information
gciavarrini authored and openshift-merge-robot committed Aug 9, 2023
1 parent e151a64 commit c40e257
Showing 1 changed file with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.redhat.parodos.tasks.vmmigration.checker;

import java.time.Instant;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
Expand All @@ -19,7 +20,6 @@
import io.fabric8.openshift.client.server.mock.OpenShiftServer;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;

import static java.net.HttpURLConnection.HTTP_OK;
Expand Down Expand Up @@ -127,8 +127,6 @@ public void executeFail() {
}

@Test
@Disabled
// FIXME
public void executeRejected() {

// given
Expand All @@ -154,23 +152,24 @@ public void executeRejected() {
}

@Test
@Disabled
// FIXME
public void executeTimeoutRejected() {

// given
Plan plan = Kubernetes.createPlan(Constants.VM_NAME_PARAMETER_NAME, Constants.STORAGE_NAME_PARAMETER_NAME,
Constants.NETWORK_NAME_PARAMETER_NAME, Constants.NAMESPACE_NAME_PARAMETER_NAME,
Constants.DESTINATION_PROVIDER_TYPE_PARAMETER_NAME, Constants.SOURCE_PROVIDER_TYPE_PARAMETER_NAME);
plan.getMetadata().setName(Constants.PLAN_NAME_PARAMETER_NAME);
plan.getMetadata().setCreationTimestamp(Instant.now().plusSeconds(300).toString());
PlanStatus status = new PlanStatus();
Conditions condition = new Conditions();
condition.setType("Ready");
condition.setStatus("True");
condition.setStatus("False");
status.setConditions(List.of(condition));
plan.setStatus(status);
mockServer.expect().post().withPath("/apis/forklift.konveyor.io/v1beta1/namespaces/%s/plans/"
.formatted(Constants.NAMESPACE_NAME_PARAMETER_NAME)).andReturn(HTTP_OK, plan).always();
mockServer.expect().get()
.withPath("/apis/forklift.konveyor.io/v1beta1/namespaces/%s/plans/%s"
.formatted(Constants.NAMESPACE_NAME_PARAMETER_NAME, Constants.PLAN_NAME_PARAMETER_NAME))
.andReturn(HTTP_OK, plan).always();

// when
planStatusWorkFlowChecker.preExecute(ctx);
Expand Down

0 comments on commit c40e257

Please sign in to comment.