@Test public void testAssignModels() { StbModelController controller = new StbModelController(); controller.houseService = new MockHouseService(); controller.service = new MockParkService(); controller.houseService.upsertStb(createStb("abc", "00:00:00:00:00:02", "DCT6412", "MAC_G", new String[] {"HD"}, new String[]{})); controller.assignModels(); MetaStb stb = new MetaStb(controller.houseService.getById("abc")); Assert.assertEquals(stb.getCapabilities().size(), 1); Assert.assertTrue(stb.getCapabilities().contains(Capability.HD)); Assert.assertEquals(stb.getFamily(), Family.MAC_G); }
@RequestMapping("/assignmodels") public ModelAndView assignModels() { applyModels(houseService.getAll(), service.getModels()) ; return models(); }
StbModelController { @RequestMapping("/assignmodels") public ModelAndView assignModels() { applyModels(houseService.getAll(), service.getModels()) ; return models(); } }
StbModelController { @RequestMapping("/assignmodels") public ModelAndView assignModels() { applyModels(houseService.getAll(), service.getModels()) ; return models(); }  }
StbModelController { @RequestMapping("/assignmodels") public ModelAndView assignModels() { applyModels(houseService.getAll(), service.getModels()) ; return models(); }  @RequestMapping(value="models", method=RequestMethod.GET) @ResponseBody List<DawgModel> getModels(@RequestParam String[] id); @RequestMapping(value="models/{id}", method=RequestMethod.POST) @ResponseBody boolean addModel(@RequestBody DawgModel newModel, @PathVariable String id); @RequestMapping(value="models/{id}", method=RequestMethod.DELETE) @ResponseBody boolean deleteModel(@PathVariable String id); @RequestMapping("/modelsConfig") ModelAndView models(); @RequestMapping("/assignmodels") ModelAndView assignModels(); void applyModels(Map<String, Object>[] stbs, List<DawgModel> models); }
StbModelController { @RequestMapping("/assignmodels") public ModelAndView assignModels() { applyModels(houseService.getAll(), service.getModels()) ; return models(); }  @RequestMapping(value="models", method=RequestMethod.GET) @ResponseBody List<DawgModel> getModels(@RequestParam String[] id); @RequestMapping(value="models/{id}", method=RequestMethod.POST) @ResponseBody boolean addModel(@RequestBody DawgModel newModel, @PathVariable String id); @RequestMapping(value="models/{id}", method=RequestMethod.DELETE) @ResponseBody boolean deleteModel(@PathVariable String id); @RequestMapping("/modelsConfig") ModelAndView models(); @RequestMapping("/assignmodels") ModelAndView assignModels(); void applyModels(Map<String, Object>[] stbs, List<DawgModel> models);  }