@Test
public void shouldNotCreateCredentialsForBadUrl1() throws Exception {

    User user = login();
    String scmPath = "/organizations/" + getOrgName() + "/scm/git/";
    // First create a credential
    String scmValidatePath = scmPath + "validate";
    // We're relying on github letting you do a git-ls for repos with bad creds so long as they're public
    Map params = ImmutableMap.of(
        "userName", "someguy",
        "password", "password",
        "repositoryUrl", "htt"
    );
    Map resp = new RequestBuilder(baseUrl)
        .status(400)
        .jwtToken(getJwtToken(j.jenkins,user.getId(), user.getId()))
        .crumb( crumb )
        .data(params)
        .put(scmValidatePath)
        .build(Map.class);
    assertTrue(resp.get("message").toString().toLowerCase().contains("invalid url"));
}