Skip to content

Commit

Permalink
#1758 Make MISP organisation description optional
Browse files Browse the repository at this point in the history
  • Loading branch information
To-om committed Feb 3, 2021
1 parent e2982b9 commit 0c52ea1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import java.util.UUID

import play.api.libs.json.{Json, Reads}

case class Organisation(id: String, name: String, description: String, uuid: UUID)
case class Organisation(id: String, name: String, description: Option[String], uuid: UUID)

object Organisation {
implicit val reads: Reads[Organisation] = Json.reads[Organisation]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,17 @@
package org.thp.thehive.connector.misp.services

import java.util.{Date, UUID}

import akka.stream.Materializer
import akka.stream.scaladsl.Sink
import org.thp.misp.dto.{Event, Organisation, Tag, User}
import org.thp.scalligraph.AppBuilder
import org.thp.scalligraph.auth.AuthContext
import org.thp.scalligraph.models.{Database, DummyUserSrv}
import org.thp.scalligraph.traversal.TraversalOps._
import org.thp.scalligraph.{AppBuilder, EntityName}
import org.thp.scalligraph.models.DummyUserSrv
import org.thp.thehive.TestAppBuilder
import org.thp.thehive.models.{Alert, Permissions}
import org.thp.thehive.services.AlertOps._
import org.thp.thehive.services.ObservableOps._
import org.thp.thehive.services.OrganisationOps._
import org.thp.thehive.services.{AlertSrv, OrganisationSrv}
import org.thp.thehive.models.Permissions
import play.api.test.PlaySpecification

import java.util.{Date, UUID}
import scala.concurrent.ExecutionContext
import scala.concurrent.duration.DurationInt

class MispImportSrvTest(implicit ec: ExecutionContext) extends PlaySpecification with TestAppBuilder {
sequential
Expand All @@ -37,7 +30,7 @@ class MispImportSrvTest(implicit ec: ExecutionContext) extends PlaySpecification

"get organisation" in testApp { app =>
await(app[TheHiveMispClient].getOrganisation("1")) must beEqualTo(
Organisation("1", "ORGNAME", "Automatically generated admin organisation", UUID.fromString("5d5d066f-cfa4-49da-995c-6d5b68257ab4"))
Organisation("1", "ORGNAME", Some("Automatically generated admin organisation"), UUID.fromString("5d5d066f-cfa4-49da-995c-6d5b68257ab4"))
)
}

Expand Down

0 comments on commit 0c52ea1

Please sign in to comment.