Search in sources :

Example 81 with Entity

use of org.finos.legend.sdlc.domain.model.entity.Entity in project legend-sdlc by finos.

the class TestModelBuilder method buildEntitiesForTest.

public List<Entity> buildEntitiesForTest(String upstreamProjectId, String upstreamWorkspaceId, WorkspaceType type, String upstreamRevisionId, String downstreamProjectId, String downstreamVersionId) {
    DepotProjectId upstreamDepotProjectId = getDepotProjectId(upstreamProjectId);
    DepotProjectId downstreamDepotProjectId = DepotProjectId.parseProjectId(downstreamProjectId);
    Set<ProjectDependency> latestUpstreamLevel1Dependencies = this.dependenciesApi.getWorkspaceRevisionUpstreamProjects(upstreamProjectId, upstreamWorkspaceId, type, upstreamRevisionId, false);
    Set<DepotProjectVersion> dependencies = processDependencies(upstreamDepotProjectId, downstreamDepotProjectId, downstreamVersionId, transformProjectDependencySet(latestUpstreamLevel1Dependencies));
    List<Entity> upstreamProjectWorkspaceEntities = this.entityApi.getWorkspaceRevisionEntityAccessContext(upstreamProjectId, upstreamWorkspaceId, type, upstreamRevisionId).getEntities(null, null, null);
    return getEntities(downstreamDepotProjectId, downstreamVersionId, dependencies, upstreamProjectWorkspaceEntities);
}
Also used : DepotProjectId(org.finos.legend.sdlc.server.depot.model.DepotProjectId) DepotProjectVersion(org.finos.legend.sdlc.server.depot.model.DepotProjectVersion) Entity(org.finos.legend.sdlc.domain.model.entity.Entity) ProjectDependency(org.finos.legend.sdlc.domain.model.project.configuration.ProjectDependency)

Aggregations

Entity (org.finos.legend.sdlc.domain.model.entity.Entity)81 Test (org.junit.Test)41 File (java.io.File)17 List (java.util.List)17 Path (java.nio.file.Path)15 Collections (java.util.Collections)15 MavenProject (org.apache.maven.project.MavenProject)15 Revision (org.finos.legend.sdlc.domain.model.revision.Revision)15 IOException (java.io.IOException)14 Map (java.util.Map)13 Assert (org.junit.Assert)12 Iterate (org.eclipse.collections.impl.utility.Iterate)11 Sets (org.eclipse.collections.api.factory.Sets)10 ProjectType (org.finos.legend.sdlc.domain.model.project.ProjectType)10 ProjectConfiguration (org.finos.legend.sdlc.domain.model.project.configuration.ProjectConfiguration)10 EntityLoader (org.finos.legend.sdlc.serialization.EntityLoader)10 Files (java.nio.file.Files)9 Class (org.finos.legend.engine.protocol.pure.v1.model.packageableElement.domain.Class)9 Workspace (org.finos.legend.sdlc.domain.model.project.workspace.Workspace)9 Paths (java.nio.file.Paths)8