Search in sources :

Example 46 with AssetAdministrationShell

use of io.adminshell.aas.v3.model.AssetAdministrationShell in project FAAAST-Service by FraunhoferIOSB.

the class IntegrationTestHttpEndpoint method testPutAssetInformationEvent.

@Test
public void testPutAssetInformationEvent() {
    AssetAdministrationShell expected = environment.getAssetAdministrationShells().get(1);
    expected.getAssetInformation().setAssetKind(AssetKind.TYPE);
    String url = HTTP_SHELLS + "/" + Base64.getUrlEncoder().encodeToString(expected.getIdentification().getIdentifier().getBytes(StandardCharsets.UTF_8)) + "/aas/asset-information";
    setUpEventCheck(expected, ElementUpdateEventMessage.class, () -> putCall(url, expected.getAssetInformation()));
}
Also used : DefaultAssetAdministrationShell(io.adminshell.aas.v3.model.impl.DefaultAssetAdministrationShell) AssetAdministrationShell(io.adminshell.aas.v3.model.AssetAdministrationShell) LangString(io.adminshell.aas.v3.model.LangString) Test(org.junit.Test)

Example 47 with AssetAdministrationShell

use of io.adminshell.aas.v3.model.AssetAdministrationShell in project FAAAST-Service by FraunhoferIOSB.

the class IntegrationTestHttpEndpoint method call_GET_AASShell_Content.

private void call_GET_AASShell_Content(String content, Object expected, Class<?> expectedClass) throws IOException, DeserializationException {
    AssetAdministrationShell aas = environment.getAssetAdministrationShells().get(1);
    HttpResponse actual = getCall(HTTP_SHELLS + "/" + Base64.getUrlEncoder().encodeToString(aas.getIdentification().getIdentifier().getBytes(StandardCharsets.UTF_8)) + "/aas?content=" + content);
    Assert.assertEquals(expected, retrieveResourceFromResponse(actual, expectedClass));
    Assert.assertEquals(HttpStatus.SC_OK, actual.getStatusLine().getStatusCode());
}
Also used : DefaultAssetAdministrationShell(io.adminshell.aas.v3.model.impl.DefaultAssetAdministrationShell) AssetAdministrationShell(io.adminshell.aas.v3.model.AssetAdministrationShell) HttpResponse(org.apache.http.HttpResponse)

Aggregations

AssetAdministrationShell (io.adminshell.aas.v3.model.AssetAdministrationShell)46 Test (org.junit.Test)29 DefaultAssetAdministrationShell (io.adminshell.aas.v3.model.impl.DefaultAssetAdministrationShell)22 LangString (io.adminshell.aas.v3.model.LangString)14 HttpResponse (org.apache.http.HttpResponse)13 ResourceNotFoundException (de.fraunhofer.iosb.ilt.faaast.service.exception.ResourceNotFoundException)10 QueryModifier (de.fraunhofer.iosb.ilt.faaast.service.model.api.modifier.QueryModifier)10 Reference (io.adminshell.aas.v3.model.Reference)8 DefaultReference (io.adminshell.aas.v3.model.impl.DefaultReference)8 AssetIdentification (de.fraunhofer.iosb.ilt.faaast.service.model.asset.AssetIdentification)7 Submodel (io.adminshell.aas.v3.model.Submodel)7 GlobalAssetIdentification (de.fraunhofer.iosb.ilt.faaast.service.model.asset.GlobalAssetIdentification)6 AssetInformation (io.adminshell.aas.v3.model.AssetInformation)6 SubmodelElement (io.adminshell.aas.v3.model.SubmodelElement)6 DefaultIdentifier (io.adminshell.aas.v3.model.impl.DefaultIdentifier)6 DefaultKey (io.adminshell.aas.v3.model.impl.DefaultKey)6 AASFull (de.fraunhofer.iosb.ilt.faaast.service.model.AASFull)5 OutputModifier (de.fraunhofer.iosb.ilt.faaast.service.model.api.modifier.OutputModifier)5 AssetAdministrationShellEnvironment (io.adminshell.aas.v3.model.AssetAdministrationShellEnvironment)5 IdentifierType (io.adminshell.aas.v3.model.IdentifierType)5