Skip to content

Commit

Permalink
chore: cleanup test and fix linter
Browse files Browse the repository at this point in the history
  • Loading branch information
yshyn-iohk committed Mar 9, 2023
1 parent 959b38a commit 88f6e9c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,3 @@ data class CredentialSchema(
var kind: String? = null,
var self: String? = null,
)

//TODO: this can be removed
data class JsonSchema(
var `$id`: String? = null,
var `$schema`: String? = null,
var description: String? = null,
var type: String? = null,
var properties: Map<String, LinkedHashMap<String, String>>? = null,
)
17 changes: 2 additions & 15 deletions tests/e2e-tests/src/test/kotlin/common/CredentialSchemas.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package common

import api_models.CredentialSchema
import api_models.JsonSchema
import com.fasterxml.jackson.databind.ObjectMapper
import java.util.*

Expand All @@ -26,25 +25,13 @@ object CredentialSchemas {
}
}""".trimIndent()

//TODO: this can be removed
val JSON_SCHEMA_V2 = JsonSchema(
`$id` = "student-schema-1.0",
`$schema` = SCHEMA_TYPE,
description = "Student schema",
type = "object",
properties = mapOf(
"name" to linkedMapOf("type" to "string"),
"age" to linkedMapOf("type" to "integer"),
)
)

fun generate_with_name_suffix(suffix: String): CredentialSchema {
return CredentialSchema(
author = "University",
name = "${UUID.randomUUID()} $suffix",
description = "Simple student credentials schema",
type = CREDENTIAL_SCHEMA_TYPE,
schema = ObjectMapper().readTree(JSON_SCHEMA),
schema = ObjectMapper().readTree(JSON_SCHEMA),
tags = listOf("school", "students"),
version = "1.0",
)
Expand All @@ -55,7 +42,7 @@ object CredentialSchemas {
name = UUID.randomUUID().toString(),
description = "Simple student credentials schema",
type = CREDENTIAL_SCHEMA_TYPE,
schema = ObjectMapper().readTree(JSON_SCHEMA),
schema = ObjectMapper().readTree(JSON_SCHEMA),
tags = listOf("school", "students"),
version = "1.0",
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
@schemas
Feature: Credential schemas

@credentialschema
Scenario: Successful schema creation
When Acme creates a new credential schema
Then He sees new credential schema is available
Scenario: Successful schema creation
When Acme creates a new credential schema
Then He sees new credential schema is available

@credentialschema
Scenario Outline: Multiple schema creation
When Acme creates <schemas> new schemas
Then He can access all of them one by one
Examples:
| schemas |
| 4 |
Scenario Outline: Multiple schema creation
When Acme creates <schemas> new schemas
Then He can access all of them one by one
Examples:
| schemas |
| 4 |

#Scenario Outline: Wrong specified fields for schema generation requests should fail
# When Acme tries to create a new schema with <value> in field <field>
Expand Down

0 comments on commit 88f6e9c

Please sign in to comment.