SymfonionMissingElementException.java

1
package com.github.dakusui.symfonion.exceptions;
2
3
import com.github.dakusui.json.JsonUtils;
4
import com.google.gson.JsonElement;
5
import com.google.gson.JsonObject;
6
7
import java.io.File;
8
import java.io.Serial;
9
10
public class SymfonionMissingElementException extends SymfonionSyntaxException {
11
  
12
  /**
13
   * Serial version UID.
14
   */
15
  @Serial
16
  private static final long serialVersionUID = -3887808558721595868L;
17
  
18
  public SymfonionMissingElementException(JsonElement problemCausingJsonNode, Object relativePathFromProblemCausingJsonNode, JsonObject root, File sourceFile) {
19
    super(formatMessage(problemCausingJsonNode, relativePathFromProblemCausingJsonNode), problemCausingJsonNode, root, sourceFile);
20
  }
21
  
22
  private static String formatMessage(JsonElement problemCausingJsonNode, Object relPath) {
23 1 1. formatMessage : negated conditional → KILLED
    if (relPath instanceof Integer) {
24 1 1. formatMessage : replaced return value with "" for com/github/dakusui/symfonion/exceptions/SymfonionMissingElementException::formatMessage → NO_COVERAGE
      return String.format("%s at this path requires %dth element", JsonUtils.summarizeJsonElement(problemCausingJsonNode), relPath);
25
    }
26 1 1. formatMessage : replaced return value with "" for com/github/dakusui/symfonion/exceptions/SymfonionMissingElementException::formatMessage → KILLED
    return String.format("%s at this path requires child element %s", JsonUtils.summarizeJsonElement(problemCausingJsonNode), relPath);
27
  }
28
  
29
}

Mutations

23

1.1
Location : formatMessage
Killed by : com.github.dakusui.symfonion.tests.InvalidJsonErrorTest.invalid_01(com.github.dakusui.symfonion.tests.InvalidJsonErrorTest)
negated conditional → KILLED

24

1.1
Location : formatMessage
Killed by : none
replaced return value with "" for com/github/dakusui/symfonion/exceptions/SymfonionMissingElementException::formatMessage → NO_COVERAGE

26

1.1
Location : formatMessage
Killed by : com.github.dakusui.symfonion.tests.InvalidJsonErrorTest.invalid_01(com.github.dakusui.symfonion.tests.InvalidJsonErrorTest)
replaced return value with "" for com/github/dakusui/symfonion/exceptions/SymfonionMissingElementException::formatMessage → KILLED

Active mutators

Tests examined


Report generated by PIT 1.15.3