Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • S Schema
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 24
    • Issues 24
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 8
    • Merge requests 8
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Open Subsurface Data Universe SoftwareOpen Subsurface Data Universe Software
  • Platform
  • System
  • Schema
  • Issues
  • #68
Closed
Open
Issue created Sep 10, 2021 by Aman Verma@amavermaMaintainer

SchemaResolver class is not testable for resolution of `https://` related refs

Problem:

The SchemaResolver class performs the task of resolving all kinds of references provided in request. The references are provided with $ref keyword. The references could be internal one, pointing to a schema within the system or it could be external reference, like this one '"$ref": "https://geojson.org/schema/FeatureCollection.json"'. These are resolved by making https calls to given URL, like this:

CloseableHttpClient httpClient = HttpClientBuilder.create().build();
            HttpGet getRequest = new HttpGet(url);
            getRequest.addHeader("accept", "application/json");
            HttpResponse response = httpClient.execute(getRequest);

Now, this code works absolutely fine, but it's not testable in unit tests.

Ask:

Move out this logic to a resolve external schemas to a new class, something like ExternalSchemaResolver and use it in has-a relationship with SchemaResolver.

@pbehede assigning this to you. Please reassign accordingly.

Assignee
Assign to
Time tracking