TollboothRoadAdminClient implements RoadAdminClient { @Override public void updateRoad(PatchSet patchSet) throws UnknownRoadException, IllegalArgumentException, ServiceException { modificationEmitter.emit(patchSet); } @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);  }
@Test public void updateRoad() throws Exception { store.put(road1.getName(), road1); client.updateRoad(new PatchSet(road1.getName(), singletonList(PatchOperation.replace("/enabled", Boolean.TRUE)))); assertTrue(store.get(road1.getName()).isEnabled()); }
@Test public void updateRoad_withDeleteRoadPatch() throws Exception { store.put(road1.getName(), road1); client.updateRoad(new PatchSet(road1.getName(), singletonList(PatchOperation.remove("")))); assertNull(store.get(road1.getName())); }