File tree Expand file tree Collapse file tree 3 files changed +398
-2
lines changed
Expand file tree Collapse file tree 3 files changed +398
-2
lines changed Original file line number Diff line number Diff line change @@ -607,7 +607,7 @@ func TestAPIClient_PostPolicy(t *testing.T) {
607607 httpClient := & dphttp.ClienterMock {
608608 DoFunc : func (ctx context.Context , req * http.Request ) (* http.Response , error ) {
609609 return & http.Response {
610- StatusCode : http .StatusOK ,
610+ StatusCode : http .StatusCreated ,
611611 Body : io .NopCloser (bytes .NewReader (bresult )),
612612 }, nil
613613 },
@@ -653,7 +653,7 @@ func TestAPIClient_PostPolicy_BadRequest(t *testing.T) {
653653 })
654654}
655655
656- func TestAPIClient_PostPolicy_Non200ResponseCodeReturned (t * testing.T ) {
656+ func TestAPIClient_PostPolicy_Non201ResponseCodeReturned (t * testing.T ) {
657657 ctx := context .Background ()
658658
659659 Convey ("Given a mock http client that returns a response code 400" , t , func () {
Original file line number Diff line number Diff line change 1+ package sdk
2+
3+ import (
4+ "context"
5+
6+ "github.com/ONSdigital/dp-permissions-api/models"
7+ )
8+
9+ //go:generate moq -out ./mocks/client.go -pkg mocks . Clienter
10+
11+ type Clienter interface {
12+ GetRoles (ctx context.Context ) (* models.Roles , error )
13+ GetRole (ctx context.Context , id string ) (* models.Roles , error )
14+ PostPolicy (ctx context.Context , policy models.PolicyInfo ) (* models.Policy , error )
15+ DeletePolicy (ctx context.Context , id string ) error
16+ GetPolicy (ctx context.Context , id string ) (* models.Policy , error )
17+ PutPolicy (ctx context.Context , id string , policy models.Policy ) error
18+ GetPermissionsBundle (ctx context.Context ) (Bundle , error )
19+ }
You can’t perform that action at this time.
0 commit comments