Skip to content

Commit

Permalink
[backend/frontend] refact
Browse files Browse the repository at this point in the history
  • Loading branch information
savacano28 authored and johanah29 committed Oct 11, 2024
1 parent d76a5d3 commit 9780cfd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,8 @@ public ExerciseSimple fromRawExercise(RawExercise rawExercise) {
simple.setStatus(ExerciseStatus.valueOf(rawExercise.getExercise_status()));
simple.setStart(rawExercise.getExercise_start_date());
simple.setUpdatedAt(rawExercise.getExercise_updated_at());

simple.setExpectationResultByTypes(resultUtils.getResultsByTypes(rawExercise.getInject_ids()));

simple.setTargets(resultUtils.getInjectTargetWithResults(rawExercise.getInject_ids()));
simple.setExpectationResultByTypes(resultUtils.getResultsByTypes(rawExercise.getInject_ids()));

return simple;
}
Expand Down
6 changes: 1 addition & 5 deletions openbas-api/src/main/java/io/openbas/utils/ResultUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,7 @@ public class ResultUtils {

// -- UTILS --
public List<AtomicTestingMapper.ExpectationResultsByType> getResultsByTypes(List<String> injectIds) {
if (injectIds != null) {
return computeGlobalExpectationResults(injectIds);
} else {
return emptyList();
}
return computeGlobalExpectationResults(injectIds);
}

public List<InjectTargetWithResult> getInjectTargetWithResults(List<String> injectIds) {
Expand Down

0 comments on commit 9780cfd

Please sign in to comment.