ProductionServiceImpl extends Observable implements ProductionService { @Override public ProductionResponse orderProduction(ProductionRequest productionRequest) throws ProductionException { return orderProduction(productionRequest, null); } ProductionServiceImpl(FileSystemService fileSystemService,
                                 ProcessingService processingService,
                                 StagingService stagingService,
                                 ProductionStore productionStore,
                                 ProductionType... productionTypes); @Override ProcessingService getProcessingService(); @Override BundleDescriptor[] getBundles(String username, BundleFilter filter); @Override MaskDescriptor[] getMasks(String userName); @Override synchronized Production[] getProductions(String filter); @Override Production getProduction(String id); @Override ProductionResponse orderProduction(ProductionRequest productionRequest); @Override ProductionResponse orderProduction(ProductionRequest productionRequest, HadoopJobHook jobHook); @Override synchronized void stageProductions(String... productionIds); @Override synchronized void scpProduction(final String productionId, final String scpPath); @Override void cancelProductions(String... productionIds); @Override void deleteProductions(String... productionIds); @Override synchronized void updateStatuses(String username); @Override void close(); @Override synchronized void setChanged(); @Override String[][] loadRegionDataInfo(String username, String url); @Override void invalidateBundleCache();  }
@Test public void testOrderProduction() throws ProductionException { ProductionRequest request = new ProductionRequest("test", "ewa"); ProductionResponse productionResponse = productionServiceUnderTest.orderProduction(request); assertNotNull(productionResponse); assertNotNull(productionResponse.getProduction()); assertEquals("id_1", productionResponse.getProduction().getId()); assertEquals("name_1", productionResponse.getProduction().getName()); assertNotNull(productionResponse.getProduction().getJobIds()); assertEquals(2, productionResponse.getProduction().getJobIds().length); assertEquals("job_1_1", productionResponse.getProduction().getJobIds()[0]); assertEquals("job_1_2", productionResponse.getProduction().getJobIds()[1]); assertNotNull(productionResponse.getProduction().getProductionRequest()); assertEquals(request, productionResponse.getProduction().getProductionRequest()); assertEquals("stagingPath_1", productionResponse.getProduction().getStagingPath()); }
@Test public void testOrderUnknownProductionType() { try { productionServiceUnderTest.orderProduction(new ProductionRequest("erase-hdfs", "devil")); fail("ProductionException expected, since 'erase-hdfs' is not a valid production type"); } catch (ProductionException e) { } }