use of de.fraunhofer.iosb.ilt.faaast.service.model.api.response.GetAllConceptDescriptionsResponse in project FAAAST-Service by FraunhoferIOSB.
the class GetAllConceptDescriptionsRequestHandler method process.
@Override
public GetAllConceptDescriptionsResponse process(GetAllConceptDescriptionsRequest request) {
GetAllConceptDescriptionsResponse response = new GetAllConceptDescriptionsResponse();
try {
List<ConceptDescription> conceptDescriptions = persistence.get(null, null, null, request.getOutputModifier());
response.setPayload(conceptDescriptions);
response.setStatusCode(StatusCode.Success);
if (conceptDescriptions != null) {
conceptDescriptions.forEach(x -> publishElementReadEventMessage(AasUtils.toReference(x), x));
}
} catch (Exception ex) {
response.setStatusCode(StatusCode.ServerInternalError);
}
return response;
}
use of de.fraunhofer.iosb.ilt.faaast.service.model.api.response.GetAllConceptDescriptionsResponse in project FAAAST-Service by FraunhoferIOSB.
the class RequestHandlerManagerTest method testGetAllConceptDescriptionsRequest.
@Test
public void testGetAllConceptDescriptionsRequest() throws ResourceNotFoundException {
when(persistence.get(null, null, null, new OutputModifier())).thenReturn(environment.getConceptDescriptions());
GetAllConceptDescriptionsRequest request = new GetAllConceptDescriptionsRequest.Builder().outputModifier(new OutputModifier()).build();
GetAllConceptDescriptionsResponse response = manager.execute(request);
GetAllConceptDescriptionsResponse expected = new GetAllConceptDescriptionsResponse.Builder().payload(environment.getConceptDescriptions()).statusCode(StatusCode.Success).build();
Assert.assertEquals(expected, response);
}
Aggregations