@Test public void listRoads_deleted() throws Exception { road1.setDeleted(true); store.put("road1", road1); Set<String> roads; roads = client.listRoads(); assertTrue(roads.isEmpty()); }
@Override public SortedSet<String> listRoads() throws ServiceException { return ImmutableSortedSet.copyOf(store.entrySet().stream().filter(r -> !r.getValue().isDeleted()) .map(x -> x.getKey()).collect(Collectors.toSet())); }
TollboothRoadAdminClient implements RoadAdminClient { @Override public SortedSet<String> listRoads() throws ServiceException { return ImmutableSortedSet.copyOf(store.entrySet().stream().filter(r -> !r.getValue().isDeleted()) .map(x -> x.getKey()).collect(Collectors.toSet())); } }
TollboothRoadAdminClient implements RoadAdminClient { @Override public SortedSet<String> listRoads() throws ServiceException { return ImmutableSortedSet.copyOf(store.entrySet().stream().filter(r -> !r.getValue().isDeleted()) .map(x -> x.getKey()).collect(Collectors.toSet())); } @Autowired  TollboothRoadAdminClient(@Value("#{store}") Map<String, Road> store, PatchSetEmitter modificationEmitter); }
TollboothRoadAdminClient implements RoadAdminClient { @Override public SortedSet<String> listRoads() throws ServiceException { return ImmutableSortedSet.copyOf(store.entrySet().stream().filter(r -> !r.getValue().isDeleted()) .map(x -> x.getKey()).collect(Collectors.toSet())); } @Autowired  TollboothRoadAdminClient(@Value("#{store}") Map<String, Road> store, PatchSetEmitter modificationEmitter); @Override SortedSet<String> listRoads(); @Override Optional<Road> getRoad(String name); @Override void createRoad(Road road); @Override void updateRoad(PatchSet patchSet); }
TollboothRoadAdminClient implements RoadAdminClient { @Override public SortedSet<String> listRoads() throws ServiceException { return ImmutableSortedSet.copyOf(store.entrySet().stream().filter(r -> !r.getValue().isDeleted()) .map(x -> x.getKey()).collect(Collectors.toSet())); } @Autowired  TollboothRoadAdminClient(@Value("#{store}") Map<String, Road> store, PatchSetEmitter modificationEmitter); @Override SortedSet<String> listRoads(); @Override Optional<Road> getRoad(String name); @Override void createRoad(Road road); @Override void updateRoad(PatchSet patchSet);  }