@@ -0,0 +1,1997 @@
+%0Apackage org.bonej.wrapperPlugins;%0A%0Aimport static org.bonej.ops.SolveQuadricEq.QUADRIC_TERMS;%0Aimport static org.junit.Assert.assertTrue;%0Aimport static org.mockito.ArgumentMatchers.any;%0Aimport static org.mockito.ArgumentMatchers.anyString;%0Aimport static org.mockito.Mockito.timeout;%0Aimport static org.mockito.Mockito.verify;%0A%0Aimport net.imagej.ImageJ;%0A%0Aimport org.junit.AfterClass;%0Aimport org.junit.Test;%0Aimport org.scijava.command.CommandModule;%0Aimport org.scijava.ui.UserInterface;%0A%0Aimport ij.ImagePlus;%0Aimport ij.gui.NewImage;%0A%0A/**%0A * Tests for %7B@link FitEllipsoidWrapper%7D.%0A *%0A * @author Richard Domander%0A */%0A%0Apublic class FitEllipsoidWrapperTest %7B%0A%0A%09private static final ImageJ IMAGE_J = new ImageJ();%0A%0A%09@AfterClass%0A%09public static void oneTimeTearDown() %7B%0A%09%09IMAGE_J.context().dispose();%0A%09%7D%0A%0A%09@Test%0A%09public void testNullImageCancelsPlugin() throws Exception %7B%0A%09%09CommonWrapperTests.testNullImageCancelsPlugin(IMAGE_J,%0A%09%09%09FitEllipsoidWrapper.class);%0A%09%7D%0A%0A%09@Test%0A%09public void test2DImageCancelsPlugin() throws Exception %7B%0A%09%09CommonWrapperTests.test2DImagePlusCancelsPlugin(IMAGE_J,%0A%09%09%09FitEllipsoidWrapper.class);%0A%09%7D%0A%0A%09@Test%0A%09public void testAnisotropicImageShowsWarningDialog() throws Exception %7B%0A%09%09CommonWrapperTests.testAnisotropyWarning(IMAGE_J,%0A%09%09%09FitEllipsoidWrapper.class);%0A%09%7D%0A%0A%09@Test%0A%09public void testNullROIManagerCancelsPlugin() throws Exception %7B%0A%09%09// SETUP%0A%09%09final UserInterface mockUI = CommonWrapperTests.mockUIService(IMAGE_J);%0A%09%09final ImagePlus imagePlus = NewImage.createImage(%22%22, 5, 5, 5, 8, 1);%0A%0A%09%09// EXECUTE%0A%09%09final CommandModule module = IMAGE_J.command().run(%0A%09%09%09FitEllipsoidWrapper.class, true, %22inputImage%22, imagePlus).get();%0A%0A%09%09// VERIFY%0A%09%09assertTrue(%22No ROI Manager should have cancelled the plugin%22, module%0A%09%09%09.isCanceled());%0A%09%09assertTrue(%22Cancel reason is incorrect%22, module.getCancelReason()%0A%09%09%09.startsWith(%22Please populate ROI Manager with at least %22 +%0A%09%09%09%09QUADRIC_TERMS));%0A%09%09verify(mockUI, timeout(1000)).dialogPrompt(anyString(), anyString(), any(),%0A%09%09%09any());%0A    %7D%0A%7D%0A

Add command tests