-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Link service template ID and the DeployedService data.
- Loading branch information
Showing
27 changed files
with
610 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
...s/src/main/java/org/eclipse/xpanse/modules/models/servicetemplate/ModificationImpact.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* SPDX-FileCopyrightText: Huawei Inc. | ||
*/ | ||
|
||
package org.eclipse.xpanse.modules.models.servicetemplate; | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import java.io.Serial; | ||
import java.io.Serializable; | ||
import lombok.Data; | ||
|
||
/** | ||
* Defines for service ModificationImpact. | ||
*/ | ||
@Data | ||
public class ModificationImpact implements Serializable { | ||
|
||
@Serial | ||
private static final long serialVersionUID = -4160044806152791293L; | ||
|
||
@Schema(description = "Is data lost when service configuration is modified.") | ||
private Boolean isDataLost; | ||
|
||
@Schema(description = "Is service availability interrupted when the configuration is " | ||
+ "interrupted.") | ||
private Boolean isServiceInterrupted; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
79 changes: 79 additions & 0 deletions
79
...c/test/java/org/eclipse/xpanse/modules/models/servicetemplate/ModificationImpactTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
/* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* SPDX-FileCopyrightText: Huawei Inc. | ||
* | ||
*/ | ||
|
||
package org.eclipse.xpanse.modules.models.servicetemplate; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
import static org.junit.jupiter.api.Assertions.assertNotEquals; | ||
|
||
import org.junit.jupiter.api.BeforeEach; | ||
import org.junit.jupiter.api.Test; | ||
|
||
/** | ||
* Test of ModificationImpact. | ||
*/ | ||
public class ModificationImpactTest { | ||
|
||
private static final Boolean isDataLost = true; | ||
|
||
private static final Boolean isServiceInterrupted = true; | ||
|
||
private static ModificationImpact modificationImpact; | ||
|
||
@BeforeEach | ||
void setUp() { | ||
modificationImpact = new ModificationImpact(); | ||
modificationImpact.setIsDataLost(isDataLost); | ||
modificationImpact.setIsServiceInterrupted(isServiceInterrupted); | ||
} | ||
|
||
@Test | ||
void testGetterAndSetter() { | ||
assertEquals(isDataLost, modificationImpact.getIsDataLost()); | ||
assertEquals(isServiceInterrupted, modificationImpact.getIsServiceInterrupted()); | ||
} | ||
|
||
@Test | ||
void testEqualsAndHashCode() { | ||
assertEquals(modificationImpact, modificationImpact); | ||
assertEquals(modificationImpact.hashCode(), modificationImpact.hashCode()); | ||
|
||
Object obj = new Object(); | ||
assertNotEquals(modificationImpact, obj); | ||
assertNotEquals(modificationImpact, null); | ||
assertNotEquals(modificationImpact.hashCode(), obj.hashCode()); | ||
|
||
ModificationImpact modificationImpact1 = new ModificationImpact(); | ||
ModificationImpact modificationImpact2 = new ModificationImpact(); | ||
assertNotEquals(modificationImpact, modificationImpact1); | ||
assertNotEquals(modificationImpact, modificationImpact2); | ||
assertEquals(modificationImpact1, modificationImpact2); | ||
assertNotEquals(modificationImpact.hashCode(), modificationImpact1.hashCode()); | ||
assertNotEquals(modificationImpact.hashCode(), modificationImpact2.hashCode()); | ||
assertEquals(modificationImpact1.hashCode(), modificationImpact2.hashCode()); | ||
|
||
modificationImpact1.setIsDataLost(isDataLost); | ||
assertNotEquals(modificationImpact, modificationImpact1); | ||
assertNotEquals(modificationImpact1, modificationImpact2); | ||
assertNotEquals(modificationImpact.hashCode(), modificationImpact1.hashCode()); | ||
assertNotEquals(modificationImpact1.hashCode(), modificationImpact2.hashCode()); | ||
|
||
modificationImpact1.setIsServiceInterrupted(isServiceInterrupted); | ||
assertEquals(modificationImpact, modificationImpact1); | ||
assertNotEquals(modificationImpact1, modificationImpact2); | ||
assertEquals(modificationImpact.hashCode(), modificationImpact1.hashCode()); | ||
assertNotEquals(modificationImpact1.hashCode(), modificationImpact2.hashCode()); | ||
} | ||
|
||
@Test | ||
void testToString() { | ||
String expectedString = "ModificationImpact(" + | ||
"isDataLost=" + isDataLost + | ||
", isServiceInterrupted=" + isServiceInterrupted + | ||
")"; | ||
assertEquals(expectedString, modificationImpact.toString()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.