mirror of
https://github.com/netbirdio/netbird.git
synced 2025-08-20 11:33:07 +02:00
rename geo mock
This commit is contained in:
@@ -267,20 +267,20 @@ func cleanupMaxMindDatabases(ctx context.Context, dataDir string, mmdbFile strin
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type GeolocationMock struct{}
|
type Mock struct{}
|
||||||
|
|
||||||
func (g *GeolocationMock) Lookup(ip net.IP) (*Record, error) {
|
func (g *Mock) Lookup(ip net.IP) (*Record, error) {
|
||||||
return &Record{}, nil
|
return &Record{}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (g *GeolocationMock) GetAllCountries() ([]Country, error) {
|
func (g *Mock) GetAllCountries() ([]Country, error) {
|
||||||
return []Country{}, nil
|
return []Country{}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (g *GeolocationMock) GetCitiesByCountry(countryISOCode string) ([]City, error) {
|
func (g *Mock) GetCitiesByCountry(countryISOCode string) ([]City, error) {
|
||||||
return []City{}, nil
|
return []City{}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (g *GeolocationMock) Stop() error {
|
func (g *Mock) Stop() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@@ -70,7 +70,7 @@ func initPostureChecksTestData(postureChecks ...*posture.Checks) *PostureChecksH
|
|||||||
return claims.AccountId, claims.UserId, nil
|
return claims.AccountId, claims.UserId, nil
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
geolocationManager: &geolocation.GeolocationMock{},
|
geolocationManager: &geolocation.Mock{},
|
||||||
claimsExtractor: jwtclaims.NewClaimsExtractor(
|
claimsExtractor: jwtclaims.NewClaimsExtractor(
|
||||||
jwtclaims.WithFromRequestContext(func(r *http.Request) jwtclaims.AuthorizationClaims {
|
jwtclaims.WithFromRequestContext(func(r *http.Request) jwtclaims.AuthorizationClaims {
|
||||||
return jwtclaims.AuthorizationClaims{
|
return jwtclaims.AuthorizationClaims{
|
||||||
|
@@ -1166,7 +1166,7 @@ func buildApiBlackBoxWithDBState(t *testing.T, sqlFile string, expectedPeerUpdat
|
|||||||
close(done)
|
close(done)
|
||||||
}()
|
}()
|
||||||
|
|
||||||
geoMock := &geolocation.GeolocationMock{}
|
geoMock := &geolocation.Mock{}
|
||||||
validatorMock := server.MocIntegratedValidator{}
|
validatorMock := server.MocIntegratedValidator{}
|
||||||
am, err := server.BuildManager(context.Background(), store, peersUpdateManager, nil, "", "", &activity.InMemoryEventStore{}, geoMock, false, validatorMock, metrics)
|
am, err := server.BuildManager(context.Background(), store, peersUpdateManager, nil, "", "", &activity.InMemoryEventStore{}, geoMock, false, validatorMock, metrics)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Reference in New Issue
Block a user