Skip to content

Commit

Permalink
feat(400-rsr-1034): Add a private LNodeStatus to the SSD file
Browse files Browse the repository at this point in the history
- create Utils for new String Private creation

Signed-off-by: JAFFRE Guillaume <guillaume.jaffre@rte-france.com>
  • Loading branch information
GuillaumeJAFFRE committed Jul 3, 2024
1 parent 5e68693 commit ad2fed2
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,19 @@ public static TPrivate createPrivate(List<TCompasTopo> compasTopos) {
return tPrivate;
}

/**
* Create private of a given type containing a simple string as value
* @param privateType type attribute of private element to create
* @param privateValue value of private to create
* @return the complete private
*/
public static TPrivate createStringPrivate(String privateType, String privateValue) {
TPrivate tPrivate = new TPrivate();
tPrivate.setType(privateType);
tPrivate.getContent().add(privateValue);
return tPrivate;
}

/**
* Create Private of given type as parameter
* @param jaxbElement content of Private to create
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,18 @@ public static Stream<Object> createPrivateTestSources() {
new TCompasSystemVersion());
}

@Test
void createStringPrivate_should_return_new_private() {
//GIVEN
String privateType = "COMPAS-LNodeStatus";
String compasLNodeStatus = "on";
//WHEN
TPrivate result = PrivateUtils.createStringPrivate(privateType, compasLNodeStatus);
//THEN
assertThat(result.getType()).contains(privateType);
assertThat(result.getContent()).containsExactly(compasLNodeStatus);
}

@Test
void removePrivates_should_remove_privates() {
// Given : setUp
Expand Down

0 comments on commit ad2fed2

Please sign in to comment.