TaskExecutorFactory { public static TaskExecutor create(TaskDefinition task) { switch (task.getType()) { case EXEC: return new ExecTaskExecutor(); case FETCH_MATERIAL: return FetchMaterialExecutorFactory.create(task); case FETCH_ARTIFACT: return new FetchArtifactExecutor(); case UPLOAD_ARTIFACT: return new UploadArtifactExecutor(); default: return null; } }  static TaskExecutor create(TaskDefinition task);  }
@Test public void testBuild() throws Exception { this.task = new ExecTask(); TaskExecutor actual = this.factory.create(this.task); TaskExecutor expected = new ExecTaskExecutor(); Assert.assertEquals(expected.getClass(), actual.getClass()); }