Search in sources :

Example 1 with OutputModifier

use of de.fraunhofer.iosb.ilt.faaast.service.model.api.modifier.OutputModifier in project FAAAST-Service by FraunhoferIOSB.

the class RequestHandlerManagerTest method testGetAllSubmodelsRequest.

@Test
public void testGetAllSubmodelsRequest() throws ResourceNotFoundException {
    when(persistence.get(null, (Reference) null, new OutputModifier())).thenReturn(environment.getSubmodels());
    GetAllSubmodelsRequest request = new GetAllSubmodelsRequest.Builder().outputModifier(new OutputModifier()).build();
    GetAllSubmodelsResponse response = manager.execute(request);
    GetAllSubmodelsResponse expected = new GetAllSubmodelsResponse.Builder().payload(environment.getSubmodels()).statusCode(StatusCode.Success).build();
    Assert.assertEquals(expected, response);
}
Also used : GetAllSubmodelsRequest(de.fraunhofer.iosb.ilt.faaast.service.model.request.GetAllSubmodelsRequest) OutputModifier(de.fraunhofer.iosb.ilt.faaast.service.model.api.modifier.OutputModifier) GetAllSubmodelsResponse(de.fraunhofer.iosb.ilt.faaast.service.model.api.response.GetAllSubmodelsResponse) Test(org.junit.Test)

Example 2 with OutputModifier

use of de.fraunhofer.iosb.ilt.faaast.service.model.api.modifier.OutputModifier in project FAAAST-Service by FraunhoferIOSB.

the class RequestHandlerManagerTest method testGetAllConceptDescriptionsByDataSpecificationReferenceRequest.

@Test
public void testGetAllConceptDescriptionsByDataSpecificationReferenceRequest() throws ResourceNotFoundException {
    Reference reference = ReferenceHelper.toReference(environment.getConceptDescriptions().get(0).getIdentification(), ConceptDescription.class);
    when(persistence.get(null, null, reference, new OutputModifier())).thenReturn(environment.getConceptDescriptions());
    GetAllConceptDescriptionsByDataSpecificationReferenceRequest request = new GetAllConceptDescriptionsByDataSpecificationReferenceRequest.Builder().outputModifier(new OutputModifier()).dataSpecification(reference).build();
    GetAllConceptDescriptionsByDataSpecificationReferenceResponse response = manager.execute(request);
    GetAllConceptDescriptionsByDataSpecificationReferenceResponse expected = new GetAllConceptDescriptionsByDataSpecificationReferenceResponse.Builder().payload(environment.getConceptDescriptions()).statusCode(StatusCode.Success).build();
    Assert.assertEquals(expected, response);
}
Also used : GetAllConceptDescriptionsByDataSpecificationReferenceResponse(de.fraunhofer.iosb.ilt.faaast.service.model.api.response.GetAllConceptDescriptionsByDataSpecificationReferenceResponse) OutputModifier(de.fraunhofer.iosb.ilt.faaast.service.model.api.modifier.OutputModifier) Reference(io.adminshell.aas.v3.model.Reference) DefaultReference(io.adminshell.aas.v3.model.impl.DefaultReference) AtomicReference(java.util.concurrent.atomic.AtomicReference) GetAllConceptDescriptionsByDataSpecificationReferenceRequest(de.fraunhofer.iosb.ilt.faaast.service.model.request.GetAllConceptDescriptionsByDataSpecificationReferenceRequest) Test(org.junit.Test)

Example 3 with OutputModifier

use of de.fraunhofer.iosb.ilt.faaast.service.model.api.modifier.OutputModifier in project FAAAST-Service by FraunhoferIOSB.

the class RequestHandlerManagerTest method testGetAllSubmodelsBySemanticIdRequest.

@Test
public void testGetAllSubmodelsBySemanticIdRequest() throws ResourceNotFoundException {
    when(persistence.get(null, SUBMODEL_ELEMENT_REF, new OutputModifier())).thenReturn(environment.getSubmodels());
    GetAllSubmodelsBySemanticIdRequest request = new GetAllSubmodelsBySemanticIdRequest.Builder().semanticId(SUBMODEL_ELEMENT_REF).outputModifier(new OutputModifier()).build();
    GetAllSubmodelsBySemanticIdResponse response = manager.execute(request);
    GetAllSubmodelsBySemanticIdResponse expected = new GetAllSubmodelsBySemanticIdResponse.Builder().payload(environment.getSubmodels()).statusCode(StatusCode.Success).build();
    Assert.assertEquals(expected, response);
}
Also used : GetAllSubmodelsBySemanticIdResponse(de.fraunhofer.iosb.ilt.faaast.service.model.api.response.GetAllSubmodelsBySemanticIdResponse) OutputModifier(de.fraunhofer.iosb.ilt.faaast.service.model.api.modifier.OutputModifier) GetAllSubmodelsBySemanticIdRequest(de.fraunhofer.iosb.ilt.faaast.service.model.request.GetAllSubmodelsBySemanticIdRequest) Test(org.junit.Test)

Example 4 with OutputModifier

use of de.fraunhofer.iosb.ilt.faaast.service.model.api.modifier.OutputModifier in project FAAAST-Service by FraunhoferIOSB.

