ProjectManager { public Map<String, ValidationReport> uploadProject(final Project project, final File archive, final String fileType, final User uploader, final Props additionalProps, final String uploaderIPAddr) throws ProjectManagerException, ExecutorManagerException { return this.azkabanProjectLoader .uploadProject(project, archive, fileType, uploader, additionalProps, uploaderIPAddr); } @Inject  ProjectManager(final AzkabanProjectLoader azkabanProjectLoader,
      final ProjectLoader loader,
      final ProjectStorageManager projectStorageManager,
      final Props props, final ProjectCache cache); boolean hasFlowTrigger(final Project project, final Flow flow); Props getProps(); List<Project> getUserProjects(final User user); List<Project> getGroupProjects(final User user); List<Project> getUserProjectsByRegex(final User user, final String regexPattern); List<Project> getProjects(); List<Project> getProjectsByRegex(final String regexPattern); Boolean isActiveProject(final int id); Project getProject(final String name); Project getProject(final int id); Project createProject(final String projectName, final String description,
      final User creator); synchronized Project purgeProject(final Project project, final User deleter); synchronized Project removeProject(final Project project, final User deleter); void updateProjectDescription(final Project project, final String description,
      final User modifier); List<ProjectLogEvent> getProjectEventLogs(final Project project,
      final int results, final int skip); Props getPropertiesFromFlowFile(final Flow flow, final String jobName, final String
      flowFileName, final int flowVersion); Props getProperties(final Project project, final Flow flow, final String jobName,
      final String source); Props getJobOverrideProperty(final Project project, final Flow flow, final String jobName,
      final String source); void setJobOverrideProperty(final Project project, final Flow flow, final Props prop,
      final String jobName, final String source, final User modifier); void updateProjectSetting(final Project project); void addProjectProxyUser(final Project project, final String proxyName,
      final User modifier); void removeProjectProxyUser(final Project project, final String proxyName,
      final User modifier); void updateProjectPermission(final Project project, final String name,
      final Permission perm, final boolean group, final User modifier); void removeProjectPermission(final Project project, final String name,
      final boolean group, final User modifier); ProjectFileHandler getProjectFileHandler(final Project project, final int version); Map<String, ValidationReport> uploadProject(final Project project,
      final File archive, final String fileType, final User uploader, final Props additionalProps,
      final String uploaderIPAddr); void updateFlow(final Project project, final Flow flow); void postProjectEvent(final Project project, final EventType type, final String user,
      final String message); boolean loadProjectWhiteList(); void setProjectEventStatus(final String errorMessage, final Map<String, Object> eventData); void postScheduleEvent(final Project project, final azkaban.spi.EventType type, final User user, final Schedule schedule, final String errorMessage);  }
@Test public void testUploadEvent() throws Exception { final URL resource = requireNonNull(getClass().getClassLoader().getResource("sample_flow_01.zip")); final File projectZipFile = new File(resource.getPath()); final User uploader = new User("testUser1"); this.project.setVersion(this.VERSION); project.addListener((event) -> { ProjectEvent projectEvent = (ProjectEvent) event; Assert.assertEquals("Event metadata not created as expected.", "testUser1", projectEvent.getEventData().get("modifiedBy")); Assert.assertEquals("Event metadata not created as expected.", IPv4, projectEvent.getEventData().get("uploaderIPAddress")); Assert.assertTrue("Event metadata not created as expected.", (long)projectEvent.getEventData().get("projectUploadTime") >= 0); Assert.assertTrue("Event metadata not created as expected.", (long)projectEvent.getEventData().get("projectZipSize") >= 0); Assert.assertEquals("Event metadata not created as expected.", "FAT_ZIP", projectEvent.getEventData().get("zipType")); Assert.assertEquals("Event metadata not created as expected.", "ERROR", projectEvent.getEventData().get("projectEventStatus")); Assert.assertEquals("Event metadata not created as expected.", "java.lang.NullPointerException", projectEvent.getEventData().get("errorMessage")); }); assertThatThrownBy( () -> this.azkabanProjectLoader.uploadProject(this.project, projectZipFile, "zip", uploader, this.props, IPv4)) .isInstanceOf(NullPointerException.class); }