Skip to content

Commit

Permalink
Fix user agent value
Browse files Browse the repository at this point in the history
  • Loading branch information
lezzago committed Apr 16, 2021
1 parent 4f324c4 commit 8df2300
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ internal class AlertingPlugin : PainlessExtension, ActionPlugin, ScriptPlugin, R
}

companion object {
@JvmField val OPEN_SEARCH_DASHBOARDS_USER_AGENT = "OpenSearchDashboards"
@JvmField val OPEN_SEARCH_DASHBOARDS_USER_AGENT = "OpenSearch-Dashboards"
@JvmField val UI_METADATA_EXCLUDE = arrayOf("monitor.${Monitor.UI_METADATA_FIELD}")
@JvmField val MONITOR_BASE_URI = "/_opendistro/_alerting/monitors"
@JvmField val DESTINATION_BASE_URI = "/_opendistro/_alerting/destinations"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ class MonitorRestApiIT : AlertingRestTestCase() {

fun `test getting UI metadata monitor from Kibana`() {
val monitor = createRandomMonitor(refresh = true, withMetadata = true)
val header = BasicHeader(HttpHeaders.USER_AGENT, "Kibana")
val header = BasicHeader(HttpHeaders.USER_AGENT, "OpenSearch-Dashboards")
val getMonitor = getMonitor(monitorId = monitor.id, header = header)
assertEquals("", monitor.uiMetadata, getMonitor.uiMetadata)
}
Expand Down Expand Up @@ -430,7 +430,7 @@ class MonitorRestApiIT : AlertingRestTestCase() {
fun `test query a monitor with UI metadata from OpenSearchDashboards`() {
val monitor = createRandomMonitor(refresh = true, withMetadata = true)
val search = SearchSourceBuilder().query(QueryBuilders.termQuery("_id", monitor.id)).toString()
val header = BasicHeader(HttpHeaders.USER_AGENT, "OpenSearchDashboards")
val header = BasicHeader(HttpHeaders.USER_AGENT, "OpenSearch-Dashboards")
val searchResponse = client().makeRequest(
"GET",
"$ALERTING_BASE_URI/_search",
Expand Down

0 comments on commit 8df2300

Please sign in to comment.