### Question:
SubmissionFormServiceImpl extends ServiceProxy implements SubmissionFormService { @Override public void deleteUserSubmissionMedia(String submissionMediaId) { UserSubmissionMedia existing = getPersistenceService().findById(UserSubmissionMedia.class, submissionMediaId); if (existing != null) { handleMediaDelete(existing); getPersistenceService().delete(existing); } } SubmissionFormServiceImpl();  SubmissionFormServiceImpl(PersistenceService persistenceService); void setMappingController(MappingController mappingController); @Override SubmissionFormTemplate saveSubmissionFormTemplate(SubmissionFormTemplate template); @Override void saveSubmissionTemplateAsDefault(SubmissionFormTemplate template); @Override void deleteSubmissionFormTemplate(String templateId); @Override ValidationResult validateTemplate(SubmissionFormTemplate template, String componentType); @Override List<UserSubmission> getUserSubmissions(String ownerUsername); @Override UserSubmission saveUserSubmission(UserSubmission userSubmission); @Override UserSubmissionMedia saveSubmissionFormMedia(String userSubmissionId, String templateFieldId, MediaFile mediaFile, InputStream in); @Override VerifySubmissionTemplateResult verifySubmission(UserSubmission userSubmission); @Override ValidationResult submitUserSubmissionForApproval(UserSubmission userSubmission); @Override UserSubmission editComponentForSubmission(String componentId, EditSubmissionOptions options); @Override UserSubmission componentToSubmission(String componentId); @Override ValidationResult submitChangeRequestForApproval(UserSubmission userSubmission); @Override void reassignUserSubmission(String userSubmissionId, String newOwnerUsername); @Override void deleteUserSubmission(String userSubmissionId); @Override void deleteUserSubmissionMedia(String submissionMediaId); @Override void toggleActiveStatus(String submissionTemplateId, String newStatus); @Override SubmissionFormTemplate findTemplateForComponentType(String componentType); @Override void saveUserSubmissionComment(UserSubmissionComment userSubmissionComment);  }### Answer:
@Test public void testDeleteUserSubmissionMedia() throws IOException { PersistenceService persistenceService = Mockito.mock(PersistenceService.class); UserSubmissionMedia media = new UserSubmissionMedia(); MediaFile mediaFile = new MediaFile(); mediaFile.setFileType(MediaFileType.MEDIA); mediaFile.setFileName("testmedia.txt"); media.setFile(mediaFile); Path path = mediaFile.path(); Files.createFile(path); Mockito.when(persistenceService.findById(UserSubmissionMedia.class, "1")).thenReturn(media); SubmissionFormServiceImpl instance = new SubmissionFormServiceImpl(persistenceService); instance.deleteUserSubmissionMedia("1"); path = mediaFile.path(); assertTrue("Media should be deleted", !path.toFile().exists()); }