@Test @DisplayName("Asset Relationships by type") void testGetAssetRelationships() throws PropertyServerException, InvalidParameterException { RelationshipListResponse expectedResponse = mockRelationshipResponse(); when(assetCatalog.getAssetRelationships(anyString(), anyString(), anyString(), anyString(), anyInt(), anyInt())).thenReturn(expectedResponse); List<Relationship> resultList = assetCatalogOMASService.getAssetRelationships(user, assetId, typeDef, relationshipTypeDef, 0, 1); verifyRelationshipResponse(resultList); }
public List<Relationship> getAssetRelationships(String user, String assetId, String assetType, String relationshipTypeGUID, Integer from, Integer pageSize) throws PropertyServerException, org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException { try { return assetCatalog.getAssetRelationships(user, assetId, assetType, relationshipTypeGUID, from, pageSize).getRelationships(); } catch (PropertyServerException | org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException e) { LOG.error(String.format("Error retrieving asset relationships for %s", assetId)); throw e; } }
AssetCatalogOMASService { public List<Relationship> getAssetRelationships(String user, String assetId, String assetType, String relationshipTypeGUID, Integer from, Integer pageSize) throws PropertyServerException, org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException { try { return assetCatalog.getAssetRelationships(user, assetId, assetType, relationshipTypeGUID, from, pageSize).getRelationships(); } catch (PropertyServerException | org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException e) { LOG.error(String.format("Error retrieving asset relationships for %s", assetId)); throw e; } } }
AssetCatalogOMASService { public List<Relationship> getAssetRelationships(String user, String assetId, String assetType, String relationshipTypeGUID, Integer from, Integer pageSize) throws PropertyServerException, org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException { try { return assetCatalog.getAssetRelationships(user, assetId, assetType, relationshipTypeGUID, from, pageSize).getRelationships(); } catch (PropertyServerException | org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException e) { LOG.error(String.format("Error retrieving asset relationships for %s", assetId)); throw e; } } @Autowired  AssetCatalogOMASService(AssetCatalog assetCatalog); }
AssetCatalogOMASService { public List<Relationship> getAssetRelationships(String user, String assetId, String assetType, String relationshipTypeGUID, Integer from, Integer pageSize) throws PropertyServerException, org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException { try { return assetCatalog.getAssetRelationships(user, assetId, assetType, relationshipTypeGUID, from, pageSize).getRelationships(); } catch (PropertyServerException | org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException e) { LOG.error(String.format("Error retrieving asset relationships for %s", assetId)); throw e; } } @Autowired  AssetCatalogOMASService(AssetCatalog assetCatalog); AssetDescription getAssetDetails(String user,
                                            String assetId,
                                            String assetType); AssetDescription getAssetUniverse(String user,
                                             String assetId,
                                             String assetType); List<Relationship> getAssetRelationships(String user, String assetId,
                                                    String assetType,
                                                    String relationshipTypeGUID,
                                                    Integer from,
                                                    Integer pageSize); List<Classification> getClassificationsForAsset(String user,
                                                           String assetId,
                                                           String assetType,
                                                           String classificationName); List<AssetElements> searchAssets(String user,
                                            String searchCriteria,
                                            SearchParameters searchParameters); AssetElements getAssetContext(String userId,
                                         String assetId,
                                         String assetType); List<Type> getSupportedTypes(String userId); }
AssetCatalogOMASService { public List<Relationship> getAssetRelationships(String user, String assetId, String assetType, String relationshipTypeGUID, Integer from, Integer pageSize) throws PropertyServerException, org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException { try { return assetCatalog.getAssetRelationships(user, assetId, assetType, relationshipTypeGUID, from, pageSize).getRelationships(); } catch (PropertyServerException | org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException e) { LOG.error(String.format("Error retrieving asset relationships for %s", assetId)); throw e; } } @Autowired  AssetCatalogOMASService(AssetCatalog assetCatalog); AssetDescription getAssetDetails(String user,
                                            String assetId,
                                            String assetType); AssetDescription getAssetUniverse(String user,
                                             String assetId,
                                             String assetType); List<Relationship> getAssetRelationships(String user, String assetId,
                                                    String assetType,
                                                    String relationshipTypeGUID,
                                                    Integer from,
                                                    Integer pageSize); List<Classification> getClassificationsForAsset(String user,
                                                           String assetId,
                                                           String assetType,
                                                           String classificationName); List<AssetElements> searchAssets(String user,
                                            String searchCriteria,
                                            SearchParameters searchParameters); AssetElements getAssetContext(String userId,
                                         String assetId,
                                         String assetType); List<Type> getSupportedTypes(String userId);  }