@@ -5055,6 +5055,9 @@ class MonitorDataSourcesIT : AlertingSingleNodeTestCase() {
5055
5055
assertNotNull(getWorkflowResponse)
5056
5056
assertEquals(workflowId, getWorkflowResponse.id)
5057
5057
5058
+ // Verify that monitor workflow metadata exists
5059
+ assertNotNull(searchMonitorMetadata(" ${workflowResponse.id} -metadata-${monitorResponse.id} -metadata" ))
5060
+
5058
5061
deleteWorkflow(workflowId, false )
5059
5062
// Verify that the workflow is deleted
5060
5063
try {
@@ -5070,6 +5073,19 @@ class MonitorDataSourcesIT : AlertingSingleNodeTestCase() {
5070
5073
// Verify that the monitor is not deleted
5071
5074
val existingDelegate = getMonitorResponse(monitorResponse.id)
5072
5075
assertNotNull(existingDelegate)
5076
+
5077
+ // Verify that the monitor workflow metadata is deleted
5078
+ try {
5079
+ searchMonitorMetadata(" ${workflowResponse.id} -metadata-${monitorResponse.id} -metadata" )
5080
+ fail(" expected searchMonitorMetadata method to throw exception" )
5081
+ } catch (e: Exception ) {
5082
+ e.message?.let {
5083
+ assertTrue(
5084
+ " Expected 0 hits for searchMonitorMetadata, got non-0 results." ,
5085
+ it.contains(" List is empty" )
5086
+ )
5087
+ }
5088
+ }
5073
5089
}
5074
5090
5075
5091
fun `test delete workflow delegate monitor deleted` () {
@@ -5095,6 +5111,9 @@ class MonitorDataSourcesIT : AlertingSingleNodeTestCase() {
5095
5111
assertNotNull(getWorkflowResponse)
5096
5112
assertEquals(workflowId, getWorkflowResponse.id)
5097
5113
5114
+ // Verify that monitor workflow metadata exists
5115
+ assertNotNull(searchMonitorMetadata(" ${workflowResponse.id} -metadata-${monitorResponse.id} -metadata" ))
5116
+
5098
5117
deleteWorkflow(workflowId, true )
5099
5118
// Verify that the workflow is deleted
5100
5119
try {
@@ -5118,6 +5137,18 @@ class MonitorDataSourcesIT : AlertingSingleNodeTestCase() {
5118
5137
)
5119
5138
}
5120
5139
}
5140
+ // Verify that the monitor workflow metadata is deleted
5141
+ try {
5142
+ searchMonitorMetadata(" ${workflowResponse.id} -metadata-${monitorResponse.id} -metadata" )
5143
+ fail(" expected searchMonitorMetadata method to throw exception" )
5144
+ } catch (e: Exception ) {
5145
+ e.message?.let {
5146
+ assertTrue(
5147
+ " Expected 0 hits for searchMonitorMetadata, got non-0 results." ,
5148
+ it.contains(" List is empty" )
5149
+ )
5150
+ }
5151
+ }
5121
5152
}
5122
5153
5123
5154
fun `test delete executed workflow with metadata deleted` () {
0 commit comments