@Test(expected = IllegalArgumentException.class) public void shouldValidateRestResource() { new RestServerRouteDestination("test", null).validate(); }
@Override public void validate() { if (name == null || "".equals(name)) { throw new IllegalArgumentException("Name can not be null"); } if (restServer == null) { throw new IllegalArgumentException("REST resource can not be null"); } }
RestServerRouteDestination implements RouteDestination { @Override public void validate() { if (name == null || "".equals(name)) { throw new IllegalArgumentException("Name can not be null"); } if (restServer == null) { throw new IllegalArgumentException("REST resource can not be null"); } } }
RestServerRouteDestination implements RouteDestination { @Override public void validate() { if (name == null || "".equals(name)) { throw new IllegalArgumentException("Name can not be null"); } if (restServer == null) { throw new IllegalArgumentException("REST resource can not be null"); } } RestServerRouteDestination(String name, RestServer restServer); }
RestServerRouteDestination implements RouteDestination { @Override public void validate() { if (name == null || "".equals(name)) { throw new IllegalArgumentException("Name can not be null"); } if (restServer == null) { throw new IllegalArgumentException("REST resource can not be null"); } } RestServerRouteDestination(String name, RestServer restServer); String getName(); RestServer getRestServer(); @Override String toString(); @Override void validate(); }
RestServerRouteDestination implements RouteDestination { @Override public void validate() { if (name == null || "".equals(name)) { throw new IllegalArgumentException("Name can not be null"); } if (restServer == null) { throw new IllegalArgumentException("REST resource can not be null"); } } RestServerRouteDestination(String name, RestServer restServer); String getName(); RestServer getRestServer(); @Override String toString(); @Override void validate();  }