Exemplo n.º 1
0
 @Test(expected = NoSuchElementException.class)
 public void testParseUsernameWithoutTheKeyMessageInTheJSON() {
   githubRequest = RequestValues.getRequest9();
   hook = new JiraServiceHook();
   hook.setGithubRequest(githubRequest);
   hook.convertGithubRequestToJson();
   hook.parseGithubJson();
 }
Exemplo n.º 2
0
 @Test(expected = NullPointerException.class)
 public void testParseUsernameWithoutTheKeyUsernameInTheJSON() {
   githubRequest = RequestValues.getRequest10();
   hook = new JiraServiceHook();
   hook.setGithubRequest(githubRequest);
   hook.convertGithubRequestToJson();
   hook.parseGithubJson();
 }
Exemplo n.º 3
0
  @Test
  public void testParseUsernameWithAValidUsername() {
    String expected = "bennyn";
    String result = null;

    githubRequest = RequestValues.getRequest1();
    hook = new JiraServiceHook();
    hook.setGithubRequest(githubRequest);
    hook.convertGithubRequestToJson();
    hook.parseGithubJson();
    result = hook.getUsername();

    assertEquals("Test if a username can be parsed from a github request.", expected, result);
  }