Fix incorrect splitting of multiple http integration endpoints.

Closes .
This commit is contained in:
Orne Brocaar 2022-11-17 13:00:17 +00:00
parent bfcff17f34
commit 9fe8ee2474

@ -29,7 +29,7 @@ impl Integration {
json: conf.json,
endpoints: conf
.event_endpoint_url
.split(' ')
.split(',')
.map(|s| s.trim().to_string())
.collect(),
}
@ -183,6 +183,26 @@ pub mod test {
use super::*;
use httpmock::prelude::*;
#[test]
fn test_url_split() {
let i = Integration::new(&HttpConfiguration {
headers: HashMap::new(),
json: true,
event_endpoint_url: "http://a.com,http://b.com, http://c.com , http://d.com"
.to_string(),
});
assert_eq!(
vec![
"http://a.com".to_string(),
"http://b.com".to_string(),
"http://c.com".to_string(),
"http://d.com".to_string(),
],
i.endpoints
);
}
#[tokio::test]
async fn test_http() {
let server = MockServer::start();