コード例 #1
0
  @Test
  public void testDoc12() throws Exception {
    ActionDoc doc = callApi("method12");

    assertThat(doc.isDeprecated()).isFalse();
    assertThat(doc.getMethodComment()).isEqualTo("method twelve doc");
    assertThat(doc.getAuthor()).isEqualTo("sr");
    assertThat(doc.getVersion()).isEqualTo("1.0");
    assertThat(doc.getParameters()).isEmpty();
    assertThat(doc.getReturnMethod()).isEmpty();
  }
コード例 #2
0
  @Test
  public void testDoc9() throws Exception {
    ActionDoc doc = callApi("method9");

    assertThat(doc.isDeprecated()).isFalse();
    assertThat(doc.getMethodComment()).isEqualTo("method nine doc");
    assertThat(doc.getAuthor()).isEqualTo("dbs");
    assertThat(doc.getVersion()).isEqualTo("0.9");
    assertThat(doc.getParameters()).isEmpty();
    assertThat(doc.getReturnMethod()).isEmpty();
  }
コード例 #3
0
  @Test
  public void testDoc11() throws Exception {
    ActionDoc doc = callApi("method11");

    assertThat(doc.isDeprecated()).isFalse();
    assertThat(doc.getMethodComment()).isEqualTo("method eleven doc");
    assertThat(doc.getAuthor()).isEmpty();
    assertThat(doc.getVersion()).isEqualTo("1.0");
    assertThat(doc.getParameters()).hasSize(2);
    assertThat(doc.getParameters()).contains(entry("a", "a desc"), entry("b", "b desc"));
    assertThat(doc.getReturnMethod()).isEmpty();
  }
コード例 #4
0
  @Test
  public void testDoc8() throws Exception {
    ActionDoc doc = callApi("method8");

    assertThat(doc.isDeprecated()).isFalse();
    assertThat(doc.getMethodComment()).isEqualTo("method eight doc");
    assertThat(doc.getAuthor()).isEqualTo("sr");
    assertThat(doc.getVersion()).isEqualTo("0.8");
    assertThat(doc.getParameters()).isEmpty();
    assertThat(doc.getReturnMethod()).hasSize(2);
    assertThat(doc.getReturnMethod()).contains(entry("p1", "p1 desc"), entry("p2", "p2 desc"));
  }
コード例 #5
0
  @Test
  public void testDoc7() throws Exception {
    ActionDoc doc = callApi("method7");

    assertThat(doc.isDeprecated()).isTrue();
    assertThat(doc.getMethodComment()).isEqualTo("method seven doc");
    assertThat(doc.getAuthor()).isEqualTo("sr");
    assertThat(doc.getVersion()).isEqualTo("0.7");
    assertThat(doc.getParameters()).isEmpty();
    assertThat(doc.getReturnMethod()).hasSize(1);
    assertThat(doc.getReturnMethod()).contains(entry("p1", "p1 desc"));
  }
コード例 #6
0
  /**
   * to test the following need to activate Feature 'ALLOW_COMMENTS' for jackson parser
   *
   * <p>typical error is com.fasterxml.jackson.core.JsonParseException: Unexpected character ('/'
   * (code 47)): maybe a (non-standard) comment?
   *
   * @throws Exception
   */
  @Test
  public void testDoc1() throws Exception {
    ActionDoc doc = callApi("method1");

    assertThat(doc.isDeprecated()).isTrue();
    assertThat(doc.getMethodComment())
        .isEqualTo("this method is used to test the documentation generation");
    assertThat(doc.getAuthor()).isEqualTo("dbs");
    assertThat(doc.getVersion()).isEqualTo("0.1");
    assertThat(doc.getParameters()).hasSize(5);
    assertThat(doc.getParameters())
        .contains(
            entry("a", "property a integer"),
            entry("b", "property b string"),
            entry("c", "property c string"),
            entry("d", "property d boolean"),
            entry("e", "array of integers"));
    assertThat(doc.getReturnMethod()).hasSize(2);
    assertThat(doc.getReturnMethod())
        .contains(
            entry("errors", "list of failed fields"),
            entry("success", "true for success, false otherwise"));
  }