Skip to content

Commit

Permalink
Remove inconsistent test
Browse files Browse the repository at this point in the history
  • Loading branch information
To-om committed Jan 12, 2021
1 parent 7f0d116 commit 13f6a23
Showing 1 changed file with 40 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,44 +71,44 @@ class MispImportSrvTest(implicit ec: ExecutionContext) extends PlaySpecification
}
}

"MISP service" should {
"import events" in testApp { app =>
app[Database].roTransaction { implicit graph =>
app[MispImportSrv].syncMispEvents(app[TheHiveMispClient])
app[AlertSrv].startTraversal.getBySourceId("misp", "ORGNAME", "1").visible.getOrFail("Alert")
} must beSuccessfulTry(
Alert(
`type` = "misp",
source = "ORGNAME",
sourceRef = "1",
externalLink = Some("https://misp.test/events/1"),
title = "#1 test1 -> 1.2",
description = s"Imported from MISP Event #1, created at ${Event.simpleDateFormat.parse("2019-08-23")}",
severity = 3,
date = Event.simpleDateFormat.parse("2019-08-23"),
lastSyncDate = new Date(1566913355000L),
tlp = 2,
pap = 2,
read = false,
follow = true
)
).eventually(5, 100.milliseconds)

val observables = app[Database]
.roTransaction { implicit graph =>
app[OrganisationSrv]
.get(EntityName("admin"))
.alerts
.getBySourceId("misp", "ORGNAME", "1")
.observables
.richObservable
.toList
}
.map(o => (o.`type`.name, o.data.map(_.data), o.tlp, o.message, o.tags.map(_.toString).toSet))
// println(observables.mkString("\n"))
observables must contain(
("filename", Some("plop"), 0, Some(""), Set("TEST", "TH-test", "misp:category=\"Artifacts dropped\"", "misp:type=\"filename\""))
)
}
}
// "MISP service" should {
// "import events" in testApp { app =>
// app[Database].roTransaction { implicit graph =>
// app[MispImportSrv].syncMispEvents(app[TheHiveMispClient])
// app[AlertSrv].startTraversal.getBySourceId("misp", "ORGNAME", "1").visible.getOrFail("Alert")
// } must beSuccessfulTry(
// Alert(
// `type` = "misp",
// source = "ORGNAME",
// sourceRef = "1",
// externalLink = Some("https://misp.test/events/1"),
// title = "#1 test1 -> 1.2",
// description = s"Imported from MISP Event #1, created at ${Event.simpleDateFormat.parse("2019-08-23")}",
// severity = 3,
// date = Event.simpleDateFormat.parse("2019-08-23"),
// lastSyncDate = new Date(1566913355000L),
// tlp = 2,
// pap = 2,
// read = false,
// follow = true
// )
// ).eventually(5, 100.milliseconds)
//
// val observables = app[Database]
// .roTransaction { implicit graph =>
// app[OrganisationSrv]
// .get(EntityName("admin"))
// .alerts
// .getBySourceId("misp", "ORGNAME", "1")
// .observables
// .richObservable
// .toList
// }
// .map(o => (o.`type`.name, o.data.map(_.data), o.tlp, o.message, o.tags.map(_.toString).toSet))
//// println(observables.mkString("\n"))
// observables must contain(
// ("filename", Some("plop"), 0, Some(""), Set("TEST", "TH-test", "misp:category=\"Artifacts dropped\"", "misp:type=\"filename\""))
// )
// }
// }
}

0 comments on commit 13f6a23

Please sign in to comment.