ButterflyFacadeImpl implements ButterflyFacade { @Override public CompletableFuture<TransformationResult> transform(File applicationFolder, Class<? extends TransformationTemplate> templateClass) { return transform(applicationFolder, templateClass, null, new ConfigurationImpl(null)); }  @Override String getButterflyVersion(); @Override List<Extension> getExtensions(); @Override Optional<Class<? extends TransformationTemplate>> automaticResolution(File applicationFolder); @Override Configuration newConfiguration(Properties properties); @Override Configuration newConfiguration(Properties properties, boolean zipOutput); @Override Configuration newConfiguration(Properties properties, File outputFolder, boolean zipOutput); @Override CompletableFuture<TransformationResult> transform(File applicationFolder, Class<? extends TransformationTemplate> templateClass); @Override CompletableFuture<TransformationResult> transform(File applicationFolder, Class<? extends TransformationTemplate> templateClass, String version, Configuration configuration);  }
@Test public void testTransformWithValidTemplate() { butterflyFacadeImpl.transform(applicationFolder, JavaEEToSpringBoot.class); verify(transformationEngine, times(1)).perform((TemplateTransformationRequest) anyObject()); }
@Test(expectedExceptions = InternalException.class, expectedExceptionsMessageRegExp = "Template class class com.paypal.butterfly.extensions.api.TransformationTemplate could not be instantiated.*") public void testTransformWithAbstractTemplate() { butterflyFacadeImpl.transform(applicationFolder, TransformationTemplate.class); }
@Test public void testTransformWithValidTemplateAsClass() { butterflyFacadeImpl.transform(applicationFolder, JavaEEToSpringBoot.class); verify(transformationEngine, times(1)).perform((TemplateTransformationRequest) anyObject()); }
@Test(expectedExceptions = IllegalArgumentException.class, expectedExceptionsMessageRegExp = "Template class cannot be null") public void testTransformWithNullTemplateClass() { butterflyFacadeImpl.transform(applicationFolder, null); }
@Test(expectedExceptions = IllegalArgumentException.class, expectedExceptionsMessageRegExp = "Invalid application folder testTransformation1") public void testTransformWithValidUpgradePathInvalidAppFolder() { butterflyFacadeImpl.transform(new File("testTransformation1"), SpringBootUpgrade_1_5_6_to_1_5_7.class); }
@Test public void testTransformWithValidUpgradePath() { butterflyFacadeImpl.transform(applicationFolder, SpringBootUpgrade_1_5_6_to_1_5_7.class); verify(transformationEngine, times(1)).perform((UpgradePathTransformationRequest) anyObject()); }