IntentCompileShellCommand extends OsgiCommandSupport { @Override protected Object doExecute() throws Exception { if (isGraph) { return provider.compile(1); } else { return provider.compile(); } } IntentCompileShellCommand(NicConsoleProvider provider);   }
@Test public final void testDoExecute() throws Exception { expected.append(">>> Original policies:\n"); expected.append("from [10.1.1.1] to [10.1.1.2] apply [ALLOW]\n"); expected.append('\n'); expected.append(">>> Compiled policies:\n"); expected.append("from [10.1.1.1] to [10.1.1.2] apply [ALLOW]\n"); final String result = expected.toString(); when(nicConsole.compile()).thenReturn(result); intentCompileShellCmd = new IntentCompileShellCommand(nicConsole); Object output = intentCompileShellCmd.doExecute(); assertTrue(output instanceof Object); assertEquals(expected.toString(), output); }