@Test
public void getRepositoriesWithoutCredentialId() throws IOException, UnirestException {

    createCredential(BitbucketServerScm.ID);
    Map repoResp = new RequestBuilder(baseUrl)
        .status(200)
        .jwtToken(getJwtToken(j.jenkins, authenticatedUser.getId(), authenticatedUser.getId()))
        .get("/organizations/jenkins/scm/"+BitbucketServerScm.ID+"/organizations/TESTP/repositories/?apiUrl="+apiUrl)
        .build(Map.class);
    List repos = (List) ((Map)repoResp.get("repositories")).get("items");
    assertEquals(2, repos.size());
    assertEquals("empty-repo-test", ((Map)repos.get(0)).get("name"));
    assertEquals("empty-repo-test", ((Map)repos.get(0)).get("description"));
    assertTrue((Boolean) ((Map)repos.get(0)).get("private"));
    assertNull(((Map)repos.get(0)).get("defaultBranch"));
    assertEquals("pipeline-demo-test", ((Map)repos.get(1)).get("name"));
    assertEquals("pipeline-demo-test", ((Map)repos.get(1)).get("description"));
    assertTrue((Boolean) ((Map)repos.get(1)).get("private"));
    assertEquals("master",((Map)repos.get(1)).get("defaultBranch"));
}