ProductionServiceImpl extends Observable implements ProductionService { @Override public synchronized Production[] getProductions(String filter) throws ProductionException { return productionStore.getProductions(); } 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 testGetProductions() throws ProductionException { productionServiceUnderTest.orderProduction(new ProductionRequest("test", "ewa")); productionServiceUnderTest.orderProduction(new ProductionRequest("test", "ewa")); productionServiceUnderTest.orderProduction(new ProductionRequest("test", "ewa")); Production[] productions = productionServiceUnderTest.getProductions(null); assertNotNull(productions); assertEquals(3, productions.length); assertEquals("id_1", productions[0].getId()); assertEquals("id_2", productions[1].getId()); assertEquals("id_3", productions[2].getId()); assertSame(productions[0], productionStoreMock.getProduction("id_1")); assertSame(productions[1], productionStoreMock.getProduction("id_2")); assertSame(productions[2], productionStoreMock.getProduction("id_3")); assertNull(productionStoreMock.getProduction("id_x")); }