Four Hundred Tests Passing
public final class Settings {
private static final Settings INSTANCE = new Settings();
private final Map<String, String> values = new HashMap<>();
public static Settings get() { return INSTANCE; }
public void set(String k, String v) { values.put(k, v); }
public String get(String k) { return values.get(k); }
}
The suite has 412 tests. Every one of them passes when run on its own. Run together, three fail, and which three changes when the runner shuffles the order. The cause is found: BillingTest calls Settings.get().set("currency", "EUR") in a setup method and never puts it back.
Which change removes the cause rather than the symptom?
Sign in to answer questions and track your progress
Sign In