Move parameters from study-server#81
Conversation
|
e12fd7d to
8147f0c
Compare
828480e to
3ac7d11
Compare
src/main/java/org/gridsuite/shortcircuit/server/ParametersController.java
Outdated
Show resolved
Hide resolved
src/main/java/org/gridsuite/shortcircuit/server/converter/UuidHttpConverter.java
Outdated
Show resolved
Hide resolved
src/main/java/org/gridsuite/shortcircuit/server/ParametersController.java
Show resolved
Hide resolved
src/main/java/org/gridsuite/shortcircuit/server/dto/ShortCircuitParametersInfos.java
Outdated
Show resolved
Hide resolved
src/main/java/org/gridsuite/shortcircuit/server/dto/ShortCircuitParametersInfos.java
Outdated
Show resolved
Hide resolved
src/test/java/org/gridsuite/shortcircuit/server/dto/ShortCircuitParametersInfosTest.java
Show resolved
Hide resolved
src/test/java/org/gridsuite/shortcircuit/server/dto/ShortCircuitParametersInfosTest.java
Show resolved
Hide resolved
src/test/java/org/gridsuite/shortcircuit/server/service/AnalysisParametersTest.java
Outdated
Show resolved
Hide resolved
src/test/java/org/gridsuite/shortcircuit/server/service/ShortCircuitServiceTest.java
Show resolved
Hide resolved
|
|
||
| @ExtendWith({ MockitoExtension.class }) | ||
| @Slf4j | ||
| class ShortCircuitWorkerServiceTest implements WithAssertions { |
There was a problem hiding this comment.
Can you extract that in another PR ?
There was a problem hiding this comment.
done in #581, but can't really "move" out of this PR as the worker-service-test use the wrong name that I need
4805ebf to
c470c99
Compare
TheMaskedTurtle
left a comment
There was a problem hiding this comment.
Can you reduce a bit the unitary testing and add more integrated tests instead ? From the parameters controller endpoints to the DB for example.
src/main/java/org/gridsuite/shortcircuit/server/dto/ShortCircuitPredefinedConfiguration.java
Show resolved
Hide resolved
src/main/java/org/gridsuite/shortcircuit/server/ShortCircuitController.java
Outdated
Show resolved
Hide resolved
src/main/java/org/gridsuite/shortcircuit/server/ShortCircuitParametersController.java
Outdated
Show resolved
Hide resolved
src/main/java/org/gridsuite/shortcircuit/server/entities/AnalysisParametersEntity.java
Outdated
Show resolved
Hide resolved
src/main/java/org/gridsuite/shortcircuit/server/entities/AnalysisParametersEntity.java
Outdated
Show resolved
Hide resolved
| void testUpdate2() { | ||
| AnalysisParametersEntity entity1 = new AnalysisParametersEntity(); | ||
| AnalysisParametersEntity entity2 = new AnalysisParametersEntity( | ||
| ShortCircuitConstants.DEFAULT_WITH_LIMIT_VIOLATIONS, |
There was a problem hiding this comment.
Why don't you use these ShortCircuitConstants in the definition of default values in the entity ?
There was a problem hiding this comment.
Because their the defaults of PowSyBl, not the GridSuite ones.
And I use this fact to create differences in this test.
src/test/java/org/gridsuite/shortcircuit/server/service/ShortCircuitServiceTest.java
Show resolved
Hide resolved
| verify(pEntity).getPredefinedParameters(); | ||
| verify(pEntity).isWithLimitViolations(); | ||
| verify(pEntity).isWithVoltageResult(); | ||
| verify(pEntity).isWithFortescueResult(); | ||
| verify(pEntity).isWithFeederResult(); | ||
| verify(pEntity).getStudyType(); | ||
| verify(pEntity).getMinVoltageDropProportionalThreshold(); | ||
| verify(pEntity).isWithLoads(); | ||
| verify(pEntity).isWithShuntCompensators(); | ||
| verify(pEntity).isWithVscConverterStations(); | ||
| verify(pEntity).isWithNeutralPosition(); | ||
| verify(pEntity, atLeastOnce()).getInitialVoltageProfileMode(); |
There was a problem hiding this comment.
Not sure this is really necessary
There was a problem hiding this comment.
It's not an important check, but necessary to pass verifyNoMoreInteractions().
| return CompletableFuture.completedFuture(this.result); | ||
| } | ||
| @Test | ||
| void testUpdateExistingParameters() { |
There was a problem hiding this comment.
In the end what do you want to test ? There are too many checks here, it feels like not all of them bring value
There was a problem hiding this comment.
I added comments to explain, and I de-duplicate some code.
There was a problem hiding this comment.
You created a lot of test code for just few lines of code in ShortCircuitService, that's a bit of overtesting here
There was a problem hiding this comment.
I just tested all cases possibles:
- get+delete+update+reset * existing+non-existing in db
- create + create default
I don't think there is more than these cases that can happen?
There was a problem hiding this comment.
I said you overtested this
There was a problem hiding this comment.
You mean too much test cases or too much checks in a test?
ayolab
left a comment
There was a problem hiding this comment.
we don't have the same results as before, the "withFortescueResult" should be set to true only in case of "One bus" analysis
src/main/java/org/gridsuite/shortcircuit/server/service/ShortCircuitService.java
Outdated
Show resolved
Hide resolved
src/main/java/org/gridsuite/shortcircuit/server/service/ShortCircuitService.java
Outdated
Show resolved
Hide resolved
| @Getter | ||
| @Setter | ||
| @Entity | ||
| @Table(name = "shortcircuit_parameters") |
There was a problem hiding this comment.
| @Table(name = "shortcircuit_parameters") | |
| @Table(name = "short_circuit_parameters") |
in order for the data migration script to work, the parameters table must have the same name as the one defined in study-server
There was a problem hiding this comment.
Problem fixed in gridsuite/deployment#417
|





Need PR #96 to have correct diff.