@Test public void testExecuteThenOK() { HelloWorldPlugin helloWorldPlugin = new HelloWorldPlugin(); WorkerParameters parameters = WorkerParametersFactory.newWorkerParameters(); HandlerIO handlerIO = mock(HandlerIO.class); doReturn("HelloWorldPluginTest").when(handlerIO).getInput(0); ItemStatus itemStatus = helloWorldPlugin.execute(parameters, handlerIO); assertTrue(itemStatus != null); assertTrue(itemStatus.getEvDetailData().contains("var_name")); assertTrue(itemStatus.getEvDetailData().contains("HelloWorldPluginTest")); }
public ItemStatus execute(WorkerParameters workerParameters, HandlerIO handlerIO) { LOGGER.warn("==========================================================="); LOGGER.warn("================= HELLO_WORLD_PLUGIN ........ =========== "); LOGGER.warn("==========================================================="); ObjectNode infoNode = JsonHandler.createObjectNode(); infoNode.put("var_name", (String) handlerIO.getInput(0)); ItemStatus itemStatus = new ItemStatus(HELLO_WORLD_PLUGIN); String unpretty = JsonHandler.unprettyPrint(infoNode); itemStatus.setEvDetailData(unpretty); itemStatus.setMasterData(LogbookParameterName.eventDetailData.name(), unpretty); return new ItemStatus(HELLO_WORLD_PLUGIN).setItemsStatus(HELLO_WORLD_PLUGIN, itemStatus.increment(StatusCode.OK)); }
HelloWorldPlugin extends ActionHandler { public ItemStatus execute(WorkerParameters workerParameters, HandlerIO handlerIO) { LOGGER.warn("==========================================================="); LOGGER.warn("================= HELLO_WORLD_PLUGIN ........ =========== "); LOGGER.warn("==========================================================="); ObjectNode infoNode = JsonHandler.createObjectNode(); infoNode.put("var_name", (String) handlerIO.getInput(0)); ItemStatus itemStatus = new ItemStatus(HELLO_WORLD_PLUGIN); String unpretty = JsonHandler.unprettyPrint(infoNode); itemStatus.setEvDetailData(unpretty); itemStatus.setMasterData(LogbookParameterName.eventDetailData.name(), unpretty); return new ItemStatus(HELLO_WORLD_PLUGIN).setItemsStatus(HELLO_WORLD_PLUGIN, itemStatus.increment(StatusCode.OK)); } }
HelloWorldPlugin extends ActionHandler { public ItemStatus execute(WorkerParameters workerParameters, HandlerIO handlerIO) { LOGGER.warn("==========================================================="); LOGGER.warn("================= HELLO_WORLD_PLUGIN ........ =========== "); LOGGER.warn("==========================================================="); ObjectNode infoNode = JsonHandler.createObjectNode(); infoNode.put("var_name", (String) handlerIO.getInput(0)); ItemStatus itemStatus = new ItemStatus(HELLO_WORLD_PLUGIN); String unpretty = JsonHandler.unprettyPrint(infoNode); itemStatus.setEvDetailData(unpretty); itemStatus.setMasterData(LogbookParameterName.eventDetailData.name(), unpretty); return new ItemStatus(HELLO_WORLD_PLUGIN).setItemsStatus(HELLO_WORLD_PLUGIN, itemStatus.increment(StatusCode.OK)); }  }
HelloWorldPlugin extends ActionHandler { public ItemStatus execute(WorkerParameters workerParameters, HandlerIO handlerIO) { LOGGER.warn("==========================================================="); LOGGER.warn("================= HELLO_WORLD_PLUGIN ........ =========== "); LOGGER.warn("==========================================================="); ObjectNode infoNode = JsonHandler.createObjectNode(); infoNode.put("var_name", (String) handlerIO.getInput(0)); ItemStatus itemStatus = new ItemStatus(HELLO_WORLD_PLUGIN); String unpretty = JsonHandler.unprettyPrint(infoNode); itemStatus.setEvDetailData(unpretty); itemStatus.setMasterData(LogbookParameterName.eventDetailData.name(), unpretty); return new ItemStatus(HELLO_WORLD_PLUGIN).setItemsStatus(HELLO_WORLD_PLUGIN, itemStatus.increment(StatusCode.OK)); }  ItemStatus execute(WorkerParameters workerParameters, HandlerIO handlerIO); }
HelloWorldPlugin extends ActionHandler { public ItemStatus execute(WorkerParameters workerParameters, HandlerIO handlerIO) { LOGGER.warn("==========================================================="); LOGGER.warn("================= HELLO_WORLD_PLUGIN ........ =========== "); LOGGER.warn("==========================================================="); ObjectNode infoNode = JsonHandler.createObjectNode(); infoNode.put("var_name", (String) handlerIO.getInput(0)); ItemStatus itemStatus = new ItemStatus(HELLO_WORLD_PLUGIN); String unpretty = JsonHandler.unprettyPrint(infoNode); itemStatus.setEvDetailData(unpretty); itemStatus.setMasterData(LogbookParameterName.eventDetailData.name(), unpretty); return new ItemStatus(HELLO_WORLD_PLUGIN).setItemsStatus(HELLO_WORLD_PLUGIN, itemStatus.increment(StatusCode.OK)); }  ItemStatus execute(WorkerParameters workerParameters, HandlerIO handlerIO);  }