+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 - 2019 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
package org.onap.vid.job.impl;
import com.google.common.collect.ImmutableMap;
import org.onap.vid.job.command.JobCommandFactory;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
+import org.togglz.core.manager.FeatureManager;
import java.util.Map;
import java.util.UUID;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*;
-import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.Matchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
@Mock
private JobCommandFactory jobCommandFactory;
+ @Mock
+ private FeatureManager featureManager;
+
private final JobCommand jobCommand = mock(JobCommand.class);
private Job jobUnderTest;
private JobAdapter.AsyncJobRequest originalData;
public final String foobar = "aux";
};
- originalType = JobType.ServiceInstantiation;
- jobUnderTest = new JobAdapterImpl().createJob(
+ originalType = JobType.MacroServiceInstantiation;
+ jobUnderTest = new JobAdapterImpl(featureManager).createServiceInstantiationJob(
originalType,
originalData,
UUID.randomUUID(),
"my user id",
+ "VNF_API",
+ "optimisticUniqueServiceInstanceName",
RandomUtils.nextInt()
);
}
assertNextJobAfterExecuteJob(null, new String[]{"status"}, allOf(
hasProperty("status", is(Job.JobStatus.STOPPED)),
- hasProperty("data", hasEntry("request", originalData)),
+ hasProperty("sharedData", hasProperty("request", is(originalData))),
hasProperty("type", is(originalType)))
);
}