WeighBridgeController { @GetMapping("/brokers") public List<Broker> getAllBrokers() { return new ArrayList<>(map.values()); }  @GetMapping("/brokers/current") Broker getCurrentBroker(); @GetMapping("/brokers") List<Broker> getAllBrokers();  }
@Test public void getBrokers() { final Broker broker1 = new Broker(1, "rack", new ArrayList<>()); final Broker broker2 = new Broker(2, "rack", new ArrayList<>()); final Broker broker3 = new Broker(3, "rack", new ArrayList<>()); final HashMap<Integer, Broker> map = new HashMap<>(); map.put(1, broker1); map.put(2, broker2); map.put(3, broker3); underTest = new WeighBridgeController(new AtomicReference<>(broker1), map); assertEquals(ImmutableList.of(broker1, broker2, broker3), underTest.getAllBrokers()); }