### Question:
ProjectServiceImpl extends ServiceSupport implements ProjectService { public AbstractProject<?, ?> getProjectByFullName(final String projectName) { AbstractProject<?, ?> p = findProjectByFullName(projectName); if (p == null) { throw new ProjectNotFoundException(String.format("Project %s not found.", projectName)); } return p; } @Inject  ProjectServiceImpl(final SecurityService securityService); AbstractProject<?, ?> getProject(final UUID id); AbstractProject<?, ?> getProject(final String projectName); AbstractProject<?, ?> getProjectByFullName(final String projectName); AbstractProject<?, ?> findProject(final UUID id); AbstractProject<?, ?> findProject(final String projectName); AbstractProject<?, ?> findProjectByFullName(final String projectName); @SuppressWarnings("rawtypes") List<AbstractProject> getAllProjects(); T copyProject(final T src, final String targetProjectName); TopLevelItem createProjectFromXML(final String projectName, final InputStream xml); boolean projectExists(final String projectName); Collection<String> getProjectNames();  }### Answer:
@Test(expected = NullPointerException.class) public void getProjectByFullnameNullArg() { getInst().getProjectByFullName(null); }
@Test(expected = ProjectNotFoundException.class) public void getProjectByFullnameProjectNotFoundException() { getInst().getProjectByFullName("fullname"); }
@Test public void getProjectByFullnameSecurity() { doReturn(project).when(hudson).getItemByFullName("fullname", AbstractProject.class); AbstractProject<?, ?> result = getInst().getProjectByFullName("fullname"); assertThat(result, equalTo(project)); Mockito.verify(securityService).checkPermission(project, Item.READ); }