Skip to content

Commit

Permalink
test: some general profile attributes with type API
Browse files Browse the repository at this point in the history
  • Loading branch information
Pfeil committed Jan 7, 2025
1 parent e7361f4 commit 18a06ba
Showing 1 changed file with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package edu.kit.datamanager.pit.typeregistry.impl;

import edu.kit.datamanager.pit.configuration.ApplicationProperties;
import edu.kit.datamanager.pit.typeregistry.AttributeInfo;
import edu.kit.datamanager.pit.typeregistry.schema.SchemaInfo;
import edu.kit.datamanager.pit.typeregistry.schema.SchemaSetGenerator;
import org.junit.jupiter.api.Test;
Expand Down Expand Up @@ -30,6 +31,28 @@ class TypeApiTest {
this.dtr = new TypeApi(props, new SchemaSetGenerator(props));
}

@Test
void queryAttributeInfoOfSimpleType() {
String attributePid = "21.T11148/b8457812905b83046284";
AttributeInfo info = dtr.queryAttributeInfo(attributePid).join();
assertEquals(attributePid, info.pid());
assertFalse(info.jsonSchema().isEmpty());
assertEquals(2, info.jsonSchema().size());
assertTrue(info.name().contains("Location"));
assertEquals("PID-InfoType", info.typeName());
}

@Test
void queryAttributeInfoOfComplexType() {
AttributeInfo info = dtr.queryAttributeInfo(PID_COMPLEX_TYPE_CHECKSUM_DTRTEST).join();
assertEquals(PID_COMPLEX_TYPE_CHECKSUM_DTRTEST, info.pid());
assertFalse(info.jsonSchema().isEmpty());
assertTrue(info.name().contains("checksum"));
assertEquals("PID-InfoType", info.typeName());
}

/* ================== TESTING INTERNALS ================== */

@Test
void querySchemaOfComplexType() {
// NOTE The new Type-API currently returns a malformed schema for the
Expand Down

0 comments on commit 18a06ba

Please sign in to comment.