RuntimeDelegate { public static RuntimeDelegate getInstance() { RuntimeDelegate result = cachedDelegate; if (result == null) { synchronized (RD_LOCK) { result = cachedDelegate; if (result == null) { cachedDelegate = result = findDelegate(); } } } return result; } protected  RuntimeDelegate(); static RuntimeDelegate getInstance(); static void setInstance(final RuntimeDelegate rd); abstract UriBuilder createUriBuilder(); abstract ResponseBuilder createResponseBuilder(); abstract VariantListBuilder createVariantListBuilder(); abstract T createEndpoint(Application application, Class<T> endpointType); abstract HeaderDelegate<T> createHeaderDelegate(Class<T> type); abstract Link.Builder createLinkBuilder(); static final String JAXRS_RUNTIME_DELEGATE_PROPERTY; }
@Test public void testGetInstanceFailsIfNoImplementationAvailable() { try { RuntimeDelegate.getInstance(); fail(); } catch (RuntimeException e) { assertEquals( "java.lang.ClassNotFoundException: Provider for jakarta.ws.rs.ext.RuntimeDelegate cannot be found", e.getMessage()); } }