title: Java Spring controller breakpoint and JUnit
body: <p>I have a Spring REST application with Junit tests. I run the app in Eclipse and I start the tests. If I set breakpoints in the Junit class it works fine and it stops execution but if I set breakpoints directly in the called controller nothing happen.
  What I am doing wrong?</p>
  
  <pre><code>@Test
  public void testAddVideoData() throws Exception {
      Video received = videoSvc.addVideo(video);
      VideoStatus status = videoSvc.setVideoData(received.getId(),
              new TypedFile(received.getContentType(), testVideoData));
      assertEquals(VideoState.READY, status.getState());
  
      Response response = videoSvc.getData(received.getId());
      assertEquals(200, response.getStatus());
  
      InputStream videoData = response.getBody().in();
      byte[] originalFile = IOUtils.toByteArray(new FileInputStream(testVideoData));
      byte[] retrievedFile = IOUtils.toByteArray(videoData);
      assertTrue(Arrays.equals(originalFile, retrievedFile));
  }
  </code></pre>
  
  <p>and this is the method I want to set the breakpoint:</p>
  
  <pre><code>@RequestMapping(value = "/video/{id}/data" , method = RequestMethod.POST)
  public @ResponseBody VideoStatus addVideoData(AtomicLong id, @RequestParam("data")
  MultipartFile videoData) {
  
      VideoStatus videoStatus= new VideoStatus(VideoState.PROCESSING);
  
  
      try {
          videoDataMgr = VideoFileManager.get();
          Video video = videos.get(id);
  
          if(!videoDataMgr.hasVideoData(video)) {
              InputStream in = videoData.getInputStream();
              videoDataMgr.saveVideoData(video, in);
          }
          videoStatus.setState(VideoState.READY);
  
  
      } catch (IOException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
      }
  
      // SAVE IT TO DISK
  
      return videoStatus;
  
  }
  </code></pre>