Skip to content

Commit

Permalink
fix(#185): WIP change exception message format
Browse files Browse the repository at this point in the history
Signed-off-by: SABATIER Philippe Ext <philippe.sabatier@rte-france.com>
  • Loading branch information
psabatierrte committed Nov 14, 2022
1 parent 9f96782 commit 4ce2dbf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ public void checkExtRefInfoCoherence(ExtRefInfo extRefInfo) {
List<ControlBlock<?>> cbs = anLNAdapter.getControlBlocksForMatchingFCDA(extRefInfo);

if (cbs.isEmpty()) {
String msg = String.format("Unknown control block %s in %s%s/%s%s%s",
String msg = String.format("Unknown control block %s in Ied: %s / LdInst: %s / LnPrefix: %s LnClass: %s LnInst: %s",
extRefInfo.getSourceInfo().getSrcCBName(), binderIedName, binderLdInst,
binderLnPrefix, binderLnClass, binderLnInst);
log.error(msg);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ void updateExtRefBindingInfo_shouldUpdateBindingInfo_whenBindingInfoNull() {
assertNull(extRef.getIedName());
assertNull(extRef.getSrcLDInst());
}
@Test

@Test
void updateExtRefBindingInfo_shouldUpdateBindingInfo_whenNotBindingInfoNull() {
//Given
ExtRefInfo extRefInfo = DTO.createExtRefInfo();
Expand Down Expand Up @@ -124,7 +125,7 @@ void updateExtRefBinders_shouldUpdateExtRefs() throws Exception {
.withLnInst("1")
.build();
ExtRefInfo info = DTO.createExtRefInfo();
info.getSignalInfo().setPDO("StrVal.sdo2");
info.getSignalInfo().setPDO("StrVal.sdo2");
info.getSignalInfo().setPDA("antRef.bda1.bda2.bda3");
info.getSignalInfo().setIntAddr("INT_ADDR2");
info.getSignalInfo().setDesc(null);
Expand Down Expand Up @@ -157,8 +158,8 @@ void updateExtRefBinders_shouldThrowsException(String testCase, ExtRefInfo info,

private static Stream<Arguments> extRefInfoAndMessage() {
return Stream.of(
Arguments.of("whenBindingInfoNotValid",new ExtRefInfo(), "ExtRef mandatory binding data are missing"),
Arguments.of("whenNoExtRefFound",DTO.createExtRefInfo(), "Unknown ExtRef [pDO(FACntRs1.res),intAddr(INT_ADDR)] in IED_NAME/LD_INST_H.ANCR")
Arguments.of("whenBindingInfoNotValid", new ExtRefInfo(), "ExtRef mandatory binding data are missing"),
Arguments.of("whenNoExtRefFound", DTO.createExtRefInfo(), "Unknown ExtRef [pDO(FACntRs1.res),intAddr(INT_ADDR)] in IED_NAME/LD_INST_H.ANCR")
);
}

Expand All @@ -175,7 +176,7 @@ void updateExtRefBinders_shouldUpdateExtRefs_whenManyExtRefMatch() {
LN0Adapter ln0Adapter = new LN0Adapter(null, ln0);
ExtRefInfo info = DTO.createExtRefInfo();
//When Then
assertDoesNotThrow(() ->ln0Adapter.updateExtRefBinders(info));
assertDoesNotThrow(() -> ln0Adapter.updateExtRefBinders(info));
}

@Test
Expand Down

0 comments on commit 4ce2dbf

Please sign in to comment.