Skip to content

Commit

Permalink
update hiboot to v0.6.2
Browse files Browse the repository at this point in the history
  • Loading branch information
john-deng committed Sep 18, 2018
1 parent b08712b commit 8032516
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 23 deletions.
6 changes: 3 additions & 3 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

[[constraint]]
name = "github.com/hidevopsio/hiboot"
version = "v0.6.1"
version = "v0.6.2"

[[constraint]]
name = "github.com/stretchr/testify"
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# hiboot-data-data
# hiboot-data


<p align="center">
Expand All @@ -19,5 +19,5 @@
</a>
</p>

hiboot-data starter, include bolt, etcd, gorm
hiboot data starter, include bolt, etcd, gorm

2 changes: 1 addition & 1 deletion examples/bolt/service/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ package service

import (
"github.com/hidevopsio/hiboot-data/examples/bolt/entity"
"github.com/hidevopsio/hiboot/pkg/app"
"github.com/hidevopsio/hiboot-data/starter/bolt"
"github.com/hidevopsio/hiboot/pkg/app"
)

type UserService struct {
Expand Down
24 changes: 12 additions & 12 deletions examples/etcd/controller/user_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ package controller
import (
"errors"
"github.com/hidevopsio/hiboot-data/examples/etcd/entity"
"github.com/hidevopsio/hiboot-data/starter/etcd/fake"
"github.com/hidevopsio/hiboot/pkg/app"
"github.com/hidevopsio/hiboot/pkg/app/web"
"github.com/hidevopsio/hiboot/pkg/log"
"github.com/hidevopsio/hiboot-data/starter/etcd/fake"
"github.com/hidevopsio/hiboot/pkg/utils/idgen"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
Expand Down Expand Up @@ -79,6 +79,17 @@ func TestCrdRequest(t *testing.T) {
Gender: 1,
}

unknownId, err := idgen.NextString()
assert.Equal(t, nil, err)
svc.On("GetUser", unknownId).Return((*entity.User)(nil), errors.New("not found"))

t.Run("should return 404 if trying to find a record that does not exist", func(t *testing.T) {
// Then Get User
testApp.Get("/user/id/{id}").
WithPath("id", unknownId).
Expect().Status(http.StatusNotFound)
})

t.Run("should add user with POST request", func(t *testing.T) {
// First, let's Post User
testApp.Post("/user").
Expand All @@ -96,17 +107,6 @@ func TestCrdRequest(t *testing.T) {
Expect().Status(http.StatusOK)
})

unknownId, err := idgen.NextString()
assert.Equal(t, nil, err)
svc.On("GetUser", unknownId).Return((*entity.User)(nil), errors.New("not found"))

t.Run("should return 404 if trying to find a record that does not exist", func(t *testing.T) {
// Then Get User
testApp.Get("/user/id/{id}").
WithPath("id", unknownId).
Expect().Status(http.StatusNotFound)
})

// assert that the expectations were met
svc.AssertExpectations(t)

Expand Down
2 changes: 1 addition & 1 deletion examples/etcd/service/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ import (
"errors"
"fmt"
"github.com/hidevopsio/hiboot-data/examples/etcd/entity"
"github.com/hidevopsio/hiboot-data/starter/etcd"
"github.com/hidevopsio/hiboot/pkg/app"
"github.com/hidevopsio/hiboot/pkg/log"
"github.com/hidevopsio/hiboot-data/starter/etcd"
"time"
)

Expand Down
2 changes: 1 addition & 1 deletion examples/etcd/service/user_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import (
"errors"
_ "github.com/erikstmartin/go-testdb"
"github.com/hidevopsio/hiboot-data/examples/etcd/entity"
"github.com/hidevopsio/hiboot/pkg/log"
"github.com/hidevopsio/hiboot-data/starter/etcd/fake"
"github.com/hidevopsio/hiboot/pkg/log"
"github.com/hidevopsio/hiboot/pkg/utils/idgen"
"github.com/stretchr/testify/assert"
"go.etcd.io/etcd/clientv3"
Expand Down
2 changes: 1 addition & 1 deletion examples/gorm/service/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ package service
import (
"errors"
"github.com/hidevopsio/hiboot-data/examples/gorm/entity"
"github.com/hidevopsio/hiboot/pkg/app"
"github.com/hidevopsio/hiboot-data/starter/gorm"
"github.com/hidevopsio/hiboot/pkg/app"
"github.com/hidevopsio/hiboot/pkg/utils/idgen"
)

Expand Down
Binary file modified starter/bolt/test.db
Binary file not shown.
2 changes: 1 addition & 1 deletion starter/etcd/autoconfigure_test.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package etcd

import (
"github.com/hidevopsio/hiboot/pkg/log"
"github.com/hidevopsio/hiboot-data/starter/etcd/fake"
"github.com/hidevopsio/hiboot/pkg/log"
"github.com/stretchr/testify/assert"
"go.etcd.io/etcd/clientv3"
"testing"
Expand Down

0 comments on commit 8032516

Please sign in to comment.