-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Craig Perkins <[email protected]>
- Loading branch information
Showing
4 changed files
with
33 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
src/test/java/org/opensearch/geospatial/TestGeospatialPlugin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.opensearch.geospatial; | ||
|
||
import java.util.ArrayList; | ||
import java.util.Collection; | ||
import java.util.List; | ||
|
||
import org.opensearch.common.lifecycle.LifecycleComponent; | ||
import org.opensearch.geospatial.ip2geo.listener.Ip2GeoListener; | ||
import org.opensearch.geospatial.plugin.GeospatialPlugin; | ||
|
||
/** | ||
* This class is needed for ClusterSettingsHelper.createMockNode to instantiate a test instance of the | ||
* GeospatialPlugin without the JobSchedulerPlugin installed. Without overriding this class, the | ||
* GeospatialPlugin would try to Inject JobScheduler's LockService in the GuiceHolder which will | ||
* fail because JobScheduler is not installed | ||
*/ | ||
public class TestGeospatialPlugin extends GeospatialPlugin { | ||
@Override | ||
public Collection<Class<? extends LifecycleComponent>> getGuiceServiceClasses() { | ||
final List<Class<? extends LifecycleComponent>> services = new ArrayList<>(1); | ||
services.add(Ip2GeoListener.class); | ||
return services; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters