Skip to content

Commit

Permalink
Any -> Unit, remove getResource second param, remove leftover incorre…
Browse files Browse the repository at this point in the history
…ct TODO
  • Loading branch information
siers committed Feb 13, 2024
1 parent 3b7075c commit 999a35f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -479,8 +479,7 @@ class ResourcesResponderV2Spec extends CoreSpec with ImplicitSender {
)
)

private def getResource(resourceIri: IRI, requestingUser: User): ReadResourceV2 = {
(requestingUser, requestingUser.id) // TODO: is this fine to remove? (silenced warning for now)
private def getResource(resourceIri: IRI): ReadResourceV2 = {
appActor ! ResourcesGetRequestV2(
resourceIris = Seq(resourceIri),
targetSchema = ApiV2Complex,
Expand Down Expand Up @@ -909,7 +908,7 @@ class ResourcesResponderV2Spec extends CoreSpec with ImplicitSender {

// Get the resource from the triplestore and check it again.

val outputResource = getResource(resourceIri, anythingUserProfile)
val outputResource = getResource(resourceIri)

checkCreateResource(
inputResourceIri = resourceIri,
Expand Down Expand Up @@ -945,7 +944,7 @@ class ResourcesResponderV2Spec extends CoreSpec with ImplicitSender {

// Get the resource from the triplestore and check it.

val outputResource = getResource(resourceIri, anythingUserProfile)
val outputResource = getResource(resourceIri)

checkCreateResource(
inputResourceIri = resourceIri,
Expand Down Expand Up @@ -1104,7 +1103,7 @@ class ResourcesResponderV2Spec extends CoreSpec with ImplicitSender {

// Get the resource from the triplestore and check it.

val outputResource = getResource(resourceIri, anythingUserProfile)
val outputResource = getResource(resourceIri)

checkCreateResource(
inputResourceIri = resourceIri,
Expand Down Expand Up @@ -1141,7 +1140,7 @@ class ResourcesResponderV2Spec extends CoreSpec with ImplicitSender {

// Get the resource from the triplestore and check it.

val outputResource = getResource(resourceIri, anythingUserProfile)
val outputResource = getResource(resourceIri)

checkCreateResource(
inputResourceIri = resourceIri,
Expand Down Expand Up @@ -1175,7 +1174,7 @@ class ResourcesResponderV2Spec extends CoreSpec with ImplicitSender {

// Get the resource from the triplestore and check it.

val outputResource = getResource(resourceIri, anythingUserProfile)
val outputResource = getResource(resourceIri)

checkCreateResource(
inputResourceIri = resourceIri,
Expand Down Expand Up @@ -1212,7 +1211,7 @@ class ResourcesResponderV2Spec extends CoreSpec with ImplicitSender {

// Get the resource from the triplestore and check it.

val outputResource = getResource(resourceIri, anythingUserProfile)
val outputResource = getResource(resourceIri)

checkCreateResource(
inputResourceIri = resourceIri,
Expand Down Expand Up @@ -1748,7 +1747,7 @@ class ResourcesResponderV2Spec extends CoreSpec with ImplicitSender {

// Get the resource from the triplestore and check it.

val outputResource: ReadResourceV2 = getResource(aThingIri, anythingUserProfile)
val outputResource: ReadResourceV2 = getResource(aThingIri)
assert(outputResource.label == newLabel)
assert(
PermissionUtilADM.parsePermissions(outputResource.permissions) == PermissionUtilADM.parsePermissions(
Expand Down Expand Up @@ -1810,7 +1809,7 @@ class ResourcesResponderV2Spec extends CoreSpec with ImplicitSender {

// Get the resource from the triplestore and check it.

val outputResource: ReadResourceV2 = getResource(aThingIri, anythingUserProfile)
val outputResource: ReadResourceV2 = getResource(aThingIri)
assert(outputResource.label == newLabel)
val updatedLastModificationDate = outputResource.lastModificationDate.get
assert(updatedLastModificationDate.isAfter(aThingLastModificationDate))
Expand Down Expand Up @@ -1852,7 +1851,7 @@ class ResourcesResponderV2Spec extends CoreSpec with ImplicitSender {

// Get the resource from the triplestore and check it.

val outputResource: ReadResourceV2 = getResource(aThingIri, anythingUserProfile)
val outputResource: ReadResourceV2 = getResource(aThingIri)
val updatedLastModificationDate = outputResource.lastModificationDate.get
assert(updatedLastModificationDate == newModificationDate)
aThingLastModificationDate = updatedLastModificationDate
Expand Down Expand Up @@ -2145,7 +2144,7 @@ class ResourcesResponderV2Spec extends CoreSpec with ImplicitSender {
)

expectMsgType[ReadResourcesSequenceV2](timeout)
val outputResource: ReadResourceV2 = getResource(resourceIri = resourceIri, requestingUser = anythingUserProfile)
val outputResource: ReadResourceV2 = getResource(resourceIri)
val firstTextValue: ReadTextValueV2 = outputResource.values(propertyIri).head.asInstanceOf[ReadTextValueV2]
firstValueIriToErase.set(firstTextValue.valueIri)

Expand Down Expand Up @@ -2176,7 +2175,7 @@ class ResourcesResponderV2Spec extends CoreSpec with ImplicitSender {
)
secondValueIriToErase.set(updateValueResponse.valueIri)

val updatedResource = getResource(resourceIri = resourceIri, requestingUser = anythingUserProfile)
val updatedResource = getResource(resourceIri)
val secondTextValue: ReadTextValueV2 = updatedResource.values(propertyIri).head.asInstanceOf[ReadTextValueV2]
secondValueIriToErase.set(secondTextValue.valueIri)

Expand Down Expand Up @@ -2248,7 +2247,7 @@ class ResourcesResponderV2Spec extends CoreSpec with ImplicitSender {

expectMsgType[ReadResourcesSequenceV2](timeout)
val outputResource: ReadResourceV2 =
getResource(resourceIri = resourceWithLinkIri, requestingUser = anythingUserProfile)
getResource(resourceWithLinkIri)
val linkValue: ReadLinkValueV2 = outputResource.values(linkValuePropertyIri).head.asInstanceOf[ReadLinkValueV2]

// Try to erase the first resource.
Expand Down Expand Up @@ -2357,7 +2356,7 @@ class ResourcesResponderV2Spec extends CoreSpec with ImplicitSender {

// Get the resource from the triplestore and check it again.

val outputResource = getResource(resourceIri, anythingUserProfile)
val outputResource = getResource(resourceIri)

checkCreateResource(
inputResourceIri = resourceIri,
Expand Down Expand Up @@ -2406,7 +2405,7 @@ class ResourcesResponderV2Spec extends CoreSpec with ImplicitSender {

// Get the resource from the triplestore and check it.

val outputResource = getResource(resourceIri, anythingUserProfile)
val outputResource = getResource(resourceIri)

checkCreateResource(
inputResourceIri = resourceIri,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ class ValuesResponderV2Spec extends CoreSpec with ImplicitSender {
deleteComment: Option[String] = None,
requestingUser: User,
isLinkValue: Boolean = false
): Any = {
): Unit = {
appActor ! ResourcesGetRequestV2(
resourceIris = Seq(resourceIri),
targetSchema = ApiV2Complex,
Expand Down Expand Up @@ -282,6 +282,7 @@ class ValuesResponderV2Spec extends CoreSpec with ImplicitSender {
case Some(comment) => deletionInfo.maybeDeleteComment.get should equal(comment)
case None => ()
}
()
} else {
// The value is a LinkValue, so there should be a DeletedValue having a PreviousValue with the IRI of the value.
if (
Expand Down Expand Up @@ -4325,7 +4326,6 @@ class ValuesResponderV2Spec extends CoreSpec with ImplicitSender {
val deleteDate: Instant = Instant.now
val deleteComment = Some("this value was incorrect")

// TODO comment out
UnsafeZioRun.run(
ValuesResponderV2.deleteValueV2(
DeleteValueV2(
Expand Down

0 comments on commit 999a35f

Please sign in to comment.