@Test @SuppressWarnings("unchecked") public void verifyInjectLinksForEmptyPath() throws NoSuchFieldException, IllegalAccessException { FieldPath tested = FieldPath.EMPTY_PATH; HateoasLinkInjector<Object> linkInjector = mock(HateoasLinkInjector.class); DummyBean expectedInput = new DummyBean(); DummyBean expectedOutput = new DummyBean(); LinkProducer<Object> expectedLinkProducer = mock(LinkProducer.class); when(linkInjector.injectLinks(expectedInput, expectedLinkProducer, HateoasVerbosity.MAXIMUM)) .thenReturn(expectedOutput); Object result = tested.injectLinks(expectedInput, linkInjector, expectedLinkProducer, HateoasVerbosity.MAXIMUM); assertSame(expectedOutput, result); }
public Object injectLinks(Object target, HateoasLinkInjector<Object> injector, LinkProducer linkProducer, HateoasVerbosity verbosity) { if (target == null) { return target; } try { return injectLinks(iterator(), target, injector, linkProducer, verbosity); } catch (Exception e) { throw new HateoasInjectException(e); } }
FieldPath implements Iterable<String> { public Object injectLinks(Object target, HateoasLinkInjector<Object> injector, LinkProducer linkProducer, HateoasVerbosity verbosity) { if (target == null) { return target; } try { return injectLinks(iterator(), target, injector, linkProducer, verbosity); } catch (Exception e) { throw new HateoasInjectException(e); } } }
FieldPath implements Iterable<String> { public Object injectLinks(Object target, HateoasLinkInjector<Object> injector, LinkProducer linkProducer, HateoasVerbosity verbosity) { if (target == null) { return target; } try { return injectLinks(iterator(), target, injector, linkProducer, verbosity); } catch (Exception e) { throw new HateoasInjectException(e); } } private  FieldPath(Collection<String> path); }
FieldPath implements Iterable<String> { public Object injectLinks(Object target, HateoasLinkInjector<Object> injector, LinkProducer linkProducer, HateoasVerbosity verbosity) { if (target == null) { return target; } try { return injectLinks(iterator(), target, injector, linkProducer, verbosity); } catch (Exception e) { throw new HateoasInjectException(e); } } private  FieldPath(Collection<String> path); static FieldPath path(String path); @Override Iterator<String> iterator(); Object injectLinks(Object target, HateoasLinkInjector<Object> injector, LinkProducer linkProducer,
                              HateoasVerbosity verbosity); @Override boolean equals(Object o); @Override int hashCode(); }
FieldPath implements Iterable<String> { public Object injectLinks(Object target, HateoasLinkInjector<Object> injector, LinkProducer linkProducer, HateoasVerbosity verbosity) { if (target == null) { return target; } try { return injectLinks(iterator(), target, injector, linkProducer, verbosity); } catch (Exception e) { throw new HateoasInjectException(e); } } private  FieldPath(Collection<String> path); static FieldPath path(String path); @Override Iterator<String> iterator(); Object injectLinks(Object target, HateoasLinkInjector<Object> injector, LinkProducer linkProducer,
                              HateoasVerbosity verbosity); @Override boolean equals(Object o); @Override int hashCode(); final static FieldPath EMPTY_PATH; }