diff --git a/src/main/java/io/openliberty/tools/common/plugins/config/ApplicationMonitorConfigXmlDocument.java b/src/main/java/io/openliberty/tools/common/plugins/config/ApplicationMonitorConfigXmlDocument.java index b54aaa5d..3f45a0ed 100644 --- a/src/main/java/io/openliberty/tools/common/plugins/config/ApplicationMonitorConfigXmlDocument.java +++ b/src/main/java/io/openliberty/tools/common/plugins/config/ApplicationMonitorConfigXmlDocument.java @@ -38,20 +38,20 @@ public ApplicationMonitorConfigXmlDocument(String tool) { this.tool = tool; } - public void writeAppMonitorConfigXmlDocument(File serverDirectory, String applicationMonitorValue) throws IOException, TransformerException, ParserConfigurationException, PluginExecutionException { + public void writeAppMonitorConfigXmlDocument(File serverDirectory, String appMonitorTrigger) throws IOException, TransformerException, ParserConfigurationException, PluginExecutionException { File appMonXml = getAppMonitorConfigXmlFile(serverDirectory); // if applicationMonitor not set, return - if (applicationMonitorValue == null) { + if (appMonitorTrigger == null) { if (appMonXml.exists()) { appMonXml.delete(); } return; } // continue with creating configDropins/override file - if (!APP_MON_VALUE_LIST.contains(applicationMonitorValue)) { - throw new PluginExecutionException("applicationMonitor value \"" + applicationMonitorValue + "\" is not supported. Must be one of: " + APP_MON_VALUE_LIST); + if (!APP_MON_VALUE_LIST.contains(appMonitorTrigger)) { + throw new PluginExecutionException("The appMonitorTrigger value \"" + appMonitorTrigger + "\" is not supported. Please use one of: " + APP_MON_VALUE_LIST); } - attributes.put("updateTrigger", applicationMonitorValue); + attributes.put("updateTrigger", appMonitorTrigger); if (!appMonXml.getParentFile().exists()) { appMonXml.getParentFile().mkdirs(); diff --git a/src/test/java/io/openliberty/tools/common/plugins/config/ServerConfigXmlTest.java b/src/test/java/io/openliberty/tools/common/plugins/config/ServerConfigXmlTest.java index 0811a0d7..102f9f8a 100644 --- a/src/test/java/io/openliberty/tools/common/plugins/config/ServerConfigXmlTest.java +++ b/src/test/java/io/openliberty/tools/common/plugins/config/ServerConfigXmlTest.java @@ -31,8 +31,7 @@ public void createAppMonitorConfigWithInvalidValueTest() throws Exception { try { appMonXml.writeAppMonitorConfigXmlDocument(serverDirectory, "asdf"); } catch (Exception e) { - assertTrue(e.getMessage().contains("applicationMonitor value")); - assertTrue(e.getMessage().contains("is not supported")); + assertTrue(e.getMessage().contains("The appMonitorTrigger value \"asdf\" is not supported.")); } }