-
Notifications
You must be signed in to change notification settings - Fork 0
Properly handle out of voltage bus error #73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: David SARTORI <david.sartori_externe@rte-france.com>
src/main/java/org/gridsuite/shortcircuit/server/service/ShortCircuitWorkerService.java
Outdated
Show resolved
Hide resolved
src/main/java/org/gridsuite/shortcircuit/server/service/ShortCircuitWorkerService.java
Outdated
Show resolved
Hide resolved
Signed-off-by: David SARTORI <david.sartori_externe@rte-france.com>
Signed-off-by: David SARTORI <david.sartori_externe@rte-france.com>
Signed-off-by: David SARTORI <david.sartori_externe@rte-france.com>
var network = mock(Network.class); | ||
var context = mock(ShortCircuitRunContext.class); | ||
var busbarSection = mock(BusbarSection.class); | ||
var terminal = mock(Terminal.class); | ||
var busView = mock(BusView.class); | ||
var busId = "bus1"; | ||
|
||
when(context.getBusId()).thenReturn(busId); | ||
doReturn(busbarSection).when(network).getIdentifiable(busId); | ||
when(busbarSection.getTerminal()).thenReturn(terminal); | ||
when(terminal.getBusView()).thenReturn(busView); | ||
when(busView.getBus()).thenReturn(null); | ||
|
||
var exception = (ShortCircuitException) catchRuntimeException(() -> workerService.getBusFaultFromBusId(network, context)); | ||
assertThat(exception.getType()).isEqualTo(BUS_OUT_OF_VOLTAGE); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@etiennehomer
I'm not sure we should use "var", what do you think ?
In such a small scope, I guess it's ok
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes why not in a small test method like this
Signed-off-by: David SARTORI <david.sartori_externe@rte-france.com>
src/test/java/org/gridsuite/shortcircuit/server/service/ShortCircuitServiceTest.java
Outdated
Show resolved
Hide resolved
Signed-off-by: David SARTORI <david.sartori_externe@rte-france.com>
Signed-off-by: David SARTORI <david.sartori_externe@rte-france.com>
Signed-off-by: David SARTORI <david.sartori_externe@rte-france.com>
Signed-off-by: David SARTORI <david.sartori_externe@rte-france.com>
|
No description provided.