the class RequestHandlerManagerTest method testGetConceptDescriptionByIdRequest.

@Test
public void testGetConceptDescriptionByIdRequest() throws ResourceNotFoundException {
    when(persistence.get(environment.getConceptDescriptions().get(0).getIdentification(), new OutputModifier())).thenReturn(environment.getConceptDescriptions().get(0));
    GetConceptDescriptionByIdRequest request = new GetConceptDescriptionByIdRequest.Builder().outputModifier(new OutputModifier()).id(environment.getConceptDescriptions().get(0).getIdentification()).build();
    GetConceptDescriptionByIdResponse response = manager.execute(request);
    GetConceptDescriptionByIdResponse expected = new GetConceptDescriptionByIdResponse.Builder().payload(environment.getConceptDescriptions().get(0)).statusCode(StatusCode.Success).build();
    Assert.assertEquals(expected, response);
}
Also used : GetConceptDescriptionByIdRequest(de.fraunhofer.iosb.ilt.faaast.service.model.request.GetConceptDescriptionByIdRequest) OutputModifier(de.fraunhofer.iosb.ilt.faaast.service.model.api.modifier.OutputModifier) GetConceptDescriptionByIdResponse(de.fraunhofer.iosb.ilt.faaast.service.model.api.response.GetConceptDescriptionByIdResponse) Test(org.junit.Test)

Example 5 with OutputModifier

use of de.fraunhofer.iosb.ilt.faaast.service.model.api.modifier.OutputModifier in project FAAAST-Service by FraunhoferIOSB.

the class RequestHandlerManagerTest method testGetAllSubmodelsByIdShortRequest.

@Test
public void testGetAllSubmodelsByIdShortRequest() throws ResourceNotFoundException {
    when(persistence.get("Test", (Reference) null, new OutputModifier())).thenReturn(environment.getSubmodels());
    GetAllSubmodelsByIdShortRequest request = new GetAllSubmodelsByIdShortRequest.Builder().idShort("Test").outputModifier(new OutputModifier()).build();
    GetAllSubmodelsByIdShortResponse response = manager.execute(request);
    GetAllSubmodelsByIdShortResponse expected = new GetAllSubmodelsByIdShortResponse.Builder().payload(environment.getSubmodels()).statusCode(StatusCode.Success).build();
    Assert.assertEquals(expected, response);
}
Also used : OutputModifier(de.fraunhofer.iosb.ilt.faaast.service.model.api.modifier.OutputModifier) GetAllSubmodelsByIdShortRequest(de.fraunhofer.iosb.ilt.faaast.service.model.request.GetAllSubmodelsByIdShortRequest) GetAllSubmodelsByIdShortResponse(de.fraunhofer.iosb.ilt.faaast.service.model.api.response.GetAllSubmodelsByIdShortResponse) Test(org.junit.Test)

Aggregations

OutputModifier (de.fraunhofer.iosb.ilt.faaast.service.model.api.modifier.OutputModifier)24 Test (org.junit.Test)18 Reference (io.adminshell.aas.v3.model.Reference)8 DefaultReference (io.adminshell.aas.v3.model.impl.DefaultReference)6 ResourceNotFoundException (de.fraunhofer.iosb.ilt.faaast.service.exception.ResourceNotFoundException)5 AtomicReference (java.util.concurrent.atomic.AtomicReference)4 SubmodelElement (io.adminshell.aas.v3.model.SubmodelElement)3 QueryModifier (de.fraunhofer.iosb.ilt.faaast.service.model.api.modifier.QueryModifier)2 AssetAdministrationShell (io.adminshell.aas.v3.model.AssetAdministrationShell)2 Operation (io.adminshell.aas.v3.model.Operation)2 AssetConnectionException (de.fraunhofer.iosb.ilt.faaast.service.assetconnection.AssetConnectionException)1 SerializationException (de.fraunhofer.iosb.ilt.faaast.service.dataformat.SerializationException)1 OperationHandle (de.fraunhofer.iosb.ilt.faaast.service.model.api.operation.OperationHandle)1 OperationResult (de.fraunhofer.iosb.ilt.faaast.service.model.api.operation.OperationResult)1 GetAllConceptDescriptionsByDataSpecificationReferenceResponse (de.fraunhofer.iosb.ilt.faaast.service.model.api.response.GetAllConceptDescriptionsByDataSpecificationReferenceResponse)1 GetAllConceptDescriptionsByIdShortResponse (de.fraunhofer.iosb.ilt.faaast.service.model.api.response.GetAllConceptDescriptionsByIdShortResponse)1 GetAllConceptDescriptionsByIsCaseOfResponse (de.fraunhofer.iosb.ilt.faaast.service.model.api.response.GetAllConceptDescriptionsByIsCaseOfResponse)1 GetAllConceptDescriptionsResponse (de.fraunhofer.iosb.ilt.faaast.service.model.api.response.GetAllConceptDescriptionsResponse)1 GetAllSubmodelElementsResponse (de.fraunhofer.iosb.ilt.faaast.service.model.api.response.GetAllSubmodelElementsResponse)1 GetAllSubmodelReferencesResponse (de.fraunhofer.iosb.ilt.faaast.service.model.api.response.GetAllSubmodelReferencesResponse)1