2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
21 package org.openecomp.sdc.asdctool.migration;
24 import org.openecomp.sdc.asdctool.migration.core.DBVersion;
25 import org.openecomp.sdc.asdctool.migration.core.task.Migration;
26 import org.openecomp.sdc.asdctool.migration.core.task.MigrationResult;
28 public class DummyMigrationFactory {
30 public static Migration SUCCESSFUL_MIGRATION = new Migration() {
32 public String description() {
37 public DBVersion getVersion() {
38 return DBVersion.fromString("1710.22");
42 public MigrationResult migrate() {
43 MigrationResult migrationResult = new MigrationResult();
44 migrationResult.setMigrationStatus(MigrationResult.MigrationStatus.COMPLETED);
45 migrationResult.setMsg("myMsg");
46 return migrationResult;
50 public static Migration FAILED_MIGRATION = new Migration() {
52 public String description() {
57 public DBVersion getVersion() {
58 return DBVersion.fromString("1710.22");
62 public MigrationResult migrate() {
63 MigrationResult migrationResult = new MigrationResult();
64 migrationResult.setMigrationStatus(MigrationResult.MigrationStatus.FAILED);
65 migrationResult.setMsg("myMsg");
66 return migrationResult;
70 public static Migration getMigration(String version, MigrationResult.MigrationStatus status) {
71 return new Migration() {
73 public String description() {
78 public DBVersion getVersion() {
79 return DBVersion.fromString(version);
83 public MigrationResult migrate() {
84 MigrationResult migrationResult = new MigrationResult();
85 migrationResult.setMigrationStatus(status);
86 migrationResult.setMsg("myMsg");
87 return migrationResult;