Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into search-spike
Browse files Browse the repository at this point in the history
  • Loading branch information
TomJKing committed Jan 24, 2024
2 parents dc8c8a1 + 4f1f1e9 commit b0dee3e
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ object FileMetadataService {
val ClientSideFileSize = "ClientSideFileSize"
val ClosurePeriod = "ClosurePeriod"
val ClosureStartDate = "ClosureStartDate"
val FileUUID = "UUID"
val Filename = "Filename"
val FileType = "FileType"
val FileReference = "FileReference"
Expand All @@ -144,7 +145,6 @@ object FileMetadataService {
val ClosureType = "ClosureType"
val Description = "description"
val DescriptionAlternate = "DescriptionAlternate"

val RightsCopyright = "RightsCopyright"
val LegalStatus = "LegalStatus"
val HeldBy = "HeldBy"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ class FileService(
)

val commonMetadataRows = List(
row(fileId, fileId.toString, FileUUID),
row(fileId, path, ClientSideOriginalFilepath),
row(fileId, treeNode.treeNodeType, FileType),
row(fileId, treeNode.name, Filename),
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/application.conf
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ featureAccessBlock {
}

referenceGenerator {
referenceGeneratorUrl = "http://localhost:8080"
referenceGeneratorUrl = "http://localhost:8008"
referenceLimit = 2
}

Expand Down
4 changes: 4 additions & 0 deletions src/test/resources/json/getconsignment_data_all.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
"parentReference": null,
"originalFilePath": null,
"fileMetadata": [
{
"name": "UUID",
"value": "42910a85-85c3-40c3-888f-32f697bfadb6"
},
{
"name": "SHA256ServerSideChecksum",
"value": "Result of FileMetadata processing"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class FileRouteSpec extends TestContainerUtils with Matchers with TestRequest {
val res = runTestMutationFileMetadata("mutation_alldata_2", validUserToken())
val distinctDirectoryCount = 3
val fileCount = 5
val expectedCount = ((Filename :: FileType :: FileReference :: ParentReference :: defaultMetadataProperties).size * distinctDirectoryCount) +
val expectedCount = ((FileUUID :: Filename :: FileType :: FileReference :: ParentReference :: defaultMetadataProperties).size * distinctDirectoryCount) +
(defaultMetadataProperties.size * fileCount) +
(clientSideProperties.size * fileCount) +
(serverSideProperties.size * fileCount) +
Expand Down Expand Up @@ -216,8 +216,8 @@ class FileRouteSpec extends TestContainerUtils with Matchers with TestRequest {
}

private def getReferencesMockServer(additionalRefs: Int = 0): WireMockServer = {
val wiremockServer = new WireMockServer(8080)
WireMock.configureFor("localhost", 8080)
val wiremockServer = new WireMockServer(8008)
WireMock.configureFor("localhost", 8008)
wiremockServer.start()
wiremockServer.stubFor(
WireMock
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,7 @@ class FileMetadataServiceSpec extends AnyFlatSpec with MockitoSugar with Matcher
FileMetadataService.HeldBy shouldEqual "HeldBy"
FileMetadataService.Language shouldEqual "Language"
FileMetadataService.FoiExemptionCode shouldEqual "FoiExemptionCode"
FileMetadataService.FileUUID shouldEqual "UUID"
}

private def generateFileStatusRows(fileIds: Seq[UUID]) = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,7 @@ class FileServiceSpec extends AnyFlatSpec with MockitoSugar with Matchers with S
row.consignmentid should equal(consignmentId)
row.userid should equal(userId)
})
val expectedSize = 56
val expectedSize = 61
metadataRows.size should equal(expectedSize)
defaultMetadataProperties.foreach(prop => {
metadataRows.count(_.propertyname == prop) should equal(5)
Expand Down Expand Up @@ -821,7 +821,7 @@ class FileServiceSpec extends AnyFlatSpec with MockitoSugar with Matchers with S
})
val file = fileRows.find(_.filereference.contains("ref4"))
file.get.parentreference should equal(Some("ref2"))
val expectedSize = 56
val expectedSize = 61
metadataRows.size should equal(expectedSize)
defaultMetadataProperties.foreach(prop => {
metadataRows.count(_.propertyname == prop) should equal(5)
Expand Down Expand Up @@ -906,7 +906,7 @@ class FileServiceSpec extends AnyFlatSpec with MockitoSugar with Matchers with S
row.consignmentid should equal(consignmentId)
row.userid should equal(userId)
})
val expectedSize = 36
val expectedSize = 39
metadataRows.size should equal(expectedSize)
defaultMetadataProperties.foreach(prop => {
metadataRows.count(_.propertyname == prop) should equal(3)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ object TestUtils {
case class Locations(column: Int, line: Int)

val defaultFileId: UUID = UUID.fromString("07a3a4bd-0281-4a6d-a4c1-8fa3239e1313")
val serverSideProperties: List[String] = List(FileReference, ParentReference)
val serverSideProperties: List[String] = List(FileUUID, FileReference, ParentReference)
val defaultMetadataProperties: List[String] = List(RightsCopyright, LegalStatus, HeldBy, Language, FoiExemptionCode)
val defaultCopyright: String = "Crown Copyright"
val defaultLegalStatus: String = "Public Record"
Expand Down

0 comments on commit b0dee3e

Please sign in to comment.