Repository: quarkusio/quarkus
Issue: Shutdown task failed: java.lang.IllegalArgumentException - quarkus-hibernate-orm and quarkus-smallrye-fault-tolerance enabled

I see `java.lang.IllegalArgumentException` thrown at the end of test phase when `quarkus-hibernate-orm` and `quarkus-smallrye-fault-tolerance` are enabled.

Stacktrace includes keywords like HystrixThreadEventStream and io.quarkus.smallrye.faulttolerance. This error message is present only if quarkus-hibernate-orm extension is used too. There is no exception when only quarkus-smallrye-fault-tolerance is enabled.

```
2019-06-04 15:53:16,096 ERROR [io.qua.run.StartupContext] (main) 
  Running a shutdown task failed: java.lang.IllegalArgumentException
```

```
mvn io.quarkus:quarkus-maven-plugin:999-SNAPSHOT:create \\
    -DprojectGroupId=io.quarkus.qe \\
    -DprojectArtifactId=scenario-101-getting-started \\
    -DprojectVersion=1.0.0-SNAPSHOT \\
    -DclassName="io.quarkus.qe.hello.GreetingResource" \\
    -Dextensions=io.quarkus:quarkus-hibernate-orm,io.quarkus:quarkus-smallrye-fault-tolerance
```
```
mvn clean package
...
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 3.884 s - in io.quarkus.qe.hello.GreetingResourceTest
2019-06-04 15:53:16,096 ERROR [io.qua.run.StartupContext] (main) Running a shutdown task failed: java.lang.IllegalArgumentException
	at io.quarkus.arc.ArcContainerImpl.unwrap(ArcContainerImpl.java:558)
	at io.quarkus.arc.ArcContainerImpl.instance(ArcContainerImpl.java:563)
	at io.quarkus.arc.InstanceImpl.resolve(InstanceImpl.java:163)
	at io.quarkus.arc.InstanceImpl.<init>(InstanceImpl.java:75)
	at io.quarkus.arc.InstanceImpl.<init>(InstanceImpl.java:61)
	at io.quarkus.arc.InstanceImpl.select(InstanceImpl.java:111)
	at io.quarkus.arc.ArcCDIProvider$ArcCDI.select(ArcCDIProvider.java:60)
	at io.smallrye.context.jta.context.propagation.JtaContextProvider.tm(JtaContextProvider.java:86)
	at io.smallrye.context.jta.context.propagation.JtaContextProvider.currentTransaction(JtaContextProvider.java:78)
	at io.smallrye.context.jta.context.propagation.JtaContextProvider.currentContext(JtaContextProvider.java:25)
	at io.smallrye.context.impl.CapturedContextState.<init>(CapturedContextState.java:21)
	at io.smallrye.context.SmallRyeContextManager.captureContext(SmallRyeContextManager.java:60)
	at io.smallrye.context.SmallRyeThreadContext.currentContextExecutor(SmallRyeThreadContext.java:208)
	at io.smallrye.context.propagators.rxjava1.ContextPropagatorOnObservableCreateAction.call(ContextPropagatorOnObservableCreateAction.java:24)
	at io.smallrye.context.propagators.rxjava1.ContextPropagatorOnObservableCreateAction.call(ContextPropagatorOnObservableCreateAction.java:12)
	at rx.plugins.RxJavaHooks.onCreate(RxJavaHooks.java:337)
	at rx.Observable.unsafeCreate(Observable.java:162)
	at rx.Observable.lift(Observable.java:299)
	at rx.Observable.onBackpressureBuffer(Observable.java:7883)
	at com.netflix.hystrix.metric.HystrixThreadEventStream.<init>(HystrixThreadEventStream.java:111)
	at com.netflix.hystrix.metric.HystrixThreadEventStream$1.initialValue(HystrixThreadEventStream.java:66)
	at com.netflix.hystrix.metric.HystrixThreadEventStream$1.initialValue(HystrixThreadEventStream.java:63)
	at java.lang.ThreadLocal.setInitialValue(ThreadLocal.java:180)
	at java.lang.ThreadLocal.get(ThreadLocal.java:170)
	at com.netflix.hystrix.metric.HystrixThreadEventStream.getInstance(HystrixThreadEventStream.java:128)
	at io.quarkus.smallrye.faulttolerance.runtime.SmallryeFaultToleranceTemplate$1.run(SmallryeFaultToleranceTemplate.java:25)
	at io.quarkus.runtime.StartupContext.close(StartupContext.java:59)
	at io.quarkus.runner.ApplicationImpl1.doStop(Unknown Source)
	at io.quarkus.runtime.Application.stop(Application.java:167)
	at io.quarkus.runner.RuntimeRunner$1.close(RuntimeRunner.java:138)
	at io.quarkus.runner.RuntimeRunner.close(RuntimeRunner.java:84)
	at io.quarkus.test.junit.QuarkusTestExtension$5.close(QuarkusTestExtension.java:241)
	at io.quarkus.test.junit.QuarkusTestExtension$ExtensionState.close(QuarkusTestExtension.java:354)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.jupiter.engine.execution.ExtensionValuesStore.closeAllStoredCloseableValues(ExtensionValuesStore.java:61)
	at org.junit.jupiter.engine.descriptor.AbstractExtensionContext.close(AbstractExtensionContext.java:73)
	at org.junit.jupiter.engine.execution.JupiterEngineExecutionContext.close(JupiterEngineExecutionContext.java:53)
	at org.junit.jupiter.engine.descriptor.JupiterEngineDescriptor.cleanUp(JupiterEngineDescriptor.java:67)
	at org.junit.jupiter.engine.descriptor.JupiterEngineDescriptor.cleanUp(JupiterEngineDescriptor.java:30)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$cleanUp$9(NodeTestTask.java:151)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.cleanUp(NodeTestTask.java:151)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:83)
	at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:32)
	at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57)
	at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:51)
	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:170)
	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:154)
	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:90)
	at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invokeAllTests(JUnitPlatformProvider.java:142)
	at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invoke(JUnitPlatformProvider.java:117)
	at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:383)
	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:344)
	at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:125)
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:417)
```

Changed files:
independent-projects/arc/runtime/src/main/java/io/quarkus/arc/ArcCDIProvider.java

diff --git a/independent-projects/arc/runtime/src/main/java/io/quarkus/arc/ArcCDIProvider.java b/independent-projects/arc/runtime/src/main/java/io/quarkus/arc/ArcCDIProvider.java
index 2b85487c527..166d5550fcf 100644
--- a/independent-projects/arc/runtime/src/main/java/io/quarkus/arc/ArcCDIProvider.java
+++ b/independent-projects/arc/runtime/src/main/java/io/quarkus/arc/ArcCDIProvider.java
@@ -37,6 +37,9 @@ public ArcCDIProvider() {
 
     @Override
     public CDI<Object> getCDI() {
+        if (Arc.container() == null) {
+            throw new IllegalStateException("No CDI container is available");
+        }
         return arcCDI;
     }