@Test public void testDeleteQuestion() { Analysis a = new Analysis( "analysis", Maps.newHashMap(Collections.singletonMap("question", "questionContent"))); a.deleteQuestion("question"); assertThat(a.getQuestions().size(), is(0)); _thrown.expect(BatfishException.class); _thrown.expectMessage(equalTo("Question question does not exist for analysis analysis")); a.deleteQuestion("question"); }
public void deleteQuestion(String questionName) { if (!_questions.containsKey(questionName)) { throw new BatfishException( String.format("Question %s does not exist for analysis %s", questionName, _name)); } _questions.remove(questionName); }
Analysis { public void deleteQuestion(String questionName) { if (!_questions.containsKey(questionName)) { throw new BatfishException( String.format("Question %s does not exist for analysis %s", questionName, _name)); } _questions.remove(questionName); } }
Analysis { public void deleteQuestion(String questionName) { if (!_questions.containsKey(questionName)) { throw new BatfishException( String.format("Question %s does not exist for analysis %s", questionName, _name)); } _questions.remove(questionName); } @JsonCreator  Analysis(
      @JsonProperty(PROP_NAME) String name,
      @JsonProperty(PROP_QUESTIONS) @Nullable Map<String, String> questions); }
Analysis { public void deleteQuestion(String questionName) { if (!_questions.containsKey(questionName)) { throw new BatfishException( String.format("Question %s does not exist for analysis %s", questionName, _name)); } _questions.remove(questionName); } @JsonCreator  Analysis(
      @JsonProperty(PROP_NAME) String name,
      @JsonProperty(PROP_QUESTIONS) @Nullable Map<String, String> questions); @JsonProperty(PROP_NAME) String getName(); @JsonProperty(PROP_QUESTIONS) Map<String, String> getQuestions(); void addQuestion(String questionName, String questionContent); void deleteQuestion(String questionName); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode(); }
Analysis { public void deleteQuestion(String questionName) { if (!_questions.containsKey(questionName)) { throw new BatfishException( String.format("Question %s does not exist for analysis %s", questionName, _name)); } _questions.remove(questionName); } @JsonCreator  Analysis(
      @JsonProperty(PROP_NAME) String name,
      @JsonProperty(PROP_QUESTIONS) @Nullable Map<String, String> questions); @JsonProperty(PROP_NAME) String getName(); @JsonProperty(PROP_QUESTIONS) Map<String, String> getQuestions(); void addQuestion(String questionName, String questionContent); void deleteQuestion(String questionName); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode();  }