IntentQoSConfigAddShellCommand extends OsgiCommandSupport { @Override protected Object doExecute() throws Exception { UUID uuid = UUID.randomUUID(); List<QosConfig> intentQosConfig = createQosConfig(); Intent intent = new IntentBuilder() .setId(new Uuid(uuid.toString())) .setQosConfig(intentQosConfig) .build(); if (provider.addIntent(intent)) { return String.format("QoS profile is configured (id: %s)", uuid.toString()); } else { return "Error creating new QoS Configuration."; } } IntentQoSConfigAddShellCommand(NicConsoleProvider provider);   }
@Test public final void testDoExecute() throws Exception { Object feedBack = qosConfigAddShellCmd.doExecute(); assertNotNull(feedBack); assertEquals("As we test a mocked object the feedback should be error message","Error creating new QoS Configuration.", feedBack); }