Skip to content

Commit 13ab75e

Browse files
committed
fix sonar issues
1 parent 0ede4d1 commit 13ab75e

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/main/java/org/gridsuite/computation/service/AbstractResultContext.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ public Message<String> toMessage(ObjectMapper objectMapper) {
7171
.build();
7272
}
7373

74+
@SuppressWarnings("unused")
7475
protected Map<String, String> getSpecificMsgHeaders(ObjectMapper ignoredObjectMapper) {
7576
return Map.of();
7677
}

src/test/java/org/gridsuite/computation/ComputationTest.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
import java.util.UUID;
3838
import java.util.concurrent.CancellationException;
3939
import java.util.concurrent.CompletableFuture;
40+
import java.util.function.Consumer;
4041

4142
import static org.gridsuite.computation.service.NotificationService.*;
4243
import static org.junit.jupiter.api.Assertions.*;
@@ -161,7 +162,10 @@ protected AbstractResultContext<MockComputationRunContext> fromMessage(Message<S
161162
}
162163

163164
@Override
164-
protected void saveResult(Network network, AbstractResultContext<MockComputationRunContext> resultContext, Object result) { }
165+
protected void saveResult(Network network, AbstractResultContext<MockComputationRunContext> resultContext, Object result) {
166+
// Empty implementation - this is a mock/test implementation that doesn't need to persist results
167+
// The actual result saving is handled by the real implementation or is not needed for testing
168+
}
165169

166170
@Override
167171
protected String getComputationType() {
@@ -258,7 +262,8 @@ void testComputationFailed() {
258262
runContext.setComputationResWanted(ComputationResultWanted.FAIL);
259263

260264
// execution / cleaning
261-
assertThrows(ComputationException.class, () -> workerService.consumeRun().accept(message));
265+
Consumer<Message<String>> consumer = workerService.consumeRun();
266+
assertThrows(ComputationException.class, () -> consumer.accept(message));
262267
assertNull(resultService.findStatus(RESULT_UUID));
263268
}
264269

0 commit comments

Comments
 (0)