@Test public void null_IP_address_is_resolved_as_unknown_without_strategy_call() throws Exception { assertEquals(new Target((InetAddress) null, TargetType.UNKNOWN), serviceToTest.resolveTarget((InetAddress) null)); verify(ipTestStrategy1, never()).resolveTargetFor(any()); }
@Override public Target resolveTarget(URI uri) { ensureInitialized(); if (uri == null) { return new Target(uri, TargetType.UNKNOWN); } if (illegalURItargetDetector != null) { if (illegalURItargetDetector.isIllegal(uri)) { return new Target(uri, TargetType.ILLEGAL); } } Target resolved = null; if (usedUriTargetResolveStrategy != null) { resolved = usedUriTargetResolveStrategy.resolveTargetFor(uri); } if (resolved == null) { resolved = new Target(uri, TargetType.INTERNET); } return resolved; }
TargetResolverService implements TargetResolver { @Override public Target resolveTarget(URI uri) { ensureInitialized(); if (uri == null) { return new Target(uri, TargetType.UNKNOWN); } if (illegalURItargetDetector != null) { if (illegalURItargetDetector.isIllegal(uri)) { return new Target(uri, TargetType.ILLEGAL); } } Target resolved = null; if (usedUriTargetResolveStrategy != null) { resolved = usedUriTargetResolveStrategy.resolveTargetFor(uri); } if (resolved == null) { resolved = new Target(uri, TargetType.INTERNET); } return resolved; } }
TargetResolverService implements TargetResolver { @Override public Target resolveTarget(URI uri) { ensureInitialized(); if (uri == null) { return new Target(uri, TargetType.UNKNOWN); } if (illegalURItargetDetector != null) { if (illegalURItargetDetector.isIllegal(uri)) { return new Target(uri, TargetType.ILLEGAL); } } Target resolved = null; if (usedUriTargetResolveStrategy != null) { resolved = usedUriTargetResolveStrategy.resolveTargetFor(uri); } if (resolved == null) { resolved = new Target(uri, TargetType.INTERNET); } return resolved; } TargetResolverService(); }
TargetResolverService implements TargetResolver { @Override public Target resolveTarget(URI uri) { ensureInitialized(); if (uri == null) { return new Target(uri, TargetType.UNKNOWN); } if (illegalURItargetDetector != null) { if (illegalURItargetDetector.isIllegal(uri)) { return new Target(uri, TargetType.ILLEGAL); } } Target resolved = null; if (usedUriTargetResolveStrategy != null) { resolved = usedUriTargetResolveStrategy.resolveTargetFor(uri); } if (resolved == null) { resolved = new Target(uri, TargetType.INTERNET); } return resolved; } TargetResolverService(); @Override Target resolveTargetForPath(String path); @Override Target resolveTarget(URI uri); @Override Target resolveTarget(InetAddress inetAdress); }
TargetResolverService implements TargetResolver { @Override public Target resolveTarget(URI uri) { ensureInitialized(); if (uri == null) { return new Target(uri, TargetType.UNKNOWN); } if (illegalURItargetDetector != null) { if (illegalURItargetDetector.isIllegal(uri)) { return new Target(uri, TargetType.ILLEGAL); } } Target resolved = null; if (usedUriTargetResolveStrategy != null) { resolved = usedUriTargetResolveStrategy.resolveTargetFor(uri); } if (resolved == null) { resolved = new Target(uri, TargetType.INTERNET); } return resolved; } TargetResolverService(); @Override Target resolveTargetForPath(String path); @Override Target resolveTarget(URI uri); @Override Target resolveTarget(InetAddress inetAdress);  }