lnogueir commented on code in PR #21840:
URL: https://github.com/apache/beam/pull/21840#discussion_r897345897


##########
sdks/go/pkg/beam/io/fhirio/execute_bundles.go:
##########
@@ -0,0 +1,146 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements.  See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License.  You may obtain a copy of the License at
+//
+//    http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Package fhirio provides an API for reading and writing resources to Google
+// Cloud Healthcare Fhir stores.
+// Experimental.
+package fhirio
+
+import (
+       "bytes"
+       "context"
+       "encoding/json"
+       "net/http"
+       "strings"
+
+       "github.com/apache/beam/sdks/v2/go/pkg/beam"
+       "github.com/apache/beam/sdks/v2/go/pkg/beam/internal/errors"
+       "github.com/apache/beam/sdks/v2/go/pkg/beam/register"
+)
+
+const (
+       bundleResponseTypeBatch       = "batch-response"
+       bundleResponseTypeTransaction = "transaction-response"
+)
+
+func init() {
+       register.DoFn4x0[context.Context, []byte, func(string), 
func(string)]((*executeBundlesFn)(nil))
+       register.Emitter1[string]()
+}
+
+type executeBundlesFn struct {

Review Comment:
   Good point. Although the equivalent class in the Java SDK is called 
`ExecuteBundlesFn`, I think that `executeBundleFn` would be more appropriate in 
this case, I guess it won't harm to make this naming improvement.



##########
sdks/go/pkg/beam/io/fhirio/execute_bundles_test.go:
##########
@@ -0,0 +1,79 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements.  See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License.  You may obtain a copy of the License at
+//
+//    http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package fhirio
+
+import (
+       "bytes"
+       "net/http"
+       "strings"
+       "testing"
+
+       "github.com/apache/beam/sdks/v2/go/pkg/beam/testing/passert"
+       "github.com/apache/beam/sdks/v2/go/pkg/beam/testing/ptest"
+)
+
+func TestExecuteBundles(t *testing.T) {

Review Comment:
   The successful scenario is being tested as part of the integration test. 
Milena had suggested to only unit test the error scenarios since we'd have to 
mock too many things to be able to bypass all error checks and reach success. 
That's what we do in the Java SDK.



##########
sdks/go/test/integration/io/fhirio/fhirio_test.go:
##########
@@ -75,13 +84,16 @@ func setupFhirStore(t *testing.T) (string, []string, 
func()) {
        healthcareDataset := fmt.Sprintf(datasetPathFmt, *gcpopts.Project, 
*gcpopts.Region)

Review Comment:
   I don't think it would ever be necessary to have a different dataset for 
different tests since we don't really care about the datasets, only the stores 
themselves matter here.
   Did you have a particular way to define it in mind?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to