### Question:
ValidationController { @RequestMapping(value = "{canonicalClassName:.+}", method = RequestMethod.GET) public ModelConstraint getConstraintsForClassName(@PathVariable String canonicalClassName, @RequestParam(required = false) String locale) { Locale loc = null; try { if (locale != null) { loc = parseLocale(locale); } return this.validationService.getConstraintsForClassName(canonicalClassName, loc); } catch (ClassNotFoundException e) { throw new NotFoundException("Class " + canonicalClassName + " could not be found", e); } }  @Inject @Named("validationService") void setService(ValidationService validationService); @RequestMapping(value = "{canonicalClassName:.+}", method = RequestMethod.GET) ModelConstraint getConstraintsForClassName(@PathVariable String canonicalClassName, @RequestParam(required = false) String locale);  }### Answer:
@Test public void testGetConstraints() throws ClassNotFoundException { this.validationController.getConstraintsForClassName("knownClassName", "fr"); verify(this.validationService).getConstraintsForClassName(eq("knownClassName"), any(Locale.class)); }
@Test public void testGetConstraintsNoLocale() throws ClassNotFoundException { this.validationController.getConstraintsForClassName("knownClassName", null); verify(this.validationService).getConstraintsForClassName(eq("knownClassName"), isNull(Locale.class)); }
@Test(expectedExceptions = NotFoundException.class) public void testGetConstraintsUnknownClass() { this.validationController.getConstraintsForClassName("unknownClassName", "fr"); }