ContentGeneratorFactory { public static ContentGenerator create(ProjectInformation projectInformation) { PackagingType packaging = PackagingType.fromString(projectInformation.getPackaging()); return packaging == PackagingType.MULE_DOMAIN_BUNDLE ? new DomainBundleContentGenerator(projectInformation) : new MuleContentGenerator(projectInformation); }  static ContentGenerator create(ProjectInformation projectInformation);  }
@Test public void createDomainBundleContentGeneratorTest() { when(defaultProjectInformation.getPackaging()).thenReturn(PackagingType.MULE_DOMAIN_BUNDLE.toString()); ContentGenerator actualGenerator = ContentGeneratorFactory.create(defaultProjectInformation); assertThat("Content generator type is not the expected", actualGenerator, instanceOf(DomainBundleContentGenerator.class)); }
@Test public void createMuleContentGeneratorFromMuleApplicationPackagingTypeTest() { when(defaultProjectInformation.getPackaging()).thenReturn(PackagingType.MULE_APPLICATION.toString()); ContentGenerator actualGenerator = ContentGeneratorFactory.create(defaultProjectInformation); assertThat("Content generator type is not the expected", actualGenerator, instanceOf(MuleContentGenerator.class)); }
@Test public void createMuleContentGeneratorFromMuleDomainPackagingTypeTest() { when(defaultProjectInformation.getPackaging()).thenReturn(PackagingType.MULE_DOMAIN.toString()); ContentGenerator actualGenerator = ContentGeneratorFactory.create(defaultProjectInformation); assertThat("Content generator type is not the expected", actualGenerator, instanceOf(MuleContentGenerator.class)); }
@Test public void createMuleContentGeneratorFromMulePolicyPackagingTypeTest() { when(defaultProjectInformation.getPackaging()).thenReturn(PackagingType.MULE_POLICY.toString()); ContentGenerator actualGenerator = ContentGeneratorFactory.create(defaultProjectInformation); assertThat("Content generator type is not the expected", actualGenerator, instanceOf(MuleContentGenerator.class)); }