-
Notifications
You must be signed in to change notification settings - Fork 640
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feature/traversal-stream' into develop-th4
- Loading branch information
Showing
46 changed files
with
346 additions
and
389 deletions.
There are no files selected for viewing
Submodule ScalliGraph
updated
15 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,24 +2,23 @@ package org.thp.thehive.connector.cortex.services | |
|
||
import java.util.Date | ||
|
||
import scala.concurrent.Await | ||
import scala.concurrent.duration.DurationInt | ||
import scala.io.Source | ||
|
||
import play.api.libs.json.Json | ||
import play.api.test.PlaySpecification | ||
|
||
import org.thp.cortex.client.{CortexClient, TestCortexClientProvider} | ||
import org.thp.cortex.dto.v0.OutputJob | ||
import org.thp.scalligraph.AppBuilder | ||
import org.thp.scalligraph.auth.AuthContext | ||
import org.thp.scalligraph.models.{Database, DummyUserSrv} | ||
import org.thp.scalligraph.models.{Database, DummyUserSrv, Schema} | ||
import org.thp.scalligraph.steps.StepsOps._ | ||
import org.thp.thehive.TestAppBuilder | ||
import org.thp.thehive.connector.cortex.models.{Job, JobStatus} | ||
import org.thp.thehive.connector.cortex.models.{Job, JobStatus, TheHiveCortexSchemaProvider} | ||
import org.thp.thehive.models.Permissions | ||
import org.thp.thehive.services._ | ||
import org.thp.thehive.services.notification.triggers.JobFinished | ||
import play.api.libs.json.Json | ||
import play.api.test.PlaySpecification | ||
|
||
import scala.concurrent.Await | ||
import scala.concurrent.duration.DurationInt | ||
import scala.io.Source | ||
|
||
class JobSrvTest extends PlaySpecification with TestAppBuilder { | ||
implicit val authContext: AuthContext = DummyUserSrv(userId = "[email protected]", permissions = Permissions.all).authContext | ||
|
@@ -29,8 +28,8 @@ class JobSrvTest extends PlaySpecification with TestAppBuilder { | |
.bindActor[CortexActor]("cortex-actor") | ||
.bindToProvider[CortexClient, TestCortexClientProvider] | ||
.bind[Connector, TestConnector] | ||
.`override`(_.bindToProvider[Schema, TheHiveCortexSchemaProvider]) | ||
|
||
// def shutdownActorSystem(app: AppBuilder): Future[Terminated] = app.app.actorSystem.terminate() | ||
"job service" should { | ||
"handle creation and then finished job" in testApp { app => | ||
val job = Job( | ||
|
@@ -67,7 +66,9 @@ class JobSrvTest extends PlaySpecification with TestAppBuilder { | |
|
||
app[Database].roTransaction { implicit graph => | ||
app[JobSrv].get(updatedJob).observable.has("message", "hello world").exists() must beTrue | ||
app[JobSrv].get(updatedJob).reportObservables.toList.length must equalTo(2) | ||
app[JobSrv].get(updatedJob).reportObservables.toList.length must equalTo(2).updateMessage { s => | ||
s"$s\nreport observables are : ${app[JobSrv].get(updatedJob).reportObservables.richObservable.toList.mkString("\n")}" | ||
} | ||
|
||
for { | ||
audit <- app[AuditSrv].initSteps.has("objectId", updatedJob._id).getOrFail() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.