HandleIdentifierProvider extends IdentifierProvider { @Override public boolean supports(Class<? extends Identifier> identifier) { return Handle.class.isAssignableFrom(identifier); }  @Override boolean supports(Class<? extends Identifier> identifier); @Override boolean supports(String identifier); @Override String register(Context context, DSpaceObject dso); @Override void register(Context context, DSpaceObject dso, String identifier); @Override void reserve(Context context, DSpaceObject dso, String identifier); @Override String mint(Context context, DSpaceObject dso); @Override DSpaceObject resolve(Context context, String identifier, String... attributes); @Override String lookup(Context context, DSpaceObject dso); @Override void delete(Context context, DSpaceObject dso, String identifier); @Override void delete(Context context, DSpaceObject dso); static String retrieveHandleOutOfUrl(String url); static String getPrefix();  }
@Test public void testSupports_String() { System.out.println("supports(String)"); DSpaceServicesFactory.getInstance().getConfigurationService().setProperty("handle.prefix", "123456789"); DSpaceServicesFactory.getInstance().getConfigurationService().setProperty("handle.additional.prefixes", "123456789.1,123456789.2"); HandleIdentifierProvider instance = new HandleIdentifierProvider(); applicationContext.getAutowireCapableBeanFactory().autowireBeanProperties( instance, AutowireCapableBeanFactory.AUTOWIRE_BY_TYPE, true); Properties forms = new Properties(); try { forms.load(this.getClass().getResourceAsStream("handle-forms.properties")); } catch (IOException e) { System.err.format("Could not load handle-forms.properties: %s%n", e.getMessage()); return; } for (Map.Entry<Object, Object> entry : forms.entrySet()) { String identifier = (String)entry.getKey(); boolean expResult = Boolean.parseBoolean((String)entry.getValue()); boolean result = instance.supports(identifier); String message = expResult ? "This provider should support " + identifier : "This provider should not support " + identifier; assertEquals(message, expResult, result); } }