Skip to content

Fix failing test cases (#66) #67

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
import com.ericsson.eiffelcommons.http.HttpRequest.HttpMethod;

public class HttpRequestTest {
private static final String URL_1 = "http://something.com";
private static final String URL_1 = "http://some0thing.com";
private static final String URL_2 = "http://something.com/";
private static final String URL_BAD_PROTOCOL = "httpl://something.com/";
private static final String URL_BAD_SYNTAX = "http:<<something.com/";
Expand All @@ -57,7 +57,7 @@ public class HttpRequestTest {
@Test
public void testBuildingOfURI() throws Exception {
HttpRequest request = new HttpRequest(HttpMethod.POST);
request.setBaseUrl(URL_1);
request.setBaseUrl(URL_2);
request.setEndpoint(ENDPOINT_1);
URIBuilder builder = (URIBuilder) Whitebox.invokeMethod(request, "createURIBuilder");
assertEquals(EXPECTED_URI, builder.toString());
Expand All @@ -75,7 +75,7 @@ public void testBuildingOfURI() throws Exception {
assertEquals(EXPECTED_URI, builder.toString());

request = new HttpRequest(HttpMethod.PUT);
request.setBaseUrl(URL_1);
request.setBaseUrl(URL_2);
request.setEndpoint(ENDPOINT_2);
builder = (URIBuilder) Whitebox.invokeMethod(request, "createURIBuilder");
assertEquals(EXPECTED_URI, builder.toString());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.MalformedURLException;
import java.net.ServerSocket;
import java.net.URISyntaxException;
import java.net.UnknownHostException;
Expand All @@ -20,6 +19,7 @@
import javax.xml.bind.DatatypeConverter;

import org.apache.http.client.ClientProtocolException;
import org.apache.http.conn.UnsupportedSchemeException;
import org.json.JSONException;
import org.json.JSONObject;
import org.junit.BeforeClass;
Expand All @@ -33,11 +33,11 @@ public class JenkinsManagerTest {

private static final String UNKNOWN_HOST = "!¤€31";
private static final int PORT_OUT_OF_RANGE = 1000000;
private static final String INVALID_PROTOCOL = "httg";
private static final String URL = "http://localhost";
private static final String USERNAME = "username";
private static final String PASSWORD = "password";
private static final String PROTOCOL = "http";
private static final String INVALID_PROTOCOL = "httg";
private static final String HOST = "localhost";
private static final String ENDPOINT_CRUMB = "/crumbIssuer/api/json";
private static final String RESPONSE_CRUMB = "{\"crumb\":\"fb171d526b9cc9e25afe80b356e12cb7\",\"crumbRequestField\":\".crumb\"}";
Expand Down Expand Up @@ -119,7 +119,7 @@ public void jenkinsManagerConstructorFailCrumb()
assertEquals("", actualCrumb);
}

@Test(expected = MalformedURLException.class)
@Test(expected = UnsupportedSchemeException.class)
public void jenkinsManagerConstructorInvalidProtocol()
throws ClientProtocolException, URISyntaxException, IOException {
new JenkinsManager(INVALID_PROTOCOL, HOST, port, USERNAME, PASSWORD);
Expand Down