use of io.adminshell.aas.v3.model.ConceptDescription in project FAAAST-Service by FraunhoferIOSB.
the class PersistenceInMemoryTest method getConceptDescriptionsWithDataSpecificationTest.
@Test
public void getConceptDescriptionsWithDataSpecificationTest() {
Reference dataSpecification = new DefaultReference.Builder().key(new DefaultKey.Builder().type(KeyElements.GLOBAL_REFERENCE).idType(KeyType.IRI).value("http://acplt.org/ReferenceElements/DataSpecificationX").build()).build();
List<ConceptDescription> actualConceptDescriptions = this.persistence.get(null, null, dataSpecification, new QueryModifier());
List<ConceptDescription> expectedConceptDescriptions = this.environment.getConceptDescriptions().stream().filter(x -> x.getEmbeddedDataSpecifications() != null && x.getEmbeddedDataSpecifications().stream().anyMatch(y -> y.getDataSpecification() != null && y.getDataSpecification().equals(dataSpecification))).collect(Collectors.toList());
Assert.assertEquals(expectedConceptDescriptions, actualConceptDescriptions);
}
use of io.adminshell.aas.v3.model.ConceptDescription in project FAAAST-Service by FraunhoferIOSB.
the class PersistenceInMemoryTest method getConceptDescriptionsWithCombination.
@Test
public void getConceptDescriptionsWithCombination() {
String conceptDescriptionIdShort = "TestConceptDescription";
Reference isCaseOf = new DefaultReference.Builder().key(new DefaultKey.Builder().type(KeyElements.GLOBAL_REFERENCE).idType(KeyType.IRI).value("http://acplt.org/DataSpecifications/ConceptDescriptions/TestConceptDescription").build()).build();
List<ConceptDescription> actualConceptDescriptions = this.persistence.get(conceptDescriptionIdShort, isCaseOf, null, new QueryModifier());
List<ConceptDescription> expectedConceptDescriptions = this.environment.getConceptDescriptions().stream().filter(x -> x.getIdShort().equalsIgnoreCase(conceptDescriptionIdShort)).collect(Collectors.toList());
Assert.assertEquals(expectedConceptDescriptions, actualConceptDescriptions);
}
use of io.adminshell.aas.v3.model.ConceptDescription in project FAAAST-Service by FraunhoferIOSB.
the class PersistenceInMemoryTest method getIdentifiableConceptDescriptionTest.
@Test
public void getIdentifiableConceptDescriptionTest() throws ResourceNotFoundException {
Identifier id = new DefaultIdentifier.Builder().idType(IdentifierType.IRI).identifier("https://acplt.org/Test_ConceptDescription").build();
ConceptDescription actualConceptDescription = (ConceptDescription) persistence.get(id, new QueryModifier());
ConceptDescription expectedConceptDescription = environment.getConceptDescriptions().stream().filter(x -> x.getIdentification().equals(id)).findFirst().get();
Assert.assertEquals(expectedConceptDescription, actualConceptDescription);
}
use of io.adminshell.aas.v3.model.ConceptDescription in project FAAAST-Service by FraunhoferIOSB.
the class PersistenceInMemoryTest method getConceptDescriptionsAllTest.
@Test
public void getConceptDescriptionsAllTest() {
List<ConceptDescription> conceptDescriptions = this.persistence.get(null, null, (Reference) null, new QueryModifier());
List<ConceptDescription> expectedConceptDescriptions = this.environment.getConceptDescriptions();
Assert.assertEquals(expectedConceptDescriptions, conceptDescriptions);
}
Aggregations