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);
}
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);
}
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);
}
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);
}
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);
}
Aggregations