mirror of
https://github.com/Kingsrook/qqq.git
synced 2025-07-18 05:01:07 +00:00
Restore QJavalinImplementation to original state after testHotSwap
This commit is contained in:
@ -31,6 +31,7 @@ import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.function.Function;
|
||||
import com.kingsrook.qqq.backend.core.exceptions.QInstanceValidationException;
|
||||
import com.kingsrook.qqq.backend.core.model.actions.reporting.ReportFormat;
|
||||
import com.kingsrook.qqq.backend.core.model.dashboard.widgets.WidgetType;
|
||||
import com.kingsrook.qqq.backend.core.model.metadata.QBackendMetaData;
|
||||
@ -874,7 +875,9 @@ class QJavalinImplementationTest extends QJavalinTestBase
|
||||
**
|
||||
*******************************************************************************/
|
||||
@Test
|
||||
void testHotSwap()
|
||||
void testHotSwap() throws QInstanceValidationException
|
||||
{
|
||||
try
|
||||
{
|
||||
Function<String, QInstance> makeNewInstanceWithBackendName = (backendName) ->
|
||||
{
|
||||
@ -955,5 +958,15 @@ class QJavalinImplementationTest extends QJavalinTestBase
|
||||
QJavalinImplementation.hotSwapQInstance(null);
|
||||
assertNotNull(QJavalinImplementation.qInstance.getBackend("newerBackend"));
|
||||
}
|
||||
finally
|
||||
{
|
||||
////////////////////////////////////////////////////////////
|
||||
// restore things to how they used to be, for other tests //
|
||||
////////////////////////////////////////////////////////////
|
||||
QInstance qInstance = TestUtils.defineInstance();
|
||||
QJavalinImplementation.setQInstanceHotSwapSupplier(null);
|
||||
restartServerWithInstance(qInstance);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user