use of de.fraunhofer.iosb.ilt.faaast.service.model.asset.AssetIdentification in project FAAAST-Service by FraunhoferIOSB.
the class RequestHandlerManagerTest method testGetAllAssetAdministrationShellsByIdShortRequest.
@Test
public void testGetAllAssetAdministrationShellsByIdShortRequest() {
when(persistence.get(eq("Test"), argThat((List<AssetIdentification> t) -> true), any())).thenReturn(environment.getAssetAdministrationShells());
GetAllAssetAdministrationShellsByIdShortRequest request = new GetAllAssetAdministrationShellsByIdShortRequest.Builder().idShort("Test").build();
GetAllAssetAdministrationShellsByIdShortResponse response = manager.execute(request);
GetAllAssetAdministrationShellsByIdShortResponse expected = new GetAllAssetAdministrationShellsByIdShortResponse.Builder().payload(environment.getAssetAdministrationShells()).statusCode(StatusCode.Success).build();
Assert.assertEquals(expected, response);
}
use of de.fraunhofer.iosb.ilt.faaast.service.model.asset.AssetIdentification in project FAAAST-Service by FraunhoferIOSB.
the class PersistenceInMemoryTest method getShellsAllTest.
@Test
public void getShellsAllTest() {
List<AssetAdministrationShell> actualAASList = persistence.get("", (List<AssetIdentification>) null, new QueryModifier());
List<AssetAdministrationShell> expectedAASList = environment.getAssetAdministrationShells();
Assert.assertEquals(expectedAASList, actualAASList);
}
use of de.fraunhofer.iosb.ilt.faaast.service.model.asset.AssetIdentification in project FAAAST-Service by FraunhoferIOSB.
the class PersistenceInMemoryTest method getShellsWithIdShortTest.
@Test
public void getShellsWithIdShortTest() {
String AAS_IDSHORT = "Test_AssetAdministrationShell_Mandatory";
List<AssetAdministrationShell> actualAASList = persistence.get(AAS_IDSHORT, (List<AssetIdentification>) null, new QueryModifier());
List<AssetAdministrationShell> expectedAASList = environment.getAssetAdministrationShells().stream().filter(x -> x.getIdShort().equalsIgnoreCase(AAS_IDSHORT)).collect(Collectors.toList());
Assert.assertEquals(expectedAASList, actualAASList);
}
Aggregations