package org.apache.lucene.spatial.base.context;

import static org.junit.Assert.assertEquals;

import org.apache.lucene.spatial.base.context.simple.SimpleSpatialContext;
import org.junit.After;
import org.junit.Test;


public class SpatialContextProviderTest {

  @Test
  public void testGetContext_simpleSpatialContext() {
    System.setProperty("SpatialContextProvider", "org.apache.lucene.spatial.base.context.MockSpatialContext");

    SpatialContext spatialContext = SpatialContextProvider.getContext();
    assertEquals(MockSpatialContext.class, spatialContext.getClass());
  }

  @Test
  public void testGetContext_defaultBehavior() {
    SpatialContext spatialContext = SpatialContextProvider.getContext();
    assertEquals(SimpleSpatialContext.class, spatialContext.getClass());
  }

  @Test
  public void testGetContext_unknownContext() {
    System.setProperty("SpatialContextProvider", "org.apache.lucene.spatial.base.context.ContextDoesNotExist");

    SpatialContext spatialContext = SpatialContextProvider.getContext();
    assertEquals(SimpleSpatialContext.class, spatialContext.getClass());
  }

  @After
  public void tearDown() {
    System.getProperties().remove("SpatialContextProvider");
    SpatialContextProvider.clear();
  }
}

@@ -46,54 +46,8 @@
 t;%0A%0A
-import static org.junit.Assert.assertEquals;%0A%0A
 impo
@@ -117,16 +117,16 @@
 ontext;%0A
+
 import o
@@ -165,16 +165,62 @@
 .Test;%0A%0A
+import static org.junit.Assert.assertEquals;%0A%0A
 %0Apublic 
@@ -370,67 +370,42 @@
 r%22, 
-%22org.apache.lucene.spatial.base.context.MockSpatialContext%22
+MockSpatialContext.class.getName()
 );%0A%0A

Use typed reference to MockSpatialContext to avoid changes in package names.