Skip to content

Commit

Permalink
update unit tests for OperationOutcome content-type header
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-dzeda committed Oct 10, 2023
1 parent dace0a2 commit a9658b1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions bcda/responseutils/v2/writer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ func (s *ResponseUtilsWriterTestSuite) TestResponseWriterException() {
assert.Equal(s.T(), "TestResponseWriterExcepton", respOO.Issue[0].Details.Coding[0].Display.Value)
assert.Equal(s.T(), "TestResponseWriterExcepton", respOO.Issue[0].Details.Text.Value)
assert.Equal(s.T(), responseutils.RequestErr, respOO.Issue[0].Details.Coding[0].Code.Value)
assert.Equal(s.T(), constants.FHIRJsonContentType, s.rr.Header().Get("Content-Type"))

}

func (s *ResponseUtilsWriterTestSuite) TestResponseWriterNotFound() {
Expand All @@ -70,6 +72,8 @@ func (s *ResponseUtilsWriterTestSuite) TestResponseWriterNotFound() {
assert.Equal(s.T(), "TestResponseWriterNotFound", respOO.Issue[0].Details.Coding[0].Display.Value)
assert.Equal(s.T(), "TestResponseWriterNotFound", respOO.Issue[0].Details.Text.Value)
assert.Equal(s.T(), responseutils.RequestErr, respOO.Issue[0].Details.Coding[0].Code.Value)
assert.Equal(s.T(), constants.FHIRJsonContentType, s.rr.Header().Get("Content-Type"))

}

func (s *ResponseUtilsWriterTestSuite) TestCreateOpOutcome() {
Expand Down
3 changes: 3 additions & 0 deletions bcda/responseutils/writer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ func (s *ResponseUtilsWriterTestSuite) TestResponseWriterException() {
assert.Equal(s.T(), "TestResponseWriterExcepton", respOO.Issue[0].Details.Coding[0].Display.Value)
assert.Equal(s.T(), "TestResponseWriterExcepton", respOO.Issue[0].Details.Text.Value)
assert.Equal(s.T(), RequestErr, respOO.Issue[0].Details.Coding[0].Code.Value)
assert.Equal(s.T(), constants.FHIRJsonContentType, s.rr.Header().Get("Content-Type"))

}

func (s *ResponseUtilsWriterTestSuite) TestResponseWriterNotFound() {
Expand All @@ -69,6 +71,7 @@ func (s *ResponseUtilsWriterTestSuite) TestResponseWriterNotFound() {
assert.Equal(s.T(), "TestResponseWriterNotFound", respOO.Issue[0].Details.Coding[0].Display.Value)
assert.Equal(s.T(), "TestResponseWriterNotFound", respOO.Issue[0].Details.Text.Value)
assert.Equal(s.T(), RequestErr, respOO.Issue[0].Details.Coding[0].Code.Value)
assert.Equal(s.T(), constants.FHIRJsonContentType, s.rr.Header().Get("Content-Type"))
}

func (s *ResponseUtilsWriterTestSuite) TestCreateOpOutcome() {
Expand Down

0 comments on commit a9658b1

Please sign in to comment.