??????????10?б?????????????????????????????????????1?????????13?п????????????????????????18?п?????
??????????????????????????????????Щ??????????????????????в????????????JSON???????????????????????
???????磬?????????????Ruby?????????????GitHub???????????
????require 'json'
????2
????3 file = open("Database_prequery_search.json")
????4 prequery = JSON.parse(file.read)
????5
????6 file = open("Database_postquery_search.json")
????7 postquery = JSON.parse(file.read)
????8
????9 file = open("Database_connectionfailed_search.json")
????10 connectionfailed = JSON.parse(file.read)
????11
????12 expected_prequery_event  = (prequery["hits"]["total"] == 1)
????13 expected_postquery_event = (postquery["hits"]["total"] == 1)
????14 unexpected_connectionfailed_event = (connectionfailed["hits"]["total"] == 0)
????15
????16 expected_prequery_event && expected_postquery_event && unexpected_connectionfailed_event
???????????'json' Ruby gem??????????????curl???????????Щ???????????????????????????????е???10?У?????12?е???14??????????????????????????????????e???????????DatabasePreQuery?????????????DatabasePostQuery????????????DatabaseConnectionFailed?????????????????????????????????????????????????Ruby??????“ture”?????????false????
?????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????JSON??????????????????????????
???????????????????????curl???????????????????GitHub?????????
????$ curl -XGET 'http://localhost:9200/_search?q=message:Database*&pretty' -d '
????{
????"query" : {
????"range" : {
????"@timestamp" : {
????"gte" : "now-10m/m"
????}
????}
????}
????}'
??????????????????и??????????????·?????????????????????????????????ID?????磬???????????????????????????????????ID????????????????????е????????????????????????????ò???й??????

???????????????ID????????????????????????Щ??????????????????????????????????????????Щ???????????????????????????????????????Щ?????е????????????????????????????????????????
????????????????????
????????????????????????????г??????????????????????????????????????????????????????????????浽????洢???????????????????????????????????????????????????????????????????????????????????????“???”???????????????????????????????1????????

????????????????????????????????????????????????????ó???????????????——????????????????????????????????????????????????????磬?????????????????????????
?????????????ID???????????????????????????????????????????????????е??Щ???????Щ?????????????ó???????????????У?

?????????????????????????????????????ID“AuditRecordCreated”д?????????????????Web??ó??????????????????????????????????????ID??

????????????????????????????????????????????????д??????????????????????
????Given I run a scenario as a Lawyer
????And I create a document
????[And I wait 5 seconds]
????When I search the logs API
????Then I should find a recent entry for “AuditRecordCreated”
????????ζ?????????????????????????????????????????????????????????Щ?????????????????Щ??????????????????????????????????
????????
????????????????????????????????????????????????й???????????????????????????????????豸??????????????????????????е????????????????????????ID?????????????????????????????????????????????????????????????????????ID????????????????????????????????????????????????????????????????磬????????????ι???????е???????????????????????????????????????????????????????????????????Щ???????????????????o?BDD???????