Skip to content

Commit

Permalink
Changed data type to match other docs and added missing fields (#321)
Browse files Browse the repository at this point in the history
* Changed data type to match other docs and added missing fields

Took 20 minutes

* Updated page tests

Took 2 minutes
  • Loading branch information
Fank authored Sep 30, 2024
1 parent 4f89166 commit 37270f8
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 16 deletions.
14 changes: 8 additions & 6 deletions confluence/internal/page_impl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ import (
"context"
"encoding/json"
"errors"
model "github.com/ctreminiom/go-atlassian/pkg/infra/models"
"github.com/ctreminiom/go-atlassian/service"
"github.com/ctreminiom/go-atlassian/service/mocks"
"github.com/stretchr/testify/assert"
"log"
"net/http"
"testing"

"github.com/stretchr/testify/assert"

model "github.com/ctreminiom/go-atlassian/pkg/infra/models"
"github.com/ctreminiom/go-atlassian/service"
"github.com/ctreminiom/go-atlassian/service/mocks"
)

func Test_internalPageImpl_Get(t *testing.T) {
Expand Down Expand Up @@ -998,8 +1000,8 @@ func Test_internalPageImpl_Update(t *testing.T) {
}

mockedPayload := &model.PageUpdatePayloadScheme{
ID: 215646235,
SpaceID: 203718658,
ID: "215646235",
SpaceID: "203718658",
Status: "current",
Title: "Page create title test",
Body: &model.PageBodyRepresentationScheme{
Expand Down
23 changes: 13 additions & 10 deletions pkg/infra/models/confluence_page.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,11 @@ type PageBodyScheme struct {

// PageCreatePayloadScheme represents the payload for creating a page in Confluence.
type PageCreatePayloadScheme struct {
SpaceID string `json:"spaceId,omitempty"` // The ID of the space of the page.
Status string `json:"status,omitempty"` // The status of the page.
Title string `json:"title,omitempty"` // The title of the page.
Body *PageBodyRepresentationScheme `json:"body,omitempty"` // The body of the page.
SpaceID string `json:"spaceId,omitempty"` // The ID of the space of the page.
Status string `json:"status,omitempty"` // The status of the page.
Title string `json:"title,omitempty"` // The title of the page.
ParentID string `json:"parentId,omitempty"` // The ID of the parent of the page.
Body *PageBodyRepresentationScheme `json:"body,omitempty"` // The body of the page.
}

// PageBodyRepresentationScheme represents a representation of a body in Confluence.
Expand All @@ -87,12 +88,14 @@ type PageBodyRepresentationScheme struct {

// PageUpdatePayloadScheme represents the payload for updating a page in Confluence.
type PageUpdatePayloadScheme struct {
ID int `json:"id,omitempty"` // The ID of the page.
Status string `json:"status,omitempty"` // The status of the page.
Title string `json:"title,omitempty"` // The title of the page.
SpaceID int `json:"spaceId,omitempty"` // The ID of the space of the page.
Body *PageBodyRepresentationScheme `json:"body,omitempty"` // The body of the page.
Version *PageUpdatePayloadVersionScheme `json:"version,omitempty"` // The version of the page.
ID string `json:"id,omitempty"` // The ID of the page.
Status string `json:"status,omitempty"` // The status of the page.
Title string `json:"title,omitempty"` // The title of the page.
SpaceID string `json:"spaceId,omitempty"` // The ID of the space of the page.
ParentID string `json:"parentId,omitempty"` // The ID of the parent of the page.
OwnerID string `json:"ownerId,omitempty"` // The ID of the owner of the page.
Body *PageBodyRepresentationScheme `json:"body,omitempty"` // The body of the page.
Version *PageUpdatePayloadVersionScheme `json:"version,omitempty"` // The version of the page.
}

// PageUpdatePayloadVersionScheme represents the version of the payload for updating a page in Confluence.
Expand Down

0 comments on commit 37270f8

Please sign in to comment.