@Test public void testGetDownloadProgressShouldReturnConflictWhenDownloadNotStarted() throws Exception { doThrow(new DownloadNotStartedException()).when(mockFacade).getDownloadProgress(); Response result = service.getDownloadProgress("id"); assertEquals(result.getStatus(), Response.Status.CONFLICT.getStatusCode()); }
@Test public void testGetDownloadProgress() throws Exception { DownloadProgressResponse progressDescriptor = new DownloadProgressResponse(); doReturn(progressDescriptor).when(mockFacade).getDownloadProgress(); Response result = service.getDownloadProgress("id"); assertEquals(result.getStatus(), Response.Status.OK.getStatusCode()); assertEquals(result.getEntity(), progressDescriptor); }