Skip to content

Commit

Permalink
ConcreteRegistry -> HTTPRegistry
Browse files Browse the repository at this point in the history
Signed-off-by: Maria Shaldibina <[email protected]>
  • Loading branch information
krishicks committed Oct 21, 2014
1 parent 29f19f0 commit 888c0f2
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion infrastructure/aws_infrastructure.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func NewAwsInfrastructure(
}

func NewAwsRegistry(metadataService MetadataService) Registry {
return NewConcreteRegistry(metadataService, false)
return NewHTTPRegistry(metadataService, false)
}

func (inf awsInfrastructure) GetDevicePathResolver() boshdpresolv.DevicePathResolver {
Expand Down
2 changes: 1 addition & 1 deletion infrastructure/aws_infrastructure_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func init() {

Describe("NewAwsRegistry", func() {
It("returns concrete registry with useServerNameAsID set to false", func() {
expectedRegistry := NewConcreteRegistry(metadataService, false)
expectedRegistry := NewHTTPRegistry(metadataService, false)
Expect(NewAwsRegistry(metadataService)).To(Equal(expectedRegistry))
})
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ import (
boshsettings "github.com/cloudfoundry/bosh-agent/settings"
)

type concreteRegistry struct {
type httpRegistry struct {
metadataService MetadataService
useServerNameAsID bool
}

func NewConcreteRegistry(
func NewHTTPRegistry(
metadataService MetadataService,
useServerNameAsID bool,
) concreteRegistry {
return concreteRegistry{
) httpRegistry {
return httpRegistry{
metadataService: metadataService,
useServerNameAsID: useServerNameAsID,
}
Expand All @@ -29,7 +29,7 @@ type settingsWrapperType struct {
Settings string
}

func (r concreteRegistry) GetSettings() (boshsettings.Settings, error) {
func (r httpRegistry) GetSettings() (boshsettings.Settings, error) {
var settings boshsettings.Settings

var identifier string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ import (
boshsettings "github.com/cloudfoundry/bosh-agent/settings"
)

var _ = Describe("concreteRegistry", func() {
var _ = Describe("httpRegistry", func() {
var (
metadataService *fakeinf.FakeMetadataService
registry Registry
)

BeforeEach(func() {
metadataService = &fakeinf.FakeMetadataService{}
registry = NewConcreteRegistry(metadataService, false)
registry = NewHTTPRegistry(metadataService, false)
})

Describe("GetSettings", func() {
Expand Down Expand Up @@ -51,7 +51,7 @@ var _ = Describe("concreteRegistry", func() {

Context("when registry is configured to not use server name as id", func() {
BeforeEach(func() {
registry = NewConcreteRegistry(metadataService, false)
registry = NewHTTPRegistry(metadataService, false)
metadataService.InstanceID = "fake-identifier"
metadataService.RegistryEndpoint = ts.URL
})
Expand Down Expand Up @@ -213,7 +213,7 @@ var _ = Describe("concreteRegistry", func() {

Context("when registry is configured to use server name as id", func() {
BeforeEach(func() {
registry = NewConcreteRegistry(metadataService, true)
registry = NewHTTPRegistry(metadataService, true)
metadataService.ServerName = "fake-identifier"
metadataService.RegistryEndpoint = ts.URL
})
Expand Down
2 changes: 1 addition & 1 deletion infrastructure/openstack_infrastructure.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func NewOpenstackInfrastructure(
}

func NewOpenstackRegistry(metadataService MetadataService) Registry {
return NewConcreteRegistry(metadataService, true)
return NewHTTPRegistry(metadataService, true)
}

func (inf openstackInfrastructure) GetDevicePathResolver() boshdpresolv.DevicePathResolver {
Expand Down
2 changes: 1 addition & 1 deletion infrastructure/openstack_infrastructure_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func init() {

Describe("NewOpenstackRegistry", func() {
It("returns concrete registry with useServerNameAsID set to true", func() {
expectedRegistry := NewConcreteRegistry(metadataService, true)
expectedRegistry := NewHTTPRegistry(metadataService, true)
Expect(NewOpenstackRegistry(metadataService)).To(Equal(expectedRegistry))
})
})
Expand Down

0 comments on commit 888c0f2

Please sign in to comment.