Package com.ibm.sbt.services.client.connections.wikis

Examples of com.ibm.sbt.services.client.connections.wikis.WikiService


    assertEquals("communities/service/atom/community/members?communityUuid=thisIsACommunityUuid", url);
  }

  @Test
  public void testGenerateURLVariableParameters() {
    WikiService service = new WikiService();
    //URL pattern is "wikis/{authType}/api/wiki/{wikiLabel}/page/{wikiPage}/entry"
    String wikiLabel = "myWikiLabel";
    String pageLabel = "myPageLabel";
    String url = WikiUrls.WIKI_PAGE.format(service, WikiUrls.getWikiLabel(wikiLabel), WikiUrls.getWikiPage(pageLabel));
    assertEquals("wikis/basic/api/wiki/"+wikiLabel+"/page/"+pageLabel+"/entry", url);
View Full Code Here


    assertEquals("wikis/basic/api/wiki/"+wikiLabel+"/page/"+pageLabel+"/entry", url);
  }

  @Test
  public void testGenerateURLUnsortedParameters() {
    WikiService service = new WikiService();
    //URL pattern is "wikis/{authType}/api/wiki/{wikiLabel}/page/{wikiPage}/entry"
    String wikiLabel = "myWikiLabel";
    String pageLabel = "myPageLabel";
    //This url has the correct parameters but in a different order. It works regardless. The first parameter needs to be the Version, though
    String url = WikiUrls.WIKI_PAGE.format(service, WikiUrls.getWikiPage(pageLabel), WikiUrls.getWikiLabel(wikiLabel));
View Full Code Here

    assertEquals("wikis/basic/api/wiki/"+wikiLabel+"/page/"+pageLabel+"/entry", url);
  }

  @Test
  public void testGenerateURLRigtNumberOfParametersButWrongParameter() {
    WikiService service = new WikiService();
    //URL pattern is "wikis/{authType}/api/wiki/{wikiLabel}/page/{wikiPage}/entry"
    String wikiLabel = "myWikiLabel";
    String pageLabel = "myPageLabel";
    //This url has the correct number of parameters but one of the parameters is not correct
    thrown.expect(IllegalArgumentException.class);
View Full Code Here

    assertEquals("wikis/basic/api/wiki/"+wikiLabel+"/page/"+pageLabel+"/entry", url);
  }

  @Test
  public void testGenerateURLVariableAndEmptyParameters() {
    WikiService service = new WikiService();
    //URL pattern is "wikis/{authType}/api/wiki/{wikiLabel}/page/{wikiPage}/entry
    //When a parameter is empty, it is simply removed from the url
    String url2 = WikiUrls.WIKI_PAGE.format(service, WikiUrls.getWikiLabel(""), WikiUrls.getWikiPage("myPageLabel"));
    assertEquals("wikis/basic/api/wiki/page/myPageLabel/entry", url2);
  }
View Full Code Here

    assertEquals("wikis/basic/api/wiki/page/myPageLabel/entry", url2);
  }

  @Test
  public void testGenerateURLMissingParameters() {
    WikiService service = new WikiService();
    String userId = "abcde";
    String fileId = "1234";
    //This would be the url with all the needed parameters
    //String url = FileUrls.SINGLE_COMMENT_USER_FILE.format(getApiVersion(), getAuthTypeBasic(), AccessType.PUBLIC.get(), FileUrlParts.userId.get(userId), FileUrlParts.fileId.get(fileId), FileUrlParts.commentId.get(commentId));
View Full Code Here

        basicEndpoint.setUrl(url);
        basicEndpoint.setForceTrustSSLCertificate(true);
        basicEndpoint.setUser(user);
        basicEndpoint.setPassword(password);

        this.wikiService = new WikiService();
        this.setEndpoint(basicEndpoint);
    }
View Full Code Here

TOP

Related Classes of com.ibm.sbt.services.client.connections.wikis.WikiService

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.