use of de.fraunhofer.iosb.ilt.faaast.service.model.api.Request in project FAAAST-Service by FraunhoferIOSB.
the class RequestMappingManagerTest method testGetAllAssetAdministrationShellsRequest.
@Test
public void testGetAllAssetAdministrationShellsRequest() throws InvalidRequestException {
Request expected = GetAllAssetAdministrationShellsRequest.builder().outputModifier(OutputModifier.DEFAULT).build();
Request actual = mappingManager.map(HttpRequest.builder().method(HttpMethod.GET).path("shells").build());
Assert.assertEquals(expected, actual);
}
use of de.fraunhofer.iosb.ilt.faaast.service.model.api.Request in project FAAAST-Service by FraunhoferIOSB.
the class RequestMappingManagerTest method testGetOperationAsyncResult.
@Test
public void testGetOperationAsyncResult() throws InvalidRequestException {
final String handleId = UUID.randomUUID().toString();
Request expected = GetOperationAsyncResultRequest.builder().handleId(handleId).path(ReferenceHelper.toKeys(OPERATION_REF)).build();
Request actual = mappingManager.map(HttpRequest.builder().method(HttpMethod.GET).path("submodels/" + EncodingHelper.base64UrlEncode(SUBMODEL.getIdentification().getIdentifier()) + "/submodel/submodel-elements/" + ElementPathHelper.toElementPath(OPERATION_REF) + "/operation-results/" + EncodingHelper.base64UrlEncode(handleId)).build());
Assert.assertEquals(expected, actual);
}
use of de.fraunhofer.iosb.ilt.faaast.service.model.api.Request in project FAAAST-Service by FraunhoferIOSB.
the class RequestMappingManagerTest method testPostConceptDescription.
@Test
public void testPostConceptDescription() throws SerializationException, InvalidRequestException {
Request expected = PostConceptDescriptionRequest.builder().conceptDescription(CONCEPT_DESCRIPTION).build();
Request actual = mappingManager.map(HttpRequest.builder().method(HttpMethod.POST).path("concept-descriptions").body(serializer.write(CONCEPT_DESCRIPTION)).build());
Assert.assertEquals(expected, actual);
}
use of de.fraunhofer.iosb.ilt.faaast.service.model.api.Request in project FAAAST-Service by FraunhoferIOSB.
the class RequestMappingManagerTest method testGetConceptDescriptionById.
@Test
public void testGetConceptDescriptionById() throws InvalidRequestException {
Request expected = GetConceptDescriptionByIdRequest.builder().id(CONCEPT_DESCRIPTION.getIdentification()).build();
Request actual = mappingManager.map(HttpRequest.builder().method(HttpMethod.GET).path("concept-descriptions/" + EncodingHelper.base64UrlEncode(CONCEPT_DESCRIPTION.getIdentification().getIdentifier())).build());
Assert.assertEquals(expected, actual);
}
use of de.fraunhofer.iosb.ilt.faaast.service.model.api.Request in project FAAAST-Service by FraunhoferIOSB.
the class RequestMappingManagerTest method testGetAllConceptDescriptionsByIsCaseOf.
@Test
public void testGetAllConceptDescriptionsByIsCaseOf() throws InvalidRequestException {
Reference isCaseOf = CONCEPT_DESCRIPTION.getIsCaseOfs().get(0);
Request expected = GetAllConceptDescriptionsByIsCaseOfRequest.builder().isCaseOf(isCaseOf).build();
Request actual = mappingManager.map(HttpRequest.builder().method(HttpMethod.GET).path("concept-descriptions").query("isCaseOf=" + EncodingHelper.base64UrlEncode(AasUtils.asString(isCaseOf))).build());
Assert.assertEquals(expected, actual);
}
Aggregations