class ThreadsComponentFactory implements ComponentFactory {

	@Override
	public ProcessingItem createPi(Processor processor) {
		return this.createPi(processor, 1);
	}

}

class ThreadsComponentFactoryTest {

	@Tested private ThreadsComponentFactory factory;
	@Mocked private Processor processor;
	@Mocked private EntranceProcessor entranceProcessor;
	private final int parallelism;
	private final String topoName;

	@Test
	public void testCreatePiWithParallelism() {

		new NonStrictExpectations() {
			{
				processor.newProcessor(processor);
				result=processorReplica;
			}
		};
		ProcessingItem pi = factory.createPi(processor,parallelism);
		assertNotNull("ProcessingItem created is null.",pi);
		assertEquals("ProcessingItem created is not a ThreadsProcessingItem.",ThreadsProcessingItem.class,pi.getClass());
		assertEquals("Parallelism of PI is not ",parallelism,pi.getParallelism(),0);
	}

}