use of org.ligoj.app.resource.ServicePluginLocator in project plugin-prov by ligoj.
the class TerraformResourceTest method applyTerraformError.
/**
* IOException during the asynchronous execution
*/
@Test
public void applyTerraformError() {
final TerraformResource resource = new TerraformResource() {
@Override
protected File applyTerraform(final Subscription entity, final Terraforming terra, final QuoteVo configuration) throws IOException {
throw new IOException();
}
};
super.applicationContext.getAutowireCapableBeanFactory().autowireBean(resource);
// Mock to disable inner transactions for this test
resource.resource = Mockito.mock(ProvResource.class);
final ServicePluginLocator locator = Mockito.mock(ServicePluginLocator.class);
// Replace the plugin locator
resource.locator = locator;
Mockito.when(locator.getResource("service:prov:test:account", Terraforming.class)).thenReturn(Mockito.mock(Terraforming.class));
resource.applyTerraform(subscription);
}
Aggregations