agave-jobs/jobs-core/src/test/java/org/iplantc/service/jobs/managers/JobRequestProcessorIT.java
/**
	 * Creates a new {@link Software} resource and assigns the {@code executionSystem} and
	 * {@code storageSystem} to it. The {@link ExecutionSystem#getDefaultQueue()} will be set
	 * as the {@code Software#defaultQueue}.
	 * <strong><em>The returned instance will NOT be persisted. You must do this manually or
	 * use the {@link #createSoftware(ExecutionSystem, StorageSystem)} method.</em></strong>
	 * @param executionSystem the system on which the app should run
	 * @param deploymentSystem the system containing the remote asset deployment path
	 * @return a new {@link Software} instance
	 * @throws Exception if deserialization issues occur
	 * @see #createSoftware(ExecutionSystem, StorageSystem)
	 */
Creates a new  Software resource and assigns the  executionSystem and
storageSystem to it. The  ExecutionSystem#getDefaultQueue() will be set
as the  Software#defaultQueue.
The returned instance will NOT be persisted.
Creates a new Software resource and assigns the executionSystem and storageSystem to it . The ExecutionSystem#getDefaultQueue () will be set as the Software#defaultQueue . The returned instance will NOT be persisted .
protected Software createMockSoftware(ExecutionSystem executionSystem, StorageSystem deploymentSystem)
	{
		Software software = null;
		try {
			mockStatic(Software.class);
			SystemDao systemDao = mock(SystemDao.class);
			when(systemDao.findBySystemId(eq(deploymentSystem.getSystemId()))).thenReturn(deploymentSystem);
			when(systemDao.findBySystemId(eq(executionSystem.getSystemId()))).thenReturn(executionSystem);
			SystemManager systemManager = mock(SystemManager.class);
			when(systemManager.getUserDefaultStorageSystem(eq(TEST_OWNER))).thenReturn(deploymentSystem);
			when(systemManager.getDao()).thenReturn(systemDao);
			PowerMockito.when(Software.getSystemManager()).thenReturn(systemManager);
			PowerMockito.when(Software.fromJSON(any(), any())).thenCallRealMethod();
			JSONObject jsonSoftware = getDefaultSoftwareJson();
			jsonSoftware.put("executionSystem", executionSystem.getSystemId());
			jsonSoftware.put("deploymentSystem", deploymentSystem.getSystemId());
			BatchQueue queue = executionSystem.getDefaultQueue();
			jsonSoftware.put("defaultQueue", queue.getName());
			jsonSoftware.put("owner", executionSystem.getOwner());
			software = Software.fromJSON(jsonSoftware, SYSTEM_OWNER);
			software.setOwner(SYSTEM_OWNER);
		} catch (JSONException e) {
			Assert.fail("Failed to parse software template file: " + FORK_SOFTWARE_TEMPLATE_FILE, e);
		}
		return software;
	}
protected Software createMockSoftware ( ExecutionSystem executionSystem , StorageSystem deploymentSystem ) { Software software = null ; try { mockStatic ( Software . class ) ; SystemDao systemDao = mock ( SystemDao . class ) ; when ( systemDao . findBySystemId ( eq ( deploymentSystem . getSystemId ( ) ) ) ) . thenReturn ( deploymentSystem ) ; when ( systemDao . findBySystemId ( eq ( executionSystem . getSystemId ( ) ) ) ) . thenReturn ( executionSystem ) ; SystemManager systemManager = mock ( SystemManager . class ) ; when ( systemManager . getUserDefaultStorageSystem ( eq ( TEST_OWNER ) ) ) . thenReturn ( deploymentSystem ) ; when ( systemManager . getDao ( ) ) . thenReturn ( systemDao ) ; PowerMockito . when ( Software . getSystemManager ( ) ) . thenReturn ( systemManager ) ; PowerMockito . when ( Software . fromJSON ( any ( ) , any ( ) ) ) . thenCallRealMethod ( ) ; JSONObject jsonSoftware = getDefaultSoftwareJson ( ) ; jsonSoftware . put ( "executionSystem" , executionSystem . getSystemId ( ) ) ; jsonSoftware . put ( "deploymentSystem" , deploymentSystem . getSystemId ( ) ) ; BatchQueue queue = executionSystem . getDefaultQueue ( ) ; jsonSoftware . put ( "defaultQueue" , queue . getName ( ) ) ; jsonSoftware . put ( "owner" , executionSystem . getOwner ( ) ) ; software = Software . fromJSON ( jsonSoftware , SYSTEM_OWNER ) ; software . setOwner ( SYSTEM_OWNER ) ; } catch ( JSONException e ) { Assert . fail ( "Failed to parse software template file: " + FORK_SOFTWARE_TEMPLATE_FILE , e ) ; } return software ; }
Creates a new {@link Software} resource and assigns the {@code executionSystem} and
 {@code storageSystem} to it.
Creates a new { @link Software } resource and assigns the { @code executionSystem } and { @code storageSystem } to it .
//			when(JobManager.updateStatus(job, JobStatusType.STAGED)).thenReturn(job); //			StorageSystem storageSystem = createMockStorageSystem(); //			ExecutionSystem executionSystem = createMockExecutionSystem(); //