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 4209e5f commit 10318c5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -170,13 +170,13 @@ public static TPrivate createPrivate(List<TCompasTopo> compasTopos) {

/**
* Create Private of given type as parameter
* @param compasLNodeStatus type of Private to create
* @param privateValue type of Private to create
* @return created Private
*/
public static TPrivate createPrivateCompasLNodeStatus(String compasLNodeStatus) {
public static TPrivate createStringPrivate(String privateType, String privateValue) {
TPrivate compasLNodeStatusPrivate = new TPrivate();
compasLNodeStatusPrivate.setType("COMPAS-LNodeStatus");
compasLNodeStatusPrivate.getContent().add(compasLNodeStatus);
compasLNodeStatusPrivate.setType(privateType);
compasLNodeStatusPrivate.getContent().add(privateValue);
return compasLNodeStatusPrivate;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,14 +212,15 @@ public static Stream<Object> createPrivateTestSources() {
}

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

@Test
Expand Down

0 comments on commit 10318c5

Please sign in to comment.