Skip to content

Commit

Permalink
Merge branch 'main' into LANTERN-629-HumanaWebscraper
Browse files Browse the repository at this point in the history
  • Loading branch information
vishnu-mettles authored Sep 10, 2024
2 parents a8f043b + dea9e38 commit 0fa2b5a
Show file tree
Hide file tree
Showing 56 changed files with 419 additions and 351 deletions.
4 changes: 2 additions & 2 deletions capabilityquerier/cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"context"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"os"
"strings"
"time"

Expand Down Expand Up @@ -187,7 +187,7 @@ func main() {
log.Info("Successfully connected to DB!")

// Read version file that is mounted
version, err := ioutil.ReadFile("/etc/lantern/VERSION")
version, err := os.ReadFile("/etc/lantern/VERSION")
helpers.FailOnError("", err)
versionString := string(version)
versionNum := strings.Split(versionString, "=")
Expand Down
4 changes: 2 additions & 2 deletions capabilityquerier/pkg/capabilityquerier/capabilityquerier.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"database/sql"
"encoding/json"
"fmt"
"io/ioutil"
"io"
"net/http"
"net/http/httptrace"
"net/url"
Expand Down Expand Up @@ -422,7 +422,7 @@ func requestWithMimeType(req *http.Request, mimeType string, client *http.Client
defer resp.Body.Close()
mimeMatches = true

capStat, err = ioutil.ReadAll(resp.Body)
capStat, err = io.ReadAll(resp.Body)
if err != nil {
return -1, "", false, nil, -1, errors.Wrapf(err, "reading the response from %s failed", req.URL.String())
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"context"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"net/url"
"os"
Expand Down Expand Up @@ -290,7 +289,7 @@ func setup() error {

func capabilityStatementOriginalBytes() ([]byte, error) {
path := filepath.Join("testdata", "metadata.json")
expectedCapStat, err := ioutil.ReadFile(path)
expectedCapStat, err := os.ReadFile(path)
if err != nil {
return nil, err
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"crypto/tls"
"encoding/json"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"testing"
"time"
Expand Down Expand Up @@ -356,7 +356,7 @@ func basicTestClient() (*th.TestClient, error) {

func testClientWithContentType(contentType string) (*th.TestClient, error) {
path := filepath.Join("testdata", "metadata.json")
okResponse, err := ioutil.ReadFile(path)
okResponse, err := os.ReadFile(path)
if err != nil {
return nil, err
}
Expand All @@ -378,7 +378,7 @@ func testClientWithContentType(contentType string) (*th.TestClient, error) {

func testClientOnlyAcceptGivenType(contentType string) (*th.TestClient, error) {
path := filepath.Join("testdata", "metadata.json")
okResponse, err := ioutil.ReadFile(path)
okResponse, err := os.ReadFile(path)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -414,7 +414,7 @@ func testClientWithTLSVersion(tlsVersion uint16) (*th.TestClient, error) {
func testClientWithNoTLS() (*th.TestClient, error) {

path := filepath.Join("testdata", "metadata.json")
okResponse, err := ioutil.ReadFile(path)
okResponse, err := os.ReadFile(path)
if err != nil {
return nil, err
}
Expand All @@ -430,7 +430,7 @@ func testClientWithNoTLS() (*th.TestClient, error) {

func capabilityStatement() ([]byte, error) {
path := filepath.Join("testdata", "metadata.json")
expectedCapStat, err := ioutil.ReadFile(path)
expectedCapStat, err := os.ReadFile(path)
if err != nil {
return nil, err
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build integration
// +build integration

package main
Expand All @@ -6,7 +7,6 @@ import (
"context"
"encoding/json"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"testing"
Expand Down Expand Up @@ -170,14 +170,14 @@ func Test_updateOperationResource(t *testing.T) {

func setupCapabilityStatements(t *testing.T, path1 string, path2 string) {
// capability statement
csJSON, err := ioutil.ReadFile(path1)
csJSON, err := os.ReadFile(path1)
th.Assert(t, err == nil, err)
cs, err := capabilityparser.NewCapabilityStatement(csJSON)
th.Assert(t, err == nil, err)
capStat1, err = cs.GetJSON()
th.Assert(t, err == nil, err)

csJSON2, err := ioutil.ReadFile(path2)
csJSON2, err := os.ReadFile(path2)
th.Assert(t, err == nil, err)
cs2, err := capabilityparser.NewCapabilityStatement(csJSON2)
th.Assert(t, err == nil, err)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
//go:build integration
// +build integration

package main

import (
"context"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"testing"
Expand Down Expand Up @@ -338,14 +338,14 @@ func Test_addToValidationTableInfo(t *testing.T) {

func setupCapabilityStatements(t *testing.T, path1 string, path2 string) {
// capability statement
csJSON, err := ioutil.ReadFile(path1)
csJSON, err := os.ReadFile(path1)
th.Assert(t, err == nil, err)
cs, err := capabilityparser.NewCapabilityStatement(csJSON)
th.Assert(t, err == nil, err)
capStat1, err = cs.GetJSON()
th.Assert(t, err == nil, err)

csJSON2, err := ioutil.ReadFile(path2)
csJSON2, err := os.ReadFile(path2)
th.Assert(t, err == nil, err)
cs2, err := capabilityparser.NewCapabilityStatement(csJSON2)
th.Assert(t, err == nil, err)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build integration
// +build integration

package capabilityhandler
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package capabilityhandler
import (
"encoding/json"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"testing"

Expand Down Expand Up @@ -256,7 +256,7 @@ func convertInterfaceToBytes(message map[string]interface{}) ([]byte, error) {

func setupCapabilityStatement(t *testing.T, path string) {
// capability statement
csJSON, err := ioutil.ReadFile(path)
csJSON, err := os.ReadFile(path)
th.Assert(t, err == nil, err)
cs, err := capabilityparser.NewCapabilityStatement(csJSON)
th.Assert(t, err == nil, err)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"reflect"
"testing"
Expand Down Expand Up @@ -940,7 +940,7 @@ func Test_VersionResponseValid(t *testing.T) {
// getDSTU2CapStat gets a DSTU2 Capability Statement
func getDSTU2CapStat() (capabilityparser.CapabilityStatement, error) {
path := filepath.Join("../../../testdata", "test_dstu2_capability_statement.json")
csJSON, err := ioutil.ReadFile(path)
csJSON, err := os.ReadFile(path)
if err != nil {
return nil, err
}
Expand All @@ -954,7 +954,7 @@ func getDSTU2CapStat() (capabilityparser.CapabilityStatement, error) {
// getDSTU2CapStat gets a R4 Capability Statement
func getR4CapStat() (capabilityparser.CapabilityStatement, error) {
path := filepath.Join("../../../testdata", "test_r4_capability_statement.json")
csJSON, err := ioutil.ReadFile(path)
csJSON, err := os.ReadFile(path)
if err != nil {
return nil, err
}
Expand All @@ -967,7 +967,7 @@ func getR4CapStat() (capabilityparser.CapabilityStatement, error) {

func getSmartResponse() (smartparser.SMARTResponse, error) {
path := filepath.Join("../../../testdata", "authorization_cerner_smart_response.json")
srJSON, err := ioutil.ReadFile(path)
srJSON, err := os.ReadFile(path)
if err != nil {
return nil, err
}
Expand Down
6 changes: 3 additions & 3 deletions capabilityreceiver/pkg/chplmapper/capabilityinfo.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"database/sql"
"encoding/json"
"io/ioutil"
"io"
"os"
"strings"

Expand Down Expand Up @@ -211,7 +211,7 @@ func openProductLinksFile(filepath string) (map[string]map[string]string, error)
defer jsonFile.Close()

var softwareNameVersion []map[string]string
byteValueFile, err := ioutil.ReadAll(jsonFile)
byteValueFile, err := io.ReadAll(jsonFile)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -322,7 +322,7 @@ func OpenCHPLEndpointListInfoFile(filepath string) (map[string]ChplMapResults, e

var softwareListMap = make(map[string]ChplMapResults)

byteValueFile, err := ioutil.ReadAll(jsonFile)
byteValueFile, err := io.ReadAll(jsonFile)
if err != nil {
return nil, err
}
Expand Down
Loading

0 comments on commit 0fa2b5a

Please sign in to comment.