use of de.fraunhofer.iosb.ilt.faaast.service.model.api.Request in project FAAAST-Service by FraunhoferIOSB.
the class RequestMappingManagerTest method testGetAssetInformationRequest.
@Test
public void testGetAssetInformationRequest() throws InvalidRequestException {
Request expected = GetAssetInformationRequest.builder().id(AAS.getIdentification()).build();
Request actual = mappingManager.map(HttpRequest.builder().method(HttpMethod.GET).path("shells/" + EncodingHelper.base64UrlEncode(AAS.getIdentification().getIdentifier()) + "/aas/asset-information").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 testDeleteSubmodelById.
@Test
public void testDeleteSubmodelById() throws InvalidRequestException {
Request expected = DeleteSubmodelByIdRequest.builder().id(SUBMODEL.getIdentification()).build();
Request actual = mappingManager.map(HttpRequest.builder().method(HttpMethod.DELETE).path("submodels/" + EncodingHelper.base64UrlEncode(SUBMODEL.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 testGetAssetAdministrationShellById.
@Test
public void testGetAssetAdministrationShellById() throws InvalidRequestException {
Request expected = GetAssetAdministrationShellByIdRequest.builder().id(AAS.getIdentification()).build();
Request actual = mappingManager.map(HttpRequest.builder().method(HttpMethod.GET).path("shells/" + EncodingHelper.base64UrlEncode(AAS.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 testPutSubmodelElementByPath.
@Test
public void testPutSubmodelElementByPath() throws SerializationException, InvalidRequestException {
Request expected = PutSubmodelElementByPathRequest.builder().id(SUBMODEL.getIdentification()).path(ReferenceHelper.toKeys(SUBMODEL_ELEMENT_REF)).submodelElement(SUBMODEL_ELEMENT).build();
Request actual = mappingManager.map(HttpRequest.builder().method(HttpMethod.PUT).path("submodels/" + EncodingHelper.base64UrlEncode(SUBMODEL.getIdentification().getIdentifier()) + "/submodel/submodel-elements/" + ElementPathHelper.toElementPath(SUBMODEL_ELEMENT_REF)).body(serializer.write(SUBMODEL_ELEMENT)).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 testGetAssetAdministrationShell.
@Test
public void testGetAssetAdministrationShell() throws InvalidRequestException {
Request expected = GetAssetAdministrationShellRequest.builder().id(AAS.getIdentification()).outputModifier(new OutputModifier.Builder().content(Content.Value).build()).build();
Request actual = mappingManager.map(HttpRequest.builder().method(HttpMethod.GET).path("shells/" + EncodingHelper.base64UrlEncode(AAS.getIdentification().getIdentifier()) + "/aas").query("content=value").build());
Assert.assertEquals(expected, actual);
}
Aggregations