-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
34 changed files
with
93 additions
and
125 deletions.
There are no files selected for viewing
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
49 changes: 0 additions & 49 deletions
49
dsp-schema/core/src/test/scala/dsp/schema/domain/SchemaCommandsSpec.scala
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
54 changes: 54 additions & 0 deletions
54
webapi/src/test/scala/dsp/valueobjects/SchemaCommandsSpec.scala
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 |
---|---|---|
@@ -0,0 +1,54 @@ | ||
package dsp.valueobjects | ||
|
||
import zio.test.Assertion._ | ||
import zio.test._ | ||
|
||
import java.time.Instant | ||
import scala.collection.immutable.List | ||
|
||
import dsp.constants.SalsahGui | ||
import dsp.valueobjects.LangString | ||
import dsp.valueobjects.LanguageCode | ||
import dsp.valueobjects.Schema | ||
import org.knora.webapi.messages.StringFormatter | ||
import org.knora.webapi.slice.resourceinfo.domain.IriConverter | ||
|
||
/** | ||
* This spec is used to test [[dsp.valueobjects.CreatePropertyCommand]]. | ||
*/ | ||
object SchemaCommandsSpec extends ZIOSpecDefault { | ||
|
||
def spec = (createPropertyCommandTest).provide(IriConverter.layer, StringFormatter.test) | ||
|
||
private val createPropertyCommandTest = suite("CreatePropertyCommand")( | ||
test("create a createPropertyCommand") { | ||
val lastModificationDate = Instant.now() | ||
val subjectType = None | ||
(for { | ||
ontologyIri <- IriConverter.asSmartIri("http://www.knora.org/ontology/0001/anything") | ||
propertyIri <- IriConverter.asSmartIri("http://www.knora.org/ontology/0001/anything#someProperty") | ||
objectType <- IriConverter.asSmartIri("http://www.knora.org/ontology/0001/anything#SomeClass") | ||
superProperties <- | ||
IriConverter.asSmartIri("http://www.knora.org/ontology/0001/anything#someSuperCoolProperty").map(List(_)) | ||
label <- LangString.make(LanguageCode.en, "some label").toZIO | ||
commentLangString <- LangString.make(LanguageCode.en, "some comment").toZIO | ||
comment = Some(commentLangString) | ||
guiAttribute <- Schema.GuiAttribute.make("hlist=<http://rdfh.ch/lists/082F/PbRLUy66TsK10qNP1mBwzA>").toZIO | ||
guiElement <- Schema.GuiElement.make(SalsahGui.List).toZIO | ||
guiObject <- Schema.GuiObject.make(Set(guiAttribute), Some(guiElement)).toZIO | ||
command = | ||
CreatePropertyCommand.make( | ||
ontologyIri = ontologyIri, | ||
lastModificationDate = lastModificationDate, | ||
propertyIri = propertyIri, | ||
subjectType = subjectType, | ||
objectType = objectType, | ||
label = label, | ||
comment = comment, | ||
superProperties = superProperties, | ||
guiObject = guiObject | ||
) | ||
} yield assert(command.toEither)(isRight)) | ||
} | ||
) | ||
} |
File renamed without changes.
File renamed without changes.