??????????????????ν???????????
?????Matthew Skelton ???????[ 2016/12/30 10:36:41 ] ??????????????? ???????
??????????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???????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11