OpenLRDecoder implements openlr.OpenLRDecoder { public static List<PhysicalDecoder> resolvePhysicalDecoder() { ServiceLoader<PhysicalDecoder> decoderServices = ServiceLoader .load(PhysicalDecoder.class); List<PhysicalDecoder> decoders = new ArrayList<PhysicalDecoder>(); for (PhysicalDecoder pd : decoderServices) { decoders.add(pd); } return decoders; }  static List<PhysicalDecoder> resolvePhysicalDecoder(); @Override Location decode(final OpenLRDecoderParameter parameter,
                           final LocationReference locRef); @Override List<Location> decode(final OpenLRDecoderParameter parameter,
                                 final List<LocationReference> locRefs); @Override List<Location> decodeRaw(final OpenLRDecoderParameter parameter,
                                    final List<RawLocationReference> locRefs); @Override Location decodeRaw(final OpenLRDecoderParameter parameter,
                              final RawLocationReference rawLocRef); @Override String getMajorVersion(); @Override String getMinorVersion(); @Override String getPatchVersion(); @Override String getVersion();  }
@Test(dependsOnMethods = {"testPOIWithAccesNoOffsets"}) public final void testResolvePhysicalDecoder() { final LocationReference mockedLocRef = mockery.mock( LocationReference.class, "locRefDummy"); mockery.checking(new Expectations() { { allowing(mockedLocRef).getDataClass(); will(returnValue(Object.class)); } }); mockery.checking(new Expectations() { { allowing(mockedLocRef).getDataIdentifier(); will(returnValue(DummyPhysicalDecoderImpl.DATA_IDENTIFIER)); } }); mockery.checking(new Expectations() { { allowing(mockedLocRef).getLocationReferenceData(); will(returnValue(null)); } }); mockery.checking(new Expectations() { { allowing(mockedLocRef).getID(); will(returnValue(mockedLocRefPoiWithAccess.getID())); } }); assertNotNull(mockedLocRefPoiWithAccess, "Required input object is null!"); DummyPhysicalDecoderImpl.setRawLocToReturn(mockedLocRefPoiWithAccess); try { InputStream properties = new FileInputStream(DECODER_PROPERTIES); Configuration conf = OpenLRPropertiesReader .loadPropertiesFromStream(properties, true); OpenLRDecoder decoder = new OpenLRDecoder(); OpenLRDecoderParameter parameter = new OpenLRDecoderParameter.Builder() .with(mockedMapDB) .with(conf).buildParameter(); Location decLocRef = decoder.decode(parameter, mockedLocRef); assertEquals(decLocRef.getID(), mockedLocRefPoiWithAccess.getID()); properties = new FileInputStream(DECODER_PROPERTIES); List<Location> decLocRefs = decoder.decode(parameter, Arrays.asList(mockedLocRef)); assertEquals(decLocRefs.get(0).getID(), mockedLocRefPoiWithAccess.getID()); } catch (OpenLRProcessingException e) { fail("Decoding location failed with exception: " + e.getErrorCode(), e); } catch (IOException e) { fail("Error creating properties stream.", e); } finally { DummyPhysicalDecoderImpl.setRawLocToReturn(null); } }