WIP: Morph: Add unit tests #2

Closed
dstepanov-yadro wants to merge 233 commits from TrueCloudLab/frostfs-node:master into object-3608-morph-unit-tests
2 changed files with 3 additions and 24 deletions
Showing only changes of commit a476d8285a - Show all commits

View file

@ -397,9 +397,7 @@ func createDeleteService(c *cfg, keyStorage *util.KeyStorage, sGet *getsvc.Servi
} }
func createDeleteServiceV2(sDelete *deletesvc.Service) *deletesvcV2.Service { func createDeleteServiceV2(sDelete *deletesvc.Service) *deletesvcV2.Service {
return deletesvcV2.NewService( return deletesvcV2.NewService(sDelete)
deletesvcV2.WithInternalService(sDelete),
)
} }
func createSplitService(c *cfg, sPutV2 *putsvcV2.Service, sGetV2 *getsvcV2.Service, func createSplitService(c *cfg, sPutV2 *putsvcV2.Service, sGetV2 *getsvcV2.Service,

View file

@ -9,26 +9,13 @@ import (
// Service implements Delete operation of Object service v2. // Service implements Delete operation of Object service v2.
type Service struct { type Service struct {
*cfg
}
// Option represents Service constructor option.
type Option func(*cfg)
type cfg struct {
svc *deletesvc.Service svc *deletesvc.Service
} }
// NewService constructs Service instance from provided options. // NewService constructs Service instance from provided options.
func NewService(opts ...Option) *Service { func NewService(svc *deletesvc.Service) *Service {
c := new(cfg)
for i := range opts {
opts[i](c)
}
return &Service{ return &Service{
cfg: c, svc: svc,
} }
} }
@ -51,9 +38,3 @@ func (s *Service) Delete(ctx context.Context, req *objectV2.DeleteRequest) (*obj
return resp, nil return resp, nil
} }
func WithInternalService(v *deletesvc.Service) Option {
return func(c *cfg) {
c.svc = v
}
}