rename geo mock

This commit is contained in:
Pascal Fischer 2024-11-25 15:38:15 +01:00
parent 63b000c3b7
commit 4a1b1799dc
3 changed files with 7 additions and 7 deletions

View File

@ -267,20 +267,20 @@ func cleanupMaxMindDatabases(ctx context.Context, dataDir string, mmdbFile strin
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
}
func (g *GeolocationMock) GetAllCountries() ([]Country, error) {
func (g *Mock) GetAllCountries() ([]Country, error) {
return []Country{}, nil
}
func (g *GeolocationMock) GetCitiesByCountry(countryISOCode string) ([]City, error) {
func (g *Mock) GetCitiesByCountry(countryISOCode string) ([]City, error) {
return []City{}, nil
}
func (g *GeolocationMock) Stop() error {
func (g *Mock) Stop() error {
return nil
}

View File

@ -70,7 +70,7 @@ func initPostureChecksTestData(postureChecks ...*posture.Checks) *PostureChecksH
return claims.AccountId, claims.UserId, nil
},
},
geolocationManager: &geolocation.GeolocationMock{},
geolocationManager: &geolocation.Mock{},
claimsExtractor: jwtclaims.NewClaimsExtractor(
jwtclaims.WithFromRequestContext(func(r *http.Request) jwtclaims.AuthorizationClaims {
return jwtclaims.AuthorizationClaims{

View File

@ -1166,7 +1166,7 @@ func buildApiBlackBoxWithDBState(t *testing.T, sqlFile string, expectedPeerUpdat
close(done)
}()
geoMock := &geolocation.GeolocationMock{}
geoMock := &geolocation.Mock{}
validatorMock := server.MocIntegratedValidator{}
am, err := server.BuildManager(context.Background(), store, peersUpdateManager, nil, "", "", &activity.InMemoryEventStore{}, geoMock, false, validatorMock, metrics)
if err != nil {