Skip to content

Commit

Permalink
[backend/frontend] refact
Browse files Browse the repository at this point in the history
  • Loading branch information
savacano28 committed Oct 11, 2024
1 parent b05ca5c commit bc45db4
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()));

Check warning on line 40 in openbas-api/src/main/java/io/openbas/utils/ExerciseMapper.java

View check run for this annotation

Codecov / codecov/patch

openbas-api/src/main/java/io/openbas/utils/ExerciseMapper.java#L34-L40

Added lines #L34 - L40 were not covered by tests

return simple;

Check warning on line 42 in openbas-api/src/main/java/io/openbas/utils/ExerciseMapper.java

View check run for this annotation

Codecov / codecov/patch

openbas-api/src/main/java/io/openbas/utils/ExerciseMapper.java#L42

Added line #L42 was not covered by tests
}
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 bc45db4

Please sign in to comment.