Fix Default Port for PopertyHandler
Signed-off-by: SirWayne <dennis.melzer@bosch-si.com>
This commit is contained in:
@@ -17,7 +17,8 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
|
|||||||
@ConfigurationProperties("hawkbit.artifact.url")
|
@ConfigurationProperties("hawkbit.artifact.url")
|
||||||
public class ArtifactUrlHandlerProperties {
|
public class ArtifactUrlHandlerProperties {
|
||||||
private static final String DEFAULT_IP_LOCALHOST = "127.0.0.1";
|
private static final String DEFAULT_IP_LOCALHOST = "127.0.0.1";
|
||||||
private static final String LOCALHOST = "localhost:8080";
|
private static final String DEFAULT_PORT = "8080";
|
||||||
|
private static final String LOCALHOST = "localhost";
|
||||||
|
|
||||||
private final Http http = new Http();
|
private final Http http = new Http();
|
||||||
private final Https https = new Https();
|
private final Https https = new Https();
|
||||||
@@ -86,7 +87,7 @@ public class ArtifactUrlHandlerProperties {
|
|||||||
public static class Http implements ProtocolProperties {
|
public static class Http implements ProtocolProperties {
|
||||||
private String hostname = LOCALHOST;
|
private String hostname = LOCALHOST;
|
||||||
private String ip = DEFAULT_IP_LOCALHOST;
|
private String ip = DEFAULT_IP_LOCALHOST;
|
||||||
private String port = "";
|
private String port = DEFAULT_PORT;
|
||||||
/**
|
/**
|
||||||
* An ant-URL pattern with placeholder to build the URL on. The URL can
|
* An ant-URL pattern with placeholder to build the URL on. The URL can
|
||||||
* have specific artifact placeholder.
|
* have specific artifact placeholder.
|
||||||
@@ -136,7 +137,7 @@ public class ArtifactUrlHandlerProperties {
|
|||||||
public static class Https implements ProtocolProperties {
|
public static class Https implements ProtocolProperties {
|
||||||
private String hostname = LOCALHOST;
|
private String hostname = LOCALHOST;
|
||||||
private String ip = DEFAULT_IP_LOCALHOST;
|
private String ip = DEFAULT_IP_LOCALHOST;
|
||||||
private String port = "";
|
private String port = DEFAULT_PORT;
|
||||||
/**
|
/**
|
||||||
* An ant-URL pattern with placeholder to build the URL on. The URL can
|
* An ant-URL pattern with placeholder to build the URL on. The URL can
|
||||||
* have specific artifact placeholder.
|
* have specific artifact placeholder.
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ public class PropertyBasedArtifactUrlHandlerTest extends AbstractIntegrationTest
|
|||||||
final String url = urlHandlerProperties.getUrl(controllerId, softwareModuleId, fileName, sha1Hash,
|
final String url = urlHandlerProperties.getUrl(controllerId, softwareModuleId, fileName, sha1Hash,
|
||||||
UrlProtocol.HTTP);
|
UrlProtocol.HTTP);
|
||||||
assertEquals("http is build incorrect",
|
assertEquals("http is build incorrect",
|
||||||
"http://localhost/" + tenantAware.getCurrentTenant() + "/controller/v1/" + controllerId
|
"http://localhost:8080/" + tenantAware.getCurrentTenant() + "/controller/v1/" + controllerId
|
||||||
+ "/softwaremodules/" + localArtifact.getSoftwareModule().getId() + "/artifacts/"
|
+ "/softwaremodules/" + localArtifact.getSoftwareModule().getId() + "/artifacts/"
|
||||||
+ localArtifact.getFilename(),
|
+ localArtifact.getFilename(),
|
||||||
url);
|
url);
|
||||||
@@ -81,7 +81,7 @@ public class PropertyBasedArtifactUrlHandlerTest extends AbstractIntegrationTest
|
|||||||
final String url = urlHandlerProperties.getUrl(controllerId, softwareModuleId, fileName, sha1Hash,
|
final String url = urlHandlerProperties.getUrl(controllerId, softwareModuleId, fileName, sha1Hash,
|
||||||
UrlProtocol.HTTPS);
|
UrlProtocol.HTTPS);
|
||||||
assertEquals("https is build incorrect",
|
assertEquals("https is build incorrect",
|
||||||
"https://localhost/" + tenantAware.getCurrentTenant() + "/controller/v1/" + controllerId
|
"https://localhost:8080/" + tenantAware.getCurrentTenant() + "/controller/v1/" + controllerId
|
||||||
+ "/softwaremodules/" + localArtifact.getSoftwareModule().getId() + "/artifacts/"
|
+ "/softwaremodules/" + localArtifact.getSoftwareModule().getId() + "/artifacts/"
|
||||||
+ localArtifact.getFilename(),
|
+ localArtifact.getFilename(),
|
||||||
url);
|
url);
|
||||||
|
|||||||
Reference in New Issue
Block a user