From 051e24d702a21496d32424026ca911589b72dc65 Mon Sep 17 00:00:00 2001 From: Timon Borter Date: Tue, 24 Mar 2026 15:55:48 +0100 Subject: [PATCH 1/9] chore: replace calls for System.lineSeparator() --- .../config/xml/ReceiveMessageActionParserTest.java | 4 ++-- .../config/xml/SendMessageActionParserTest.java | 4 ++-- .../java/org/citrusframework/http/message/HttpMessage.java | 2 +- .../citrusframework/mail/message/MailMessageConverter.java | 2 +- .../ws/message/callback/SoapResponseMessageCallbackTest.java | 2 +- .../ws/message/converter/SoapMessageConverterTest.java | 2 +- .../integration/script/GroovyActionJavaIT.java | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/core/citrus-spring/src/test/java/org/citrusframework/config/xml/ReceiveMessageActionParserTest.java b/core/citrus-spring/src/test/java/org/citrusframework/config/xml/ReceiveMessageActionParserTest.java index 5f42e17980..520e4ceeff 100644 --- a/core/citrus-spring/src/test/java/org/citrusframework/config/xml/ReceiveMessageActionParserTest.java +++ b/core/citrus-spring/src/test/java/org/citrusframework/config/xml/ReceiveMessageActionParserTest.java @@ -88,11 +88,11 @@ public void testReceiveMessageActionParser() throws IOException { assertTrue(action.getMessageBuilder() instanceof DefaultMessageBuilder); messageBuilder = (DefaultMessageBuilder)action.getMessageBuilder(); - assertEquals(messageBuilder.buildMessagePayload(context, action.getMessageType()), ""+System.getProperty("line.separator")+"Hello Citrus"); + assertEquals(messageBuilder.buildMessagePayload(context, action.getMessageType()), ""+System.lineSeparator()+"Hello Citrus"); assertEquals(messageBuilder.buildMessageHeaders(context).size(), 1); assertEquals(messageBuilder.buildMessageHeaders(context).get("operation"), "Test"); assertEquals(messageBuilder.buildMessageHeaderData(context).size(), 1); - assertEquals(messageBuilder.buildMessageHeaderData(context).get(0).trim(), ""+System.getProperty("line.separator")+"
"+System.getProperty("line.separator")+" hello"+System.getProperty("line.separator")+"
"); + assertEquals(messageBuilder.buildMessageHeaderData(context).get(0).trim(), ""+System.lineSeparator()+"
"+System.lineSeparator()+" hello"+System.lineSeparator()+"
"); assertEquals(action.getMessageProcessors().size(), 0); assertEquals(action.getControlMessageProcessors().size(), 0); diff --git a/core/citrus-spring/src/test/java/org/citrusframework/config/xml/SendMessageActionParserTest.java b/core/citrus-spring/src/test/java/org/citrusframework/config/xml/SendMessageActionParserTest.java index e0ea8026e8..b2a2416ace 100644 --- a/core/citrus-spring/src/test/java/org/citrusframework/config/xml/SendMessageActionParserTest.java +++ b/core/citrus-spring/src/test/java/org/citrusframework/config/xml/SendMessageActionParserTest.java @@ -54,11 +54,11 @@ public void testSendMessageActionParser() throws IOException { action = getNextTestActionFromTest(); messageBuilder = (DefaultMessageBuilder)action.getMessageBuilder(); - Assert.assertEquals(messageBuilder.buildMessagePayload(context, action.getMessageType()), ""+System.getProperty("line.separator")+"Hello Citrus"); + Assert.assertEquals(messageBuilder.buildMessagePayload(context, action.getMessageType()), ""+System.lineSeparator()+"Hello Citrus"); Assert.assertEquals(messageBuilder.buildMessageHeaders(context).size(), 1); Assert.assertEquals(messageBuilder.buildMessageHeaders(context).get("operation"), "Test"); Assert.assertEquals(messageBuilder.buildMessageHeaderData(context).size(), 1); - Assert.assertEquals(messageBuilder.buildMessageHeaderData(context).get(0).trim(), ""+System.getProperty("line.separator")+"
"+System.getProperty("line.separator")+" hello"+System.getProperty("line.separator")+"
"); + Assert.assertEquals(messageBuilder.buildMessageHeaderData(context).get(0).trim(), ""+System.lineSeparator()+"
"+System.lineSeparator()+" hello"+System.lineSeparator()+"
"); Assert.assertEquals(action.getMessageProcessors().size(), 0); Assert.assertEquals(action.getEndpoint(), beanDefinitionContext.getBean("myMessageEndpoint", Endpoint.class)); Assert.assertNull(action.getEndpointUri()); diff --git a/endpoints/citrus-http/src/main/java/org/citrusframework/http/message/HttpMessage.java b/endpoints/citrus-http/src/main/java/org/citrusframework/http/message/HttpMessage.java index cecc9ba815..9a8822d6f8 100644 --- a/endpoints/citrus-http/src/main/java/org/citrusframework/http/message/HttpMessage.java +++ b/endpoints/citrus-http/src/main/java/org/citrusframework/http/message/HttpMessage.java @@ -602,7 +602,7 @@ private static HttpMessage parseHttpMessage(final BufferedReader reader, final H final StringBuilder bodyBuilder = new StringBuilder(); line = reader.readLine(); while (StringUtils.hasText(line)) { - bodyBuilder.append(line).append(System.getProperty("line.separator")); + bodyBuilder.append(line).append(System.lineSeparator()); line = reader.readLine(); } diff --git a/endpoints/citrus-mail/src/main/java/org/citrusframework/mail/message/MailMessageConverter.java b/endpoints/citrus-mail/src/main/java/org/citrusframework/mail/message/MailMessageConverter.java index be137413b6..565ca73256 100644 --- a/endpoints/citrus-mail/src/main/java/org/citrusframework/mail/message/MailMessageConverter.java +++ b/endpoints/citrus-mail/src/main/java/org/citrusframework/mail/message/MailMessageConverter.java @@ -286,7 +286,7 @@ private String stripMailBodyEnding(String textBody) throws IOException { String line = reader.readLine(); while (line != null && !line.equals(".")) { body.append(line); - body.append(System.getProperty("line.separator")); + body.append(System.lineSeparator()); line = reader.readLine(); } } finally { diff --git a/endpoints/citrus-ws/src/test/java/org/citrusframework/ws/message/callback/SoapResponseMessageCallbackTest.java b/endpoints/citrus-ws/src/test/java/org/citrusframework/ws/message/callback/SoapResponseMessageCallbackTest.java index 1d1dd3e0c7..b47fecb0de 100644 --- a/endpoints/citrus-ws/src/test/java/org/citrusframework/ws/message/callback/SoapResponseMessageCallbackTest.java +++ b/endpoints/citrus-ws/src/test/java/org/citrusframework/ws/message/callback/SoapResponseMessageCallbackTest.java @@ -196,7 +196,7 @@ public void testSoapHeader() throws TransformerException, IOException { public void testSoapAttachment() throws TransformerException, IOException { SoapAttachment attachment = new SoapAttachment(); attachment.setContentId("attContentId"); - attachment.setContent("This is a SOAP attachment" + System.getProperty("line.separator") + "with multi-line"); + attachment.setContent("This is a SOAP attachment" + System.lineSeparator() + "with multi-line"); attachment.setContentType("plain/text"); SoapResponseMessageCallback callback = new SoapResponseMessageCallback(new WebServiceEndpointConfiguration(), context); diff --git a/endpoints/citrus-ws/src/test/java/org/citrusframework/ws/message/converter/SoapMessageConverterTest.java b/endpoints/citrus-ws/src/test/java/org/citrusframework/ws/message/converter/SoapMessageConverterTest.java index d47e461ae9..c0ddb23405 100644 --- a/endpoints/citrus-ws/src/test/java/org/citrusframework/ws/message/converter/SoapMessageConverterTest.java +++ b/endpoints/citrus-ws/src/test/java/org/citrusframework/ws/message/converter/SoapMessageConverterTest.java @@ -434,7 +434,7 @@ public void testInboundSoapHeader() { public void testInboundSoapAttachment() throws IOException { final SoapAttachment attachment = new SoapAttachment(); attachment.setContentId("attContentId"); - attachment.setContent("This is a SOAP attachment" + System.getProperty("line.separator") + "with multi-line"); + attachment.setContent("This is a SOAP attachment" + System.lineSeparator() + "with multi-line"); attachment.setContentType("plain/text"); final StringSource soapBodySource = new StringSource(payload); diff --git a/runtime/citrus-groovy/src/test/java/org/citrusframework/integration/script/GroovyActionJavaIT.java b/runtime/citrus-groovy/src/test/java/org/citrusframework/integration/script/GroovyActionJavaIT.java index 06a1071e3e..eebc5a1b68 100644 --- a/runtime/citrus-groovy/src/test/java/org/citrusframework/integration/script/GroovyActionJavaIT.java +++ b/runtime/citrus-groovy/src/test/java/org/citrusframework/integration/script/GroovyActionJavaIT.java @@ -26,7 +26,7 @@ public class GroovyActionJavaIT extends TestNGCitrusSpringSupport implements TestActionSupport { /** OS new line */ - private static final String NEWLINE = System.getProperty("line.separator"); + private static final String NEWLINE = System.lineSeparator(); @CitrusTest public void groovyAction() { From 949758ae78b97b1a7e073519453382dd2ad276c7 Mon Sep 17 00:00:00 2001 From: Timon Borter Date: Tue, 24 Mar 2026 15:57:34 +0100 Subject: [PATCH 2/9] chore: replace > 0 calls with isEmpty() --- .../java/org/citrusframework/selenium/actions/PageAction.java | 2 +- .../config/xml/ExecutePLSQLActionParserTest.java | 2 +- .../test/java/org/citrusframework/sql/groovy/PlsqlTest.java | 2 +- .../src/test/java/org/citrusframework/sql/xml/PlsqlTest.java | 2 +- .../src/test/java/org/citrusframework/sql/yaml/PlsqlTest.java | 2 +- .../testcontainers/aws2/LocalStackContainer.java | 2 +- .../java/org/citrusframework/ftp/client/FtpClientTest.java | 4 ++-- .../websocket/config/xml/WebSocketServerParser.java | 2 +- .../ws/message/SoapFormattingMessageProcessor.java | 2 +- .../ws/message/converter/SoapMessageConverter.java | 2 +- .../org/citrusframework/config/xml/GroovyActionParser.java | 2 +- .../main/java/org/citrusframework/main/CitrusAppOptions.java | 2 +- .../cucumber/steps/kubernetes/KubernetesSteps.java | 4 ++-- 13 files changed, 15 insertions(+), 15 deletions(-) diff --git a/connectors/citrus-selenium/src/main/java/org/citrusframework/selenium/actions/PageAction.java b/connectors/citrus-selenium/src/main/java/org/citrusframework/selenium/actions/PageAction.java index c161aed0a3..f610c5f143 100644 --- a/connectors/citrus-selenium/src/main/java/org/citrusframework/selenium/actions/PageAction.java +++ b/connectors/citrus-selenium/src/main/java/org/citrusframework/selenium/actions/PageAction.java @@ -98,7 +98,7 @@ protected void execute(SeleniumBrowser browser, TestContext context) { } else { ReflectionHelper.doWithMethods(pageToUse.getClass(), method -> { if (method.getName().equals(action)) { - if (method.getParameterCount() == 0 && arguments.size() == 0) { + if (method.getParameterCount() == 0 && arguments.isEmpty()) { ReflectionHelper.invokeMethod(method, pageToUse); } else if (method.getParameterCount() == 1 && method.getParameters()[0].getParameterizedType().getTypeName().equals(TestContext.class.getName())) { ReflectionHelper.invokeMethod(method, pageToUse, context); diff --git a/connectors/citrus-sql/src/test/java/org/citrusframework/config/xml/ExecutePLSQLActionParserTest.java b/connectors/citrus-sql/src/test/java/org/citrusframework/config/xml/ExecutePLSQLActionParserTest.java index 45251e65b8..a0736d06bd 100644 --- a/connectors/citrus-sql/src/test/java/org/citrusframework/config/xml/ExecutePLSQLActionParserTest.java +++ b/connectors/citrus-sql/src/test/java/org/citrusframework/config/xml/ExecutePLSQLActionParserTest.java @@ -43,7 +43,7 @@ public void testPLSQLActionParser() { Assert.assertEquals(action.getName(), "plsql:testDataSource"); Assert.assertNotNull(action.getDataSource()); Assert.assertNull(action.getSqlResourcePath()); - Assert.assertTrue(action.getScript().length() > 0); + Assert.assertTrue(!action.getScript().isEmpty()); Assert.assertTrue(action.isIgnoreErrors()); Assert.assertEquals(action.getTransactionManager(), beanDefinitionContext.getBean("testTransactionManager", PlatformTransactionManager.class)); Assert.assertEquals(action.getTransactionTimeout(), "5000"); diff --git a/connectors/citrus-sql/src/test/java/org/citrusframework/sql/groovy/PlsqlTest.java b/connectors/citrus-sql/src/test/java/org/citrusframework/sql/groovy/PlsqlTest.java index 174b6a8da4..04dfabf510 100644 --- a/connectors/citrus-sql/src/test/java/org/citrusframework/sql/groovy/PlsqlTest.java +++ b/connectors/citrus-sql/src/test/java/org/citrusframework/sql/groovy/PlsqlTest.java @@ -74,7 +74,7 @@ public void shouldLoadPlsql() { Assert.assertNotNull(action.getDataSource()); Assert.assertEquals(action.getDataSource(), dataSource); Assert.assertNull(action.getSqlResourcePath()); - Assert.assertTrue(action.getScript().length() > 0); + Assert.assertTrue(!action.getScript().isEmpty()); Assert.assertTrue(action.isIgnoreErrors()); Assert.assertEquals(action.getTransactionManager(), mockTransactionManager); Assert.assertEquals(action.getTransactionTimeout(), "5000"); diff --git a/connectors/citrus-sql/src/test/java/org/citrusframework/sql/xml/PlsqlTest.java b/connectors/citrus-sql/src/test/java/org/citrusframework/sql/xml/PlsqlTest.java index 481b0a5c0a..04d73f7976 100644 --- a/connectors/citrus-sql/src/test/java/org/citrusframework/sql/xml/PlsqlTest.java +++ b/connectors/citrus-sql/src/test/java/org/citrusframework/sql/xml/PlsqlTest.java @@ -74,7 +74,7 @@ public void shouldLoadPlsql() { Assert.assertNotNull(action.getDataSource()); Assert.assertEquals(action.getDataSource(), dataSource); Assert.assertNull(action.getSqlResourcePath()); - Assert.assertTrue(action.getScript().length() > 0); + Assert.assertTrue(!action.getScript().isEmpty()); Assert.assertTrue(action.isIgnoreErrors()); Assert.assertEquals(action.getTransactionManager(), mockTransactionManager); Assert.assertEquals(action.getTransactionTimeout(), "5000"); diff --git a/connectors/citrus-sql/src/test/java/org/citrusframework/sql/yaml/PlsqlTest.java b/connectors/citrus-sql/src/test/java/org/citrusframework/sql/yaml/PlsqlTest.java index d503f8f2e9..2034cb6cab 100644 --- a/connectors/citrus-sql/src/test/java/org/citrusframework/sql/yaml/PlsqlTest.java +++ b/connectors/citrus-sql/src/test/java/org/citrusframework/sql/yaml/PlsqlTest.java @@ -74,7 +74,7 @@ public void shouldLoadPlsql() { Assert.assertNotNull(action.getDataSource()); Assert.assertEquals(action.getDataSource(), dataSource); Assert.assertNull(action.getSqlResourcePath()); - Assert.assertTrue(action.getScript().length() > 0); + Assert.assertTrue(!action.getScript().isEmpty()); Assert.assertTrue(action.isIgnoreErrors()); Assert.assertEquals(action.getTransactionManager(), mockTransactionManager); Assert.assertEquals(action.getTransactionTimeout(), "5000"); diff --git a/connectors/citrus-testcontainers/src/main/java/org/citrusframework/testcontainers/aws2/LocalStackContainer.java b/connectors/citrus-testcontainers/src/main/java/org/citrusframework/testcontainers/aws2/LocalStackContainer.java index 68458262b5..ac9549dccb 100644 --- a/connectors/citrus-testcontainers/src/main/java/org/citrusframework/testcontainers/aws2/LocalStackContainer.java +++ b/connectors/citrus-testcontainers/src/main/java/org/citrusframework/testcontainers/aws2/LocalStackContainer.java @@ -97,7 +97,7 @@ protected void configure() { if (getEnvMap().containsKey(HOSTNAME_EXTERNAL_ENV)) { // do nothing hostnameExternalReason = "explicitly as environment variable"; - } else if (getNetwork() != null && getNetworkAliases().size() >= 1) { + } else if (getNetwork() != null && !getNetworkAliases().isEmpty()) { withEnv(HOSTNAME_EXTERNAL_ENV, getNetworkAliases().get(getNetworkAliases().size() - 1)); // use the last network alias set hostnameExternalReason = "to match last network alias on container with non-default network"; } else { diff --git a/endpoints/citrus-ftp/src/test/java/org/citrusframework/ftp/client/FtpClientTest.java b/endpoints/citrus-ftp/src/test/java/org/citrusframework/ftp/client/FtpClientTest.java index e049785f23..3a8040e2ea 100644 --- a/endpoints/citrus-ftp/src/test/java/org/citrusframework/ftp/client/FtpClientTest.java +++ b/endpoints/citrus-ftp/src/test/java/org/citrusframework/ftp/client/FtpClientTest.java @@ -197,7 +197,7 @@ public void testDeleteDirectory() { FtpMessage ftpMessage = ftpClient.deleteFile(deleteCommand(DELETE_FOLDER), context); verifyMessage(ftpMessage, DeleteCommandResult.class, FILE_ACTION_OK, "250 \"/delete/second_folder\" removed."); assertTrue(fakeFtpServer.getFileSystem().exists(DELETE_FOLDER)); - assertTrue(fakeFtpServer.getFileSystem().listFiles(DELETE_FOLDER).size() == 0); + assertTrue(fakeFtpServer.getFileSystem().listFiles(DELETE_FOLDER).isEmpty()); } @Test @@ -206,7 +206,7 @@ public void testDeleteAllFilesInEmptyDirectory() { FtpMessage ftpMessage = ftpClient.deleteFile(deleteCommand(EMPTY_FOLDER), context); verifyMessage(ftpMessage, DeleteCommandResult.class, FILE_ACTION_OK, "250 No files to delete."); assertTrue(fakeFtpServer.getFileSystem().exists(EMPTY_FOLDER)); - assertTrue(fakeFtpServer.getFileSystem().listFiles(EMPTY_FOLDER).size() == 0); + assertTrue(fakeFtpServer.getFileSystem().listFiles(EMPTY_FOLDER).isEmpty()); } @Test diff --git a/endpoints/citrus-websocket/src/main/java/org/citrusframework/websocket/config/xml/WebSocketServerParser.java b/endpoints/citrus-websocket/src/main/java/org/citrusframework/websocket/config/xml/WebSocketServerParser.java index 7969dc7655..c6fb7fb24f 100644 --- a/endpoints/citrus-websocket/src/main/java/org/citrusframework/websocket/config/xml/WebSocketServerParser.java +++ b/endpoints/citrus-websocket/src/main/java/org/citrusframework/websocket/config/xml/WebSocketServerParser.java @@ -53,7 +53,7 @@ protected void parseServer(BeanDefinitionBuilder builder, Element element, Parse } } - if (webSocketReferences.size() > 0) { + if (!webSocketReferences.isEmpty()) { builder.addPropertyValue("webSockets", webSocketReferences); } diff --git a/endpoints/citrus-ws/src/main/java/org/citrusframework/ws/message/SoapFormattingMessageProcessor.java b/endpoints/citrus-ws/src/main/java/org/citrusframework/ws/message/SoapFormattingMessageProcessor.java index d356623d38..0f2b8e76c6 100644 --- a/endpoints/citrus-ws/src/main/java/org/citrusframework/ws/message/SoapFormattingMessageProcessor.java +++ b/endpoints/citrus-ws/src/main/java/org/citrusframework/ws/message/SoapFormattingMessageProcessor.java @@ -37,7 +37,7 @@ public void processMessage(Message message, TestContext context) { faultDetailsFormat.add(XMLUtils.prettyPrint(faultDetail)); } - if (faultDetailsFormat.size() > 0) { + if (!faultDetailsFormat.isEmpty()) { ((SoapFault) message).faultDetails(faultDetailsFormat); } } diff --git a/endpoints/citrus-ws/src/main/java/org/citrusframework/ws/message/converter/SoapMessageConverter.java b/endpoints/citrus-ws/src/main/java/org/citrusframework/ws/message/converter/SoapMessageConverter.java index 6e6bfde1d1..4d090ff4a8 100644 --- a/endpoints/citrus-ws/src/main/java/org/citrusframework/ws/message/converter/SoapMessageConverter.java +++ b/endpoints/citrus-ws/src/main/java/org/citrusframework/ws/message/converter/SoapMessageConverter.java @@ -102,7 +102,7 @@ public void convertOutbound(final WebServiceMessage webServiceMessage, copySoapHeaders(endpointConfiguration, soapRequest, soapMessage); copySoapHeaderData(soapRequest, soapMessage, transformerFactory); - if (soapMessage.isMtomEnabled() && soapMessage.getAttachments().size() > 0) { + if (soapMessage.isMtomEnabled() && !soapMessage.getAttachments().isEmpty()) { logger.debug("Converting SOAP request to XOP package"); soapRequest.convertToXopPackage(); } diff --git a/runtime/citrus-groovy/src/main/java/org/citrusframework/config/xml/GroovyActionParser.java b/runtime/citrus-groovy/src/main/java/org/citrusframework/config/xml/GroovyActionParser.java index 1c8f4a7e98..495554fead 100644 --- a/runtime/citrus-groovy/src/main/java/org/citrusframework/config/xml/GroovyActionParser.java +++ b/runtime/citrus-groovy/src/main/java/org/citrusframework/config/xml/GroovyActionParser.java @@ -47,7 +47,7 @@ public BeanDefinition parse(Element element, ParserContext parserContext) { beanDefinition.addPropertyValue("scriptTemplatePath", scriptTemplatePath); } - if (DomUtils.getTextValue(element).length() > 0) { + if (!DomUtils.getTextValue(element).isEmpty()) { beanDefinition.addPropertyValue("script", DomUtils.getTextValue(element)); } diff --git a/runtime/citrus-main/src/main/java/org/citrusframework/main/CitrusAppOptions.java b/runtime/citrus-main/src/main/java/org/citrusframework/main/CitrusAppOptions.java index 8783a96eb6..67ae1a917e 100644 --- a/runtime/citrus-main/src/main/java/org/citrusframework/main/CitrusAppOptions.java +++ b/runtime/citrus-main/src/main/java/org/citrusframework/main/CitrusAppOptions.java @@ -62,7 +62,7 @@ protected void doProcess(T configuration, String arg, String value, LinkedList("d", "duration", "Maximum time in milliseconds the server should be up and running - server will terminate automatically when time exceeds") { @Override protected void doProcess(T configuration, String arg, String value, LinkedList remainingArgs) { - if (value != null && value.length() > 0) { + if (value != null && !value.isEmpty()) { configuration.setTimeToLive(Long.parseLong(value)); } else { throw new CitrusRuntimeException("Missing parameter value for -d/--duration option"); diff --git a/tools/cucumber-steps/citrus-cucumber-kubernetes/src/main/java/org/citrusframework/cucumber/steps/kubernetes/KubernetesSteps.java b/tools/cucumber-steps/citrus-cucumber-kubernetes/src/main/java/org/citrusframework/cucumber/steps/kubernetes/KubernetesSteps.java index 4472f2bc8c..bdfe885533 100644 --- a/tools/cucumber-steps/citrus-cucumber-kubernetes/src/main/java/org/citrusframework/cucumber/steps/kubernetes/KubernetesSteps.java +++ b/tools/cucumber-steps/citrus-cucumber-kubernetes/src/main/java/org/citrusframework/cucumber/steps/kubernetes/KubernetesSteps.java @@ -412,8 +412,8 @@ public void resourceShouldMatchConditionWithConfiguration(String condition, Data String kind = configuration.get("kind"); String apiVersion = configuration.getOrDefault("apiVersion", ""); - String group = configuration.getOrDefault("group", apiVersion.length() > 0 ? apiVersion.substring(0, apiVersion.indexOf("/")) : ""); - String version = configuration.getOrDefault("version", apiVersion.length() > 0 ? apiVersion.substring(apiVersion.indexOf("/") + 1) : ""); + String group = configuration.getOrDefault("group", !apiVersion.isEmpty() ? apiVersion.substring(0, apiVersion.indexOf("/")) : ""); + String version = configuration.getOrDefault("version", !apiVersion.isEmpty() ? apiVersion.substring(apiVersion.indexOf("/") + 1) : ""); String resourceType = configuration.getOrDefault("type", String.format("%ss.%s/%s", kind.toLowerCase(Locale.ENGLISH), group, version)); if (configuration.containsKey("name")) { From d5950f230496ab38cbe207ecc5fcee8138a67198 Mon Sep 17 00:00:00 2001 From: Timon Borter Date: Tue, 24 Mar 2026 15:58:02 +0100 Subject: [PATCH 3/9] chore: use charset constant --- .../org/citrusframework/ftp/client/SftpClientTest.java | 6 +++--- .../websocket/message/WebSocketMessageConverterTest.java | 9 +++++---- .../ws/actions/SendSoapMessageAction.java | 3 ++- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/endpoints/citrus-ftp/src/test/java/org/citrusframework/ftp/client/SftpClientTest.java b/endpoints/citrus-ftp/src/test/java/org/citrusframework/ftp/client/SftpClientTest.java index e44d4b01b6..b37d390695 100644 --- a/endpoints/citrus-ftp/src/test/java/org/citrusframework/ftp/client/SftpClientTest.java +++ b/endpoints/citrus-ftp/src/test/java/org/citrusframework/ftp/client/SftpClientTest.java @@ -123,7 +123,7 @@ public void testRetrieveFileToLocalPath() throws Exception { ftpMessage = sftpClient.retrieveFile(getCommand(remoteFilePath, localDownloadFilePath.toString()), context); verifyMessage(ftpMessage, GetCommandResult.class, CLOSING_DATA_CONNECTION, "Transfer complete"); Assert.assertEquals(inputFileAsString, - new String(Files.readAllBytes(localDownloadFilePath), "UTF-8")); + new String(Files.readAllBytes(localDownloadFilePath), StandardCharsets.UTF_8)); } @Test @@ -137,7 +137,7 @@ public void testRetrieveFileToLocalPathWithoutFilename() throws Exception { ftpMessage = sftpClient.retrieveFile(getCommand(remoteFilePath, localDownloadFilePath.toString()), context); verifyMessage(ftpMessage, GetCommandResult.class, CLOSING_DATA_CONNECTION, "Transfer complete"); Assert.assertEquals(inputFileAsString, - new String(Files.readAllBytes(localDownloadFilePath), "UTF-8")); + new String(Files.readAllBytes(localDownloadFilePath), StandardCharsets.UTF_8)); } @Test @@ -249,7 +249,7 @@ private SftpClient createSftpClient() { } private void writeToFile(String fileContent, Path dir) throws IOException { - try (BufferedWriter writer = Files.newBufferedWriter(dir, Charset.forName("UTF-8"))) { + try (BufferedWriter writer = Files.newBufferedWriter(dir, StandardCharsets.UTF_8)) { writer.write(fileContent, 0, fileContent.length()); } } diff --git a/endpoints/citrus-websocket/src/test/java/org/citrusframework/websocket/message/WebSocketMessageConverterTest.java b/endpoints/citrus-websocket/src/test/java/org/citrusframework/websocket/message/WebSocketMessageConverterTest.java index 0fb6f8952f..4098240f0e 100644 --- a/endpoints/citrus-websocket/src/test/java/org/citrusframework/websocket/message/WebSocketMessageConverterTest.java +++ b/endpoints/citrus-websocket/src/test/java/org/citrusframework/websocket/message/WebSocketMessageConverterTest.java @@ -27,6 +27,7 @@ import java.nio.ByteBuffer; import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; /** * @since 2.3 @@ -58,11 +59,11 @@ public void testConvertTextMessageOutbound() throws Exception { public void testConvertBinaryMessageOutbound() throws Exception { WebSocketEndpointConfiguration endpointConfiguration = new WebSocketClientEndpointConfiguration(); - WebSocketMessage message = new WebSocketMessage("Hello WebSocket!".getBytes(Charset.forName("UTF-8"))); + WebSocketMessage message = new WebSocketMessage("Hello WebSocket!".getBytes(StandardCharsets.UTF_8)); org.springframework.web.socket.WebSocketMessage result = messageConverter.convertOutbound(message, endpointConfiguration, context); Assert.assertTrue(BinaryMessage.class.isInstance(result)); - Assert.assertEquals(((BinaryMessage) result).getPayload().array(), "Hello WebSocket!".getBytes(Charset.forName("UTF-8"))); + Assert.assertEquals(((BinaryMessage) result).getPayload().array(), "Hello WebSocket!".getBytes(StandardCharsets.UTF_8)); Assert.assertEquals(result.isLast(), true); } @@ -88,12 +89,12 @@ public void testConvertTextMessageInbound() throws Exception { @Test public void testConvertBinaryMessageInbound() throws Exception { WebSocketEndpointConfiguration endpointConfiguration = new WebSocketClientEndpointConfiguration(); - org.springframework.web.socket.WebSocketMessage externalMessage = new BinaryMessage("Hello WebSocket!".getBytes(Charset.forName("UTF-8"))); + org.springframework.web.socket.WebSocketMessage externalMessage = new BinaryMessage("Hello WebSocket!".getBytes(StandardCharsets.UTF_8)); Message internal = messageConverter.convertInbound(externalMessage, endpointConfiguration, context); Assert.assertTrue(WebSocketMessage.class.isInstance(internal)); - Assert.assertEquals(internal.getPayload(ByteBuffer.class).array(), "Hello WebSocket!".getBytes(Charset.forName("UTF-8"))); + Assert.assertEquals(internal.getPayload(ByteBuffer.class).array(), "Hello WebSocket!".getBytes(StandardCharsets.UTF_8)); Assert.assertEquals(((WebSocketMessage) internal).isLast(), true); } } diff --git a/endpoints/citrus-ws/src/main/java/org/citrusframework/ws/actions/SendSoapMessageAction.java b/endpoints/citrus-ws/src/main/java/org/citrusframework/ws/actions/SendSoapMessageAction.java index 71ad00920c..cd5c4fc344 100644 --- a/endpoints/citrus-ws/src/main/java/org/citrusframework/ws/actions/SendSoapMessageAction.java +++ b/endpoints/citrus-ws/src/main/java/org/citrusframework/ws/actions/SendSoapMessageAction.java @@ -41,6 +41,7 @@ import java.io.IOException; import java.net.URLEncoder; import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.List; @@ -98,7 +99,7 @@ protected SoapMessage createMessage(TestContext context, String messageType) { attachment.getEncodingType(), cid, SoapAttachment.ENCODING_BASE64_BINARY, SoapAttachment.ENCODING_HEX_BINARY)); } } else { - messagePayload = messagePayload.replaceAll(cid, String.format("", CID_MARKER + URLEncoder.encode(attachment.getContentId(), "UTF-8"))); + messagePayload = messagePayload.replaceAll(cid, String.format("", CID_MARKER + URLEncoder.encode(attachment.getContentId(), StandardCharsets.UTF_8))); soapMessage.addAttachment(attachment); } From aa7194c57970a225d4dcfb5630392421a88e4ca6 Mon Sep 17 00:00:00 2001 From: Timon Borter Date: Tue, 24 Mar 2026 15:58:22 +0100 Subject: [PATCH 4/9] chore: remove unnecessary semicolon --- .../org/citrusframework/validation/CustomValidatorStrategy.java | 2 +- .../main/java/org/citrusframework/functions/StringFunction.java | 2 +- .../main/java/org/citrusframework/report/TestFlowReporter.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/citrus-api/src/main/java/org/citrusframework/validation/CustomValidatorStrategy.java b/core/citrus-api/src/main/java/org/citrusframework/validation/CustomValidatorStrategy.java index e7160bd860..1bd602b02a 100644 --- a/core/citrus-api/src/main/java/org/citrusframework/validation/CustomValidatorStrategy.java +++ b/core/citrus-api/src/main/java/org/citrusframework/validation/CustomValidatorStrategy.java @@ -42,5 +42,5 @@ public enum CustomValidatorStrategy { COMBINED, - EXCLUSIVE; + EXCLUSIVE } diff --git a/core/citrus-base/src/main/java/org/citrusframework/functions/StringFunction.java b/core/citrus-base/src/main/java/org/citrusframework/functions/StringFunction.java index a48569617f..207a840173 100644 --- a/core/citrus-base/src/main/java/org/citrusframework/functions/StringFunction.java +++ b/core/citrus-base/src/main/java/org/citrusframework/functions/StringFunction.java @@ -37,5 +37,5 @@ default String execute(StringParameter parameter, TestContext context) { @Override default StringParameter getParameters() { return new StringParameter(); - }; + } } diff --git a/core/citrus-base/src/main/java/org/citrusframework/report/TestFlowReporter.java b/core/citrus-base/src/main/java/org/citrusframework/report/TestFlowReporter.java index 553352d6ba..7823b3adce 100644 --- a/core/citrus-base/src/main/java/org/citrusframework/report/TestFlowReporter.java +++ b/core/citrus-base/src/main/java/org/citrusframework/report/TestFlowReporter.java @@ -255,7 +255,7 @@ public ReportEntry getOrCreateNew(String name) { } public void reset(String name) { - entries.put(name, new ReportEntry(name));; + entries.put(name, new ReportEntry(name)); } public List getEntries() { From c8cea98f5ce19639e66d2c46dddd83176d447ed0 Mon Sep 17 00:00:00 2001 From: Timon Borter Date: Tue, 24 Mar 2026 15:58:36 +0100 Subject: [PATCH 5/9] chore: remove unnecessary interface method modifier --- .../citrusframework/jms/integration/service/HelloService.java | 2 +- .../org/citrusframework/integration/service/HelloService.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/endpoints/citrus-jms/src/test/java/org/citrusframework/jms/integration/service/HelloService.java b/endpoints/citrus-jms/src/test/java/org/citrusframework/jms/integration/service/HelloService.java index 43e01967b4..fb1fbc6002 100644 --- a/endpoints/citrus-jms/src/test/java/org/citrusframework/jms/integration/service/HelloService.java +++ b/endpoints/citrus-jms/src/test/java/org/citrusframework/jms/integration/service/HelloService.java @@ -27,5 +27,5 @@ public interface HelloService { * @param request the hello request. * @return the hello response. */ - public Message sayHello(Message request); + Message sayHello(Message request); } diff --git a/endpoints/citrus-spring-integration/src/test/java/org/citrusframework/integration/service/HelloService.java b/endpoints/citrus-spring-integration/src/test/java/org/citrusframework/integration/service/HelloService.java index faee585922..69b08db95e 100644 --- a/endpoints/citrus-spring-integration/src/test/java/org/citrusframework/integration/service/HelloService.java +++ b/endpoints/citrus-spring-integration/src/test/java/org/citrusframework/integration/service/HelloService.java @@ -27,5 +27,5 @@ public interface HelloService { * @param request the hello request. * @return the hello response. */ - public Message sayHello(Message request); + Message sayHello(Message request); } From 850b9b6ce08658988887c1ce0f0f396ee7b44d5f Mon Sep 17 00:00:00 2001 From: Timon Borter Date: Tue, 24 Mar 2026 16:00:56 +0100 Subject: [PATCH 6/9] chore: remove duplicate throws declarations --- .../config/xml/DockerExecuteActionParser.java | 2 +- .../actions/DockerExecuteActionTest.java | 34 +++---- .../xml/KubernetesExecuteActionParser.java | 2 +- .../KubernetesEndpointComponentTest.java | 4 +- .../kubernetes/xml/AgentDisconnectTest.java | 2 +- .../kubernetes/xml/DeleteConfigMapTest.java | 2 +- .../xml/DeleteCustomResourceTest.java | 2 +- .../kubernetes/xml/DeleteSecretTest.java | 2 +- .../kubernetes/yaml/AgentDisconnectTest.java | 2 +- .../kubernetes/yaml/DeleteConfigMapTest.java | 2 +- .../yaml/DeleteCustomResourceTest.java | 2 +- .../kubernetes/yaml/DeleteSecretTest.java | 2 +- .../config/xml/AlertActionParser.java | 2 +- .../xml/ClearBrowserCacheActionParser.java | 2 +- .../config/xml/CloseWindowActionParser.java | 2 +- .../config/xml/FindElementActionParser.java | 2 +- .../config/xml/GetStoredFileActionParser.java | 2 +- .../config/xml/JavaScriptActionParser.java | 2 +- .../xml/MakeScreenshotActionParser.java | 2 +- .../config/xml/NavigateActionParser.java | 2 +- .../config/xml/OpenWindowActionParser.java | 2 +- .../selenium/config/xml/PageActionParser.java | 2 +- .../config/xml/StartBrowserActionParser.java | 2 +- .../config/xml/StopBrowserActionParser.java | 2 +- .../config/xml/StoreFileActionParser.java | 2 +- .../config/xml/SwitchWindowActionParser.java | 2 +- .../selenium/actions/AlertActionTest.java | 12 +-- .../actions/CheckInputActionTest.java | 6 +- .../actions/ClearBrowserCacheActionTest.java | 2 +- .../actions/CloseWindowActionTest.java | 12 +-- .../actions/DropDownSelectActionTest.java | 4 +- .../selenium/actions/FillFormActionTest.java | 8 +- .../actions/GetStoredFileActionTest.java | 4 +- .../selenium/actions/HoverActionTest.java | 2 +- .../actions/JavaScriptActionTest.java | 8 +- .../actions/MakeScreenshotActionTest.java | 4 +- .../actions/OpenWindowActionTest.java | 4 +- .../selenium/actions/PageActionTest.java | 16 ++-- .../selenium/actions/SetInputActionTest.java | 4 +- .../actions/StartBrowserActionTest.java | 8 +- .../actions/StopBrowserActionTest.java | 2 +- .../selenium/actions/StoreFileActionTest.java | 4 +- .../actions/SwitchWindowActionTest.java | 6 +- .../selenium/actions/WaitUntilActionTest.java | 10 +- .../SeleniumEndpointComponentTest.java | 4 +- .../selenium/groovy/SeleniumTest.java | 2 +- .../selenium/xml/SeleniumTest.java | 2 +- .../selenium/yaml/SeleniumTest.java | 2 +- .../config/xml/ExecutePLSQLActionParser.java | 2 +- .../config/xml/SQLActionParser.java | 4 +- .../ExecutePLSQLTestActionBuilderTest.java | 4 +- .../dsl/ExecuteSQLTestActionBuilderTest.java | 4 +- .../spi/ClasspathResourceResolver.java | 2 +- .../org/citrusframework/spi/Resource.java | 2 +- .../org/citrusframework/spi/Resources.java | 12 +-- .../util/ReflectionHelper.java | 16 +--- .../config/TestCaseFactory.java | 2 +- .../xml/AbstractTestContainerFactoryBean.java | 3 +- .../config/xml/AntRunActionParser.java | 2 +- .../xml/CreateVariablesActionParser.java | 2 +- .../xml/DirectEndpointAdapterParser.java | 2 +- .../config/xml/EchoActionParser.java | 2 +- .../EmptyResponseEndpointAdapterParser.java | 2 +- .../config/xml/FailActionParser.java | 2 +- .../config/xml/GlobalVariablesParser.java | 2 +- .../config/xml/InputActionParser.java | 2 +- .../config/xml/JavaActionParser.java | 2 +- .../xml/LoadPropertiesActionParser.java | 2 +- .../config/xml/PurgeEndpointActionParser.java | 2 +- .../xml/ReceiveMessageActionParser.java | 2 +- .../xml/ReceiveTimeoutActionParser.java | 2 +- ...questDispatchingEndpointAdapterParser.java | 2 +- .../config/xml/SendMessageActionParser.java | 2 +- .../config/xml/SleepActionParser.java | 2 +- .../config/xml/StartServerActionParser.java | 2 +- .../StaticResponseEndpointAdapterParser.java | 2 +- .../config/xml/StopServerActionParser.java | 2 +- .../config/xml/StopTimeActionParser.java | 2 +- .../config/xml/StopTimerParser.java | 2 +- .../config/xml/TemplateParser.java | 3 +- ...TimeoutProducingEndpointAdapterParser.java | 2 +- .../xml/TraceVariablesActionParser.java | 2 +- .../config/xml/TransformActionParser.java | 2 +- .../config/xml/WaitParser.java | 2 +- .../context/TestContextFactoryBean.java | 2 +- .../XmlTestExecutingEndpointAdapter.java | 3 +- .../DefaultFunctionLibraryFactory.java | 2 +- .../functions/FunctionRegistryFactory.java | 2 +- .../report/MessageListenersFactory.java | 2 +- .../report/TestActionListenersFactory.java | 2 +- .../report/TestListenersFactory.java | 2 +- .../report/TestSuiteListenersFactory.java | 2 +- .../reporter/TestReportersFactory.java | 2 +- .../spi/SpringResourceWrapper.java | 10 +- .../MessageValidatorRegistryFactory.java | 2 +- .../interceptor/MessageProcessorsFactory.java | 2 +- .../ValidationMatcherRegistryFactory.java | 2 +- .../xml/SpringMarshallerAdapter.java | 4 +- .../config/xml/CustomTestCaseParserTest.java | 2 +- ...mptyResponseEndpointAdapterParserTest.java | 2 +- .../config/xml/FunctionLibraryParserTest.java | 2 +- .../config/xml/GlobalVariablesParserTest.java | 4 +- .../MessageValidatorRegistryParserTest.java | 2 +- .../xml/NamespaceContextParserTest.java | 2 +- ...tDispatchingEndpointAdapterParserTest.java | 2 +- .../xml/SequenceAfterSuiteParserTest.java | 2 +- .../xml/SequenceAfterTestParserTest.java | 2 +- .../xml/SequenceBeforeSuiteParserTest.java | 2 +- .../xml/SequenceBeforeTestParserTest.java | 2 +- ...aticResponseEndpointAdapterParserTest.java | 2 +- ...outProducingEndpointAdapterParserTest.java | 2 +- .../config/xml/TimerParserTest.java | 2 +- .../ValidationMatcherLibraryParserTest.java | 2 +- .../ContextLoadingMappingStrategyTest.java | 2 +- .../camel/actions/CreateCamelRouteAction.java | 4 +- .../xml/CamelControlBusActionParser.java | 2 +- .../xml/CreateCamelRouteActionParser.java | 2 +- .../xml/RemoveCamelRouteActionParser.java | 2 +- .../xml/StartCamelRouteActionParser.java | 2 +- .../xml/StopCamelRouteActionParser.java | 2 +- .../camel/message/CamelRouteProcessor.java | 2 +- .../actions/CamelCmdReceiveActionTest.java | 10 +- .../actions/CamelControlBusActionTest.java | 14 +-- .../dsl/CamelRouteTestActionRunnerTest.java | 14 +-- .../endpoint/CamelEndpointComponentTest.java | 10 +- .../camel/groovy/ControlBusTest.java | 2 +- .../camel/groovy/CreateRoutesTest.java | 2 +- .../camel/groovy/RemoveRoutesTest.java | 2 +- .../camel/groovy/StartRoutesTest.java | 2 +- .../camel/groovy/StopRoutesTest.java | 2 +- .../camel/integration/CamelControlbusIT.java | 2 +- .../camel/integration/CamelRouteActionIT.java | 8 +- .../camel/xml/CamelAddPluginTest.java | 2 +- .../CamelKubernetesDeleteIntegrationTest.java | 2 +- .../CamelKubernetesRunIntegrationTest.java | 2 +- .../CamelKubernetesVerifyIntegrationTest.java | 2 +- .../camel/xml/ControlBusTest.java | 2 +- .../camel/xml/CreateRoutesTest.java | 2 +- .../camel/xml/JBangCmdReceiveTest.java | 2 +- .../camel/xml/JBangCmdSendTest.java | 2 +- .../citrusframework/camel/xml/JBangTest.java | 2 +- .../camel/xml/RemoveRoutesTest.java | 2 +- .../camel/xml/StartRoutesTest.java | 2 +- .../camel/xml/StopRoutesTest.java | 2 +- .../camel/xml/infra/CamelRunInfraTest.java | 2 +- .../camel/xml/infra/CamelStopInfraTest.java | 2 +- .../camel/yaml/CamelAddPluginTest.java | 2 +- .../CamelKubernetesDeleteIntegrationTest.java | 2 +- .../CamelKubernetesRunIntegrationTest.java | 2 +- .../CamelKubernetesVerifyIntegrationTest.java | 2 +- .../camel/yaml/ControlBusTest.java | 2 +- .../camel/yaml/CreateRoutesTest.java | 2 +- .../camel/yaml/JBangCmdReceiveTest.java | 2 +- .../camel/yaml/JBangCmdSendTest.java | 2 +- .../citrusframework/camel/yaml/JBangTest.java | 2 +- .../camel/yaml/RemoveRouteTest.java | 2 +- .../camel/yaml/StartRouteTest.java | 2 +- .../camel/yaml/StopRouteTest.java | 2 +- .../camel/yaml/infra/CamelRunInfraTest.java | 2 +- .../camel/yaml/infra/CamelStopInfraTest.java | 2 +- .../ftp/client/FtpClientTest.java | 2 +- .../ftp/client/FtpEndpointComponentTest.java | 4 +- .../ftp/client/SftpEndpointComponentTest.java | 4 +- .../annotation/FtpServerConfigParserTest.java | 2 +- .../ftp/config/xml/FtpServerParserTest.java | 2 +- .../ftp/server/FtpServerTest.java | 2 +- .../BasicAuthClientHttpRequestFactory.java | 2 +- .../LoggingHandlerInterceptor.java | 2 +- .../HttpClientConnectionManagerFactory.java | 2 +- .../HttpClientRequestFactoryBean.java | 2 +- .../HttpSecurityHandlerFactoryBean.java | 2 +- .../security/HttpServerConnectorFactory.java | 2 +- .../http/security/SecurityHandlerFactory.java | 2 +- .../client/HttpEndpointComponentTest.java | 6 +- .../client/HttpsEndpointComponentTest.java | 6 +- .../servlet/CitrusDispatcherServletTest.java | 6 +- .../http/servlet/GzipServletFilterTest.java | 6 +- .../RequestCachingServletFilterTest.java | 6 +- .../FormUrlEncodedMessageValidatorTest.java | 6 +- .../config/xml/JmsEndpointAdapterParser.java | 2 +- .../xml/PurgeJmsQueuesActionParser.java | 2 +- .../JmsEndpointConfigParserExceptionTest.java | 2 +- ...SyncEndpointConfigParserExceptionTest.java | 2 +- .../xml/JmsEndpointAdapterParserTest.java | 2 +- .../endpoint/JmsEndpointComponentTest.java | 16 ++-- .../endpoint/JmsEndpointSyncConsumerTest.java | 2 +- .../endpoint/JmsEndpointSyncProducerTest.java | 2 +- .../jms/integration/JmsByteMessageJavaIT.java | 2 +- .../jms/integration/JmsGzipMessageJavaIT.java | 2 +- .../jmx/server/JmxEndpointMBean.java | 4 +- .../endpoint/JmxEndpointComponentTest.java | 4 +- .../mail/message/MailMessageConverter.java | 2 +- .../client/MailEndpointComponentTest.java | 4 +- .../message/MailMessageConverterTest.java | 2 +- .../mail/model/MailMarshallerTest.java | 2 +- .../endpoint/RmiEndpointComponentTest.java | 4 +- .../xml/ChannelEndpointAdapterParser.java | 2 +- .../xml/PurgeMessageChannelActionParser.java | 2 +- .../PurgeMessageChannelActionTest.java | 6 +- .../channel/ChannelEndpointComponentTest.java | 6 +- .../xml/ChannelEndpointAdapterParserTest.java | 2 +- .../endpoint/ChannelEndpointFactoryTest.java | 2 +- .../groovy/PurgeChannelsTest.java | 2 +- .../xml/PurgeChannelsTest.java | 2 +- .../yaml/PurgeChannelsTest.java | 2 +- .../org/citrusframework/ssh/SshCommand.java | 2 +- .../ssh/client/SshClientTest.java | 6 +- .../ssh/client/SshEndpointComponentTest.java | 6 +- .../SinglePublicKeyAuthenticatorTest.java | 3 +- .../endpoint/VertxEndpointComponentTest.java | 8 +- .../SessionEnricherHandshakeInterceptor.java | 2 +- .../WebSocketEndpointComponentTest.java | 6 +- .../WebSocketMessageConverterTest.java | 8 +- .../ws/config/xml/AssertSoapFaultParser.java | 2 +- .../xml/ReceiveSoapMessageActionParser.java | 2 +- .../config/xml/SendSoapFaultActionParser.java | 2 +- .../xml/SendSoapMessageActionParser.java | 2 +- .../LoggingEndpointInterceptor.java | 2 +- .../ws/message/SoapAttachment.java | 6 +- .../callback/SoapRequestMessageCallback.java | 2 +- .../callback/SoapResponseMessageCallback.java | 2 +- .../ws/actions/AssertSoapFaultTest.java | 26 +++--- .../actions/ReceiveSoapMessageActionTest.java | 16 ++-- .../ws/actions/SendSoapMessageActionTest.java | 36 ++++---- .../dsl/AssertSoapFaultBuilderTest.java | 4 +- ...ceiveSoapMessageTestActionBuilderTest.java | 2 +- .../SendSoapFaultTestActionBuilderTest.java | 2 +- .../SendSoapMessageTestActionBuilderTest.java | 2 +- .../WebServiceEndpointComponentTest.java | 4 +- .../ws/groovy/SendSoapFaultTest.java | 2 +- .../SoapAttachmentHandlingEndpoint.java | 2 +- .../SoapFaultGeneratingEndpoint.java | 2 +- .../ws/message/SoapAttachmentTest.java | 2 +- .../SoapFormattingMessageProcessorTest.java | 6 +- .../WsAddressingMessageConverterTest.java | 4 +- .../SimpleSoapAttachmentValidatorTest.java | 10 +- .../ws/xml/SendSoapFaultTest.java | 2 +- .../ws/yaml/SendSoapFaultTest.java | 2 +- .../config/xml/ZooExecuteActionParser.java | 2 +- .../actions/ZooExecuteActionTest.java | 2 +- .../config/xml/ZooClientParserTest.java | 2 +- .../config/xml/StepTemplateParser.java | 3 +- .../cucumber/UnitTestSupport.java | 2 +- .../config/xml/GroovyActionParser.java | 2 +- .../dsl/GroovyTestActionBuilderTest.java | 4 +- .../xml/ReceiveMessageActionParserTest.java | 2 +- .../xml/SendMessageActionParserTest.java | 2 +- .../junit/jupiter/CitrusExtension.java | 4 +- .../jupiter/spring/CitrusSpringExtension.java | 2 +- .../integration/FailJUnitJupiterIT.java | 2 +- .../spring/TestSuiteExecutionListener.java | 2 +- .../junit/JUnit4TestEngineTest.java | 2 +- .../ReceiveMessageTestActionBuilderTest.java | 6 +- .../dsl/SendMessageTestActionBuilderTest.java | 4 +- .../dsl/TransformTestActionBuilderTest.java | 2 +- .../integration/container/WaitJavaIT.java | 2 +- .../agent/ThrowingHandler.java | 2 +- .../cucumber/steps/camel/CamelSteps.java | 4 +- .../ConnectionFactoryCreatorTest.java | 4 +- .../docs/AbstractTestDocsGenerator.java | 3 +- .../docs/ExcelTestDocsGenerator.java | 2 +- .../docs/SvgTestDocsGenerator.java | 4 +- .../docs/AbstractTestDocsGeneratorTest.java | 4 +- .../jbang/CitrusJBangMain.java | 2 +- .../citrusframework/jbang/commands/Agent.java | 2 +- .../jbang/commands/AgentRun.java | 2 +- .../jbang/commands/AgentStart.java | 2 +- .../jbang/commands/Complete.java | 2 +- .../jbang/commands/ListTests.java | 2 +- .../citrusframework/jbang/commands/Run.java | 2 +- .../agent/plugin/RunTestMojo.java | 91 ++++++++++--------- .../kubernetes/KubernetesManifestHelper.java | 2 +- .../mvn/plugin/AbstractCitrusMojo.java | 3 +- .../mvn/plugin/CreateDocsMojo.java | 2 +- .../mvn/plugin/CreateTestMojo.java | 5 +- .../mvn/plugin/GenerateDocsMojo.java | 2 +- .../mvn/plugin/GenerateTestMojo.java | 2 +- .../mvn/plugin/GenerateDocsMojoTest.java | 4 +- .../mvn/plugin/GenerateTestMojoTest.java | 8 +- .../soap/RestDocSoapRequestConverter.java | 2 +- .../util/RestDocTestNameFormatterTest.java | 2 +- .../javadsl/XsdJavaTestGeneratorTest.java | 2 +- .../generate/xml/XsdXmlTestGeneratorTest.java | 2 +- .../ExecuteSQLQueryTestActionBuilderTest.java | 4 +- .../dsl/ReceiveMessageActionBuilderTest.java | 4 +- .../DefaultMessageHeaderValidatorTest.java | 4 +- .../validation/ValidationUtilsTest.java | 4 +- .../xml/JsonDataDictionaryParserTest.java | 2 +- .../xml/JsonPathDataDictionaryParserTest.java | 2 +- .../JsonPayloadMappingKeyExtractorTest.java | 6 +- .../functions/core/JsonPathFunctionTest.java | 6 +- .../json/JsonPathVariableExtractorTest.java | 2 +- .../json/JsonMappingDataDictionaryTest.java | 2 +- .../JsonPathMappingDataDictionaryTest.java | 2 +- .../GzipBinaryBase64MessageValidatorTest.java | 2 +- .../xml/schema/AbstractSchemaCollection.java | 4 +- .../dsl/ReceiveMessageActionBuilderTest.java | 6 +- .../xml/XmlDataDictionaryParserTest.java | 2 +- .../xml/XpathDataDictionaryParserTest.java | 2 +- ...tBehaviorExecutingEndpointAdapterTest.java | 8 +- .../XmlTestExecutingEndpointAdapterTest.java | 8 +- .../XPathPayloadMappingKeyExtractorTest.java | 6 +- .../functions/XmlFunctionsTest.java | 6 +- .../functions/core/XpathFunctionTest.java | 6 +- .../citrusframework/util/XMLUtilsTest.java | 4 +- .../xml/DomXmlMessageValidatorTest.java | 10 +- .../xml/NodeMappingDataDictionaryTest.java | 2 +- .../xml/XpathMappingDataDictionaryTest.java | 14 +-- 308 files changed, 587 insertions(+), 604 deletions(-) diff --git a/connectors/citrus-docker/src/main/java/org/citrusframework/docker/config/xml/DockerExecuteActionParser.java b/connectors/citrus-docker/src/main/java/org/citrusframework/docker/config/xml/DockerExecuteActionParser.java index bb6bcd5bac..ef8cf03a0c 100644 --- a/connectors/citrus-docker/src/main/java/org/citrusframework/docker/config/xml/DockerExecuteActionParser.java +++ b/connectors/citrus-docker/src/main/java/org/citrusframework/docker/config/xml/DockerExecuteActionParser.java @@ -163,7 +163,7 @@ public void setExpectedCommandResult(String expectedCommandResult) { } @Override - public DockerExecuteAction getObject() throws Exception { + public DockerExecuteAction getObject() { if (dockerClient != null) { builder.client(dockerClient); } diff --git a/connectors/citrus-docker/src/test/java/org/citrusframework/docker/actions/DockerExecuteActionTest.java b/connectors/citrus-docker/src/test/java/org/citrusframework/docker/actions/DockerExecuteActionTest.java index 140ad551d8..d0ba0c46d3 100644 --- a/connectors/citrus-docker/src/test/java/org/citrusframework/docker/actions/DockerExecuteActionTest.java +++ b/connectors/citrus-docker/src/test/java/org/citrusframework/docker/actions/DockerExecuteActionTest.java @@ -56,7 +56,7 @@ public void setup() { } @Test - public void testCustomCommand() throws Exception { + public void testCustomCommand() { InfoCmd command = Mockito.mock(InfoCmd.class); com.github.dockerjava.api.model.Info result = new com.github.dockerjava.api.model.Info(); @@ -76,7 +76,7 @@ public void testCustomCommand() throws Exception { } @Test - public void testInfo() throws Exception { + public void testInfo() { InfoCmd command = Mockito.mock(InfoCmd.class); com.github.dockerjava.api.model.Info result = new com.github.dockerjava.api.model.Info(); @@ -96,7 +96,7 @@ public void testInfo() throws Exception { } @Test - public void testPing() throws Exception { + public void testPing() { PingCmd command = Mockito.mock(PingCmd.class); reset(dockerClient, command); @@ -114,7 +114,7 @@ public void testPing() throws Exception { } @Test - public void testVersion() throws Exception { + public void testVersion() { VersionCmd command = Mockito.mock(VersionCmd.class); com.github.dockerjava.api.model.Version result = new com.github.dockerjava.api.model.Version(); @@ -134,7 +134,7 @@ public void testVersion() throws Exception { } @Test - public void testCreate() throws Exception { + public void testCreate() { CreateContainerCmd command = Mockito.mock(CreateContainerCmd.class); CreateContainerResponse response = new CreateContainerResponse(); response.setId(UUID.randomUUID().toString()); @@ -159,7 +159,7 @@ public void testCreate() throws Exception { } @Test - public void testCreateNoName() throws Exception { + public void testCreateNoName() { CreateContainerCmd command = Mockito.mock(CreateContainerCmd.class); InspectContainerCmd inspectCommand = Mockito.mock(InspectContainerCmd.class); @@ -189,7 +189,7 @@ public void testCreateNoName() throws Exception { } @Test - public void testCreateWithEnvArgs() throws Exception { + public void testCreateWithEnvArgs() { CreateContainerCmd command = Mockito.mock(CreateContainerCmd.class); CreateContainerResponse response = Mockito.mock(CreateContainerResponse.class); @@ -222,7 +222,7 @@ public void testCreateWithEnvArgs() throws Exception { } @Test - public void testCreateWithVolumeArgs() throws Exception { + public void testCreateWithVolumeArgs() { CreateContainerCmd command = Mockito.mock(CreateContainerCmd.class); CreateContainerResponse response = Mockito.mock(CreateContainerResponse.class); @@ -264,7 +264,7 @@ public void testCreateWithVolumeArgs() throws Exception { } @Test - public void testInspectContainer() throws Exception { + public void testInspectContainer() { InspectContainerCmd command = Mockito.mock(InspectContainerCmd.class); InspectContainerResponse response = new InspectContainerResponse(); @@ -285,7 +285,7 @@ public void testInspectContainer() throws Exception { } @Test - public void testInspectImage() throws Exception { + public void testInspectImage() { InspectImageCmd command = Mockito.mock(InspectImageCmd.class); InspectImageResponse response = new InspectImageResponse(); @@ -306,7 +306,7 @@ public void testInspectImage() throws Exception { } @Test - public void testRemoveContainer() throws Exception { + public void testRemoveContainer() { RemoveContainerCmd command = Mockito.mock(RemoveContainerCmd.class); reset(dockerClient, command); @@ -325,7 +325,7 @@ public void testRemoveContainer() throws Exception { } @Test - public void testRemoveImage() throws Exception { + public void testRemoveImage() { RemoveImageCmd command = Mockito.mock(RemoveImageCmd.class); reset(dockerClient, command); @@ -344,7 +344,7 @@ public void testRemoveImage() throws Exception { } @Test - public void testStartContainer() throws Exception { + public void testStartContainer() { StartContainerCmd command = Mockito.mock(StartContainerCmd.class); reset(dockerClient, command); @@ -363,7 +363,7 @@ public void testStartContainer() throws Exception { } @Test - public void testStopContainer() throws Exception { + public void testStopContainer() { StopContainerCmd command = Mockito.mock(StopContainerCmd.class); reset(dockerClient, command); @@ -382,7 +382,7 @@ public void testStopContainer() throws Exception { } @Test - public void testWaitContainer() throws Exception { + public void testWaitContainer() { WaitContainerCmd command = Mockito.mock(WaitContainerCmd.class); final WaitResponse responseItem = Mockito.mock(WaitResponse.class); @@ -410,7 +410,7 @@ public void testWaitContainer() throws Exception { } @Test - public void testPullImage() throws Exception { + public void testPullImage() { PullImageCmd command = Mockito.mock(PullImageCmd.class); final PullResponseItem responseItem = Mockito.mock(PullResponseItem.class); @@ -441,7 +441,7 @@ public void testPullImage() throws Exception { } @Test - public void testBuildImage() throws Exception { + public void testBuildImage() { BuildImageCmd command = Mockito.mock(BuildImageCmd.class); final BuildResponseItem responseItem = Mockito.mock(BuildResponseItem.class); diff --git a/connectors/citrus-kubernetes/src/main/java/org/citrusframework/kubernetes/config/xml/KubernetesExecuteActionParser.java b/connectors/citrus-kubernetes/src/main/java/org/citrusframework/kubernetes/config/xml/KubernetesExecuteActionParser.java index c40f113fca..2fe6b73270 100644 --- a/connectors/citrus-kubernetes/src/main/java/org/citrusframework/kubernetes/config/xml/KubernetesExecuteActionParser.java +++ b/connectors/citrus-kubernetes/src/main/java/org/citrusframework/kubernetes/config/xml/KubernetesExecuteActionParser.java @@ -184,7 +184,7 @@ public void setCommandResultExpressions(Map commandResultExpress } @Override - public KubernetesExecuteAction getObject() throws Exception { + public KubernetesExecuteAction getObject() { if (referenceResolver != null) { builder.withReferenceResolver(referenceResolver); } else if (applicationContext != null && applicationContext.getBeansOfType(ReferenceResolver.class).size() == 1) { diff --git a/connectors/citrus-kubernetes/src/test/java/org/citrusframework/kubernetes/endpoint/KubernetesEndpointComponentTest.java b/connectors/citrus-kubernetes/src/test/java/org/citrusframework/kubernetes/endpoint/KubernetesEndpointComponentTest.java index 549eb0f75a..176c35fe7d 100644 --- a/connectors/citrus-kubernetes/src/test/java/org/citrusframework/kubernetes/endpoint/KubernetesEndpointComponentTest.java +++ b/connectors/citrus-kubernetes/src/test/java/org/citrusframework/kubernetes/endpoint/KubernetesEndpointComponentTest.java @@ -37,7 +37,7 @@ public class KubernetesEndpointComponentTest { private final TestContext context = new TestContext(); @Test - public void testCreateClientEndpoint() throws Exception { + public void testCreateClientEndpoint() { KubernetesEndpointComponent component = new KubernetesEndpointComponent(); Endpoint endpoint = component.createEndpoint("k8s:localhost:8443/", context); @@ -55,7 +55,7 @@ public void testCreateClientEndpoint() throws Exception { } @Test - public void testCreateClientEndpointWithParameters() throws Exception { + public void testCreateClientEndpointWithParameters() { KubernetesEndpointComponent component = new KubernetesEndpointComponent(); Endpoint endpoint = component.createEndpoint("k8s:localhost:8443?namespace=myNamespace&timeout=10000", context); diff --git a/connectors/citrus-kubernetes/src/test/java/org/citrusframework/kubernetes/xml/AgentDisconnectTest.java b/connectors/citrus-kubernetes/src/test/java/org/citrusframework/kubernetes/xml/AgentDisconnectTest.java index e7fe8a65b0..f234558b4b 100644 --- a/connectors/citrus-kubernetes/src/test/java/org/citrusframework/kubernetes/xml/AgentDisconnectTest.java +++ b/connectors/citrus-kubernetes/src/test/java/org/citrusframework/kubernetes/xml/AgentDisconnectTest.java @@ -53,7 +53,7 @@ public void setup() { } @Test - public void shouldLoadKubernetesActions() throws IOException { + public void shouldLoadKubernetesActions() { String namespace = "test"; context.getReferenceResolver().bind("citrus-agent:port-forward", portForward); context.getReferenceResolver().bind("citrus-agent.client", serviceClient); diff --git a/connectors/citrus-kubernetes/src/test/java/org/citrusframework/kubernetes/xml/DeleteConfigMapTest.java b/connectors/citrus-kubernetes/src/test/java/org/citrusframework/kubernetes/xml/DeleteConfigMapTest.java index 6bd2d7c444..11a5316017 100644 --- a/connectors/citrus-kubernetes/src/test/java/org/citrusframework/kubernetes/xml/DeleteConfigMapTest.java +++ b/connectors/citrus-kubernetes/src/test/java/org/citrusframework/kubernetes/xml/DeleteConfigMapTest.java @@ -30,7 +30,7 @@ public class DeleteConfigMapTest extends AbstractXmlActionTest { @Test - public void shouldLoadKubernetesActions() throws IOException { + public void shouldLoadKubernetesActions() { String namespace = "test"; ConfigMap configMap = new ConfigMapBuilder() .withNewMetadata() diff --git a/connectors/citrus-kubernetes/src/test/java/org/citrusframework/kubernetes/xml/DeleteCustomResourceTest.java b/connectors/citrus-kubernetes/src/test/java/org/citrusframework/kubernetes/xml/DeleteCustomResourceTest.java index bd7711e8c4..75567f14f5 100644 --- a/connectors/citrus-kubernetes/src/test/java/org/citrusframework/kubernetes/xml/DeleteCustomResourceTest.java +++ b/connectors/citrus-kubernetes/src/test/java/org/citrusframework/kubernetes/xml/DeleteCustomResourceTest.java @@ -29,7 +29,7 @@ public class DeleteCustomResourceTest extends AbstractXmlActionTest { @Test - public void shouldLoadKubernetesActions() throws IOException { + public void shouldLoadKubernetesActions() { String namespace = "test"; Foo foo = new Foo(); foo.setSpec(new Foo.FooSpec()); diff --git a/connectors/citrus-kubernetes/src/test/java/org/citrusframework/kubernetes/xml/DeleteSecretTest.java b/connectors/citrus-kubernetes/src/test/java/org/citrusframework/kubernetes/xml/DeleteSecretTest.java index acba79ad9e..58678969d9 100644 --- a/connectors/citrus-kubernetes/src/test/java/org/citrusframework/kubernetes/xml/DeleteSecretTest.java +++ b/connectors/citrus-kubernetes/src/test/java/org/citrusframework/kubernetes/xml/DeleteSecretTest.java @@ -30,7 +30,7 @@ public class DeleteSecretTest extends AbstractXmlActionTest { @Test - public void shouldLoadKubernetesActions() throws IOException { + public void shouldLoadKubernetesActions() { String namespace = "test"; Secret secret = new SecretBuilder() .withNewMetadata() diff --git a/connectors/citrus-kubernetes/src/test/java/org/citrusframework/kubernetes/yaml/AgentDisconnectTest.java b/connectors/citrus-kubernetes/src/test/java/org/citrusframework/kubernetes/yaml/AgentDisconnectTest.java index d332a095fd..08653c4986 100644 --- a/connectors/citrus-kubernetes/src/test/java/org/citrusframework/kubernetes/yaml/AgentDisconnectTest.java +++ b/connectors/citrus-kubernetes/src/test/java/org/citrusframework/kubernetes/yaml/AgentDisconnectTest.java @@ -53,7 +53,7 @@ public void setup() { } @Test - public void shouldLoadKubernetesActions() throws IOException { + public void shouldLoadKubernetesActions() { String namespace = "test"; context.getReferenceResolver().bind("citrus-agent:port-forward", portForward); context.getReferenceResolver().bind("citrus-agent.client", serviceClient); diff --git a/connectors/citrus-kubernetes/src/test/java/org/citrusframework/kubernetes/yaml/DeleteConfigMapTest.java b/connectors/citrus-kubernetes/src/test/java/org/citrusframework/kubernetes/yaml/DeleteConfigMapTest.java index 841dfb5085..876f56af2c 100644 --- a/connectors/citrus-kubernetes/src/test/java/org/citrusframework/kubernetes/yaml/DeleteConfigMapTest.java +++ b/connectors/citrus-kubernetes/src/test/java/org/citrusframework/kubernetes/yaml/DeleteConfigMapTest.java @@ -30,7 +30,7 @@ public class DeleteConfigMapTest extends AbstractYamlActionTest { @Test - public void shouldLoadKubernetesActions() throws IOException { + public void shouldLoadKubernetesActions() { String namespace = "test"; ConfigMap configMap = new ConfigMapBuilder() .withNewMetadata() diff --git a/connectors/citrus-kubernetes/src/test/java/org/citrusframework/kubernetes/yaml/DeleteCustomResourceTest.java b/connectors/citrus-kubernetes/src/test/java/org/citrusframework/kubernetes/yaml/DeleteCustomResourceTest.java index a867c215a9..8b11f6d83d 100644 --- a/connectors/citrus-kubernetes/src/test/java/org/citrusframework/kubernetes/yaml/DeleteCustomResourceTest.java +++ b/connectors/citrus-kubernetes/src/test/java/org/citrusframework/kubernetes/yaml/DeleteCustomResourceTest.java @@ -29,7 +29,7 @@ public class DeleteCustomResourceTest extends AbstractYamlActionTest { @Test - public void shouldLoadKubernetesActions() throws IOException { + public void shouldLoadKubernetesActions() { String namespace = "test"; Foo foo = new Foo(); foo.setSpec(new Foo.FooSpec()); diff --git a/connectors/citrus-kubernetes/src/test/java/org/citrusframework/kubernetes/yaml/DeleteSecretTest.java b/connectors/citrus-kubernetes/src/test/java/org/citrusframework/kubernetes/yaml/DeleteSecretTest.java index 756a503c1b..9c9d0f132b 100644 --- a/connectors/citrus-kubernetes/src/test/java/org/citrusframework/kubernetes/yaml/DeleteSecretTest.java +++ b/connectors/citrus-kubernetes/src/test/java/org/citrusframework/kubernetes/yaml/DeleteSecretTest.java @@ -30,7 +30,7 @@ public class DeleteSecretTest extends AbstractYamlActionTest { @Test - public void shouldLoadKubernetesActions() throws IOException { + public void shouldLoadKubernetesActions() { String namespace = "test"; Secret secret = new SecretBuilder() .withNewMetadata() diff --git a/connectors/citrus-selenium/src/main/java/org/citrusframework/selenium/config/xml/AlertActionParser.java b/connectors/citrus-selenium/src/main/java/org/citrusframework/selenium/config/xml/AlertActionParser.java index f52f80e389..d4c0cac99b 100644 --- a/connectors/citrus-selenium/src/main/java/org/citrusframework/selenium/config/xml/AlertActionParser.java +++ b/connectors/citrus-selenium/src/main/java/org/citrusframework/selenium/config/xml/AlertActionParser.java @@ -74,7 +74,7 @@ public void setText(String text) { } @Override - public AlertAction getObject() throws Exception { + public AlertAction getObject() { return builder.build(); } diff --git a/connectors/citrus-selenium/src/main/java/org/citrusframework/selenium/config/xml/ClearBrowserCacheActionParser.java b/connectors/citrus-selenium/src/main/java/org/citrusframework/selenium/config/xml/ClearBrowserCacheActionParser.java index b36cbda06f..e24711f82d 100644 --- a/connectors/citrus-selenium/src/main/java/org/citrusframework/selenium/config/xml/ClearBrowserCacheActionParser.java +++ b/connectors/citrus-selenium/src/main/java/org/citrusframework/selenium/config/xml/ClearBrowserCacheActionParser.java @@ -43,7 +43,7 @@ public static final class ClearBrowserCacheActionFactoryBean extends AbstractSel private final ClearBrowserCacheAction.Builder builder = new ClearBrowserCacheAction.Builder(); @Override - public ClearBrowserCacheAction getObject() throws Exception { + public ClearBrowserCacheAction getObject() { return builder.build(); } diff --git a/connectors/citrus-selenium/src/main/java/org/citrusframework/selenium/config/xml/CloseWindowActionParser.java b/connectors/citrus-selenium/src/main/java/org/citrusframework/selenium/config/xml/CloseWindowActionParser.java index f5372992fe..8d4a4092a4 100644 --- a/connectors/citrus-selenium/src/main/java/org/citrusframework/selenium/config/xml/CloseWindowActionParser.java +++ b/connectors/citrus-selenium/src/main/java/org/citrusframework/selenium/config/xml/CloseWindowActionParser.java @@ -53,7 +53,7 @@ public void setWindowName(String windowName) { } @Override - public CloseWindowAction getObject() throws Exception { + public CloseWindowAction getObject() { return builder.build(); } diff --git a/connectors/citrus-selenium/src/main/java/org/citrusframework/selenium/config/xml/FindElementActionParser.java b/connectors/citrus-selenium/src/main/java/org/citrusframework/selenium/config/xml/FindElementActionParser.java index 353284829e..54b9415a93 100644 --- a/connectors/citrus-selenium/src/main/java/org/citrusframework/selenium/config/xml/FindElementActionParser.java +++ b/connectors/citrus-selenium/src/main/java/org/citrusframework/selenium/config/xml/FindElementActionParser.java @@ -225,7 +225,7 @@ public void setBy(By by) { getBuilder().element(by); } - public T getObject(B builder) throws Exception { + public T getObject(B builder) { builder.element(property, propertyValue); return builder.build(); } diff --git a/connectors/citrus-selenium/src/main/java/org/citrusframework/selenium/config/xml/GetStoredFileActionParser.java b/connectors/citrus-selenium/src/main/java/org/citrusframework/selenium/config/xml/GetStoredFileActionParser.java index 2878813d2c..2033df0df2 100644 --- a/connectors/citrus-selenium/src/main/java/org/citrusframework/selenium/config/xml/GetStoredFileActionParser.java +++ b/connectors/citrus-selenium/src/main/java/org/citrusframework/selenium/config/xml/GetStoredFileActionParser.java @@ -53,7 +53,7 @@ public void setFileName(String fileName) { } @Override - public GetStoredFileAction getObject() throws Exception { + public GetStoredFileAction getObject() { return builder.build(); } diff --git a/connectors/citrus-selenium/src/main/java/org/citrusframework/selenium/config/xml/JavaScriptActionParser.java b/connectors/citrus-selenium/src/main/java/org/citrusframework/selenium/config/xml/JavaScriptActionParser.java index 5e083bb60b..2c2ec86c1e 100644 --- a/connectors/citrus-selenium/src/main/java/org/citrusframework/selenium/config/xml/JavaScriptActionParser.java +++ b/connectors/citrus-selenium/src/main/java/org/citrusframework/selenium/config/xml/JavaScriptActionParser.java @@ -88,7 +88,7 @@ public void setExpectedErrors(List expectedErrors) { } @Override - public JavaScriptAction getObject() throws Exception { + public JavaScriptAction getObject() { return builder.build(); } diff --git a/connectors/citrus-selenium/src/main/java/org/citrusframework/selenium/config/xml/MakeScreenshotActionParser.java b/connectors/citrus-selenium/src/main/java/org/citrusframework/selenium/config/xml/MakeScreenshotActionParser.java index 0753eadfbb..14f3df62a4 100644 --- a/connectors/citrus-selenium/src/main/java/org/citrusframework/selenium/config/xml/MakeScreenshotActionParser.java +++ b/connectors/citrus-selenium/src/main/java/org/citrusframework/selenium/config/xml/MakeScreenshotActionParser.java @@ -53,7 +53,7 @@ public void setOutputDir(String outputDir) { } @Override - public MakeScreenshotAction getObject() throws Exception { + public MakeScreenshotAction getObject() { return builder.build(); } diff --git a/connectors/citrus-selenium/src/main/java/org/citrusframework/selenium/config/xml/NavigateActionParser.java b/connectors/citrus-selenium/src/main/java/org/citrusframework/selenium/config/xml/NavigateActionParser.java index b46baabc3e..fc048a0a1f 100644 --- a/connectors/citrus-selenium/src/main/java/org/citrusframework/selenium/config/xml/NavigateActionParser.java +++ b/connectors/citrus-selenium/src/main/java/org/citrusframework/selenium/config/xml/NavigateActionParser.java @@ -53,7 +53,7 @@ public void setPage(String page) { } @Override - public NavigateAction getObject() throws Exception { + public NavigateAction getObject() { return builder.build(); } diff --git a/connectors/citrus-selenium/src/main/java/org/citrusframework/selenium/config/xml/OpenWindowActionParser.java b/connectors/citrus-selenium/src/main/java/org/citrusframework/selenium/config/xml/OpenWindowActionParser.java index dd307b99c6..13168b089c 100644 --- a/connectors/citrus-selenium/src/main/java/org/citrusframework/selenium/config/xml/OpenWindowActionParser.java +++ b/connectors/citrus-selenium/src/main/java/org/citrusframework/selenium/config/xml/OpenWindowActionParser.java @@ -53,7 +53,7 @@ public void setWindowName(String windowName) { } @Override - public OpenWindowAction getObject() throws Exception { + public OpenWindowAction getObject() { return builder.build(); } diff --git a/connectors/citrus-selenium/src/main/java/org/citrusframework/selenium/config/xml/PageActionParser.java b/connectors/citrus-selenium/src/main/java/org/citrusframework/selenium/config/xml/PageActionParser.java index 74f98819b1..fdaac69ec8 100644 --- a/connectors/citrus-selenium/src/main/java/org/citrusframework/selenium/config/xml/PageActionParser.java +++ b/connectors/citrus-selenium/src/main/java/org/citrusframework/selenium/config/xml/PageActionParser.java @@ -105,7 +105,7 @@ public void setArguments(List arguments) { } @Override - public PageAction getObject() throws Exception { + public PageAction getObject() { return builder.build(); } diff --git a/connectors/citrus-selenium/src/main/java/org/citrusframework/selenium/config/xml/StartBrowserActionParser.java b/connectors/citrus-selenium/src/main/java/org/citrusframework/selenium/config/xml/StartBrowserActionParser.java index ea2dff56e1..cb08a89027 100644 --- a/connectors/citrus-selenium/src/main/java/org/citrusframework/selenium/config/xml/StartBrowserActionParser.java +++ b/connectors/citrus-selenium/src/main/java/org/citrusframework/selenium/config/xml/StartBrowserActionParser.java @@ -51,7 +51,7 @@ public void setAllowAlreadyStarted(boolean allowAlreadyStarted) { } @Override - public StartBrowserAction getObject() throws Exception { + public StartBrowserAction getObject() { return builder.build(); } diff --git a/connectors/citrus-selenium/src/main/java/org/citrusframework/selenium/config/xml/StopBrowserActionParser.java b/connectors/citrus-selenium/src/main/java/org/citrusframework/selenium/config/xml/StopBrowserActionParser.java index 97960484cb..e5a82dc654 100644 --- a/connectors/citrus-selenium/src/main/java/org/citrusframework/selenium/config/xml/StopBrowserActionParser.java +++ b/connectors/citrus-selenium/src/main/java/org/citrusframework/selenium/config/xml/StopBrowserActionParser.java @@ -43,7 +43,7 @@ public static final class StopBrowserActionFactoryBean extends AbstractSeleniumA private final StopBrowserAction.Builder builder = new StopBrowserAction.Builder(); @Override - public StopBrowserAction getObject() throws Exception { + public StopBrowserAction getObject() { return builder.build(); } diff --git a/connectors/citrus-selenium/src/main/java/org/citrusframework/selenium/config/xml/StoreFileActionParser.java b/connectors/citrus-selenium/src/main/java/org/citrusframework/selenium/config/xml/StoreFileActionParser.java index 0ef7e7475c..832fd12939 100644 --- a/connectors/citrus-selenium/src/main/java/org/citrusframework/selenium/config/xml/StoreFileActionParser.java +++ b/connectors/citrus-selenium/src/main/java/org/citrusframework/selenium/config/xml/StoreFileActionParser.java @@ -53,7 +53,7 @@ public void setFilePath(String filePath) { } @Override - public StoreFileAction getObject() throws Exception { + public StoreFileAction getObject() { return builder.build(); } diff --git a/connectors/citrus-selenium/src/main/java/org/citrusframework/selenium/config/xml/SwitchWindowActionParser.java b/connectors/citrus-selenium/src/main/java/org/citrusframework/selenium/config/xml/SwitchWindowActionParser.java index 22f82bdafd..ab99226b0c 100644 --- a/connectors/citrus-selenium/src/main/java/org/citrusframework/selenium/config/xml/SwitchWindowActionParser.java +++ b/connectors/citrus-selenium/src/main/java/org/citrusframework/selenium/config/xml/SwitchWindowActionParser.java @@ -53,7 +53,7 @@ public void setWindowName(String windowName) { } @Override - public SwitchWindowAction getObject() throws Exception { + public SwitchWindowAction getObject() { return builder.build(); } diff --git a/connectors/citrus-selenium/src/test/java/org/citrusframework/selenium/actions/AlertActionTest.java b/connectors/citrus-selenium/src/test/java/org/citrusframework/selenium/actions/AlertActionTest.java index 87dd81607d..300dff1364 100644 --- a/connectors/citrus-selenium/src/test/java/org/citrusframework/selenium/actions/AlertActionTest.java +++ b/connectors/citrus-selenium/src/test/java/org/citrusframework/selenium/actions/AlertActionTest.java @@ -58,7 +58,7 @@ public void setup() { } @Test - public void testExecuteAccept() throws Exception { + public void testExecuteAccept() { when(locator.alert()).thenReturn(alert); AlertAction action = new AlertAction.Builder() @@ -70,7 +70,7 @@ public void testExecuteAccept() throws Exception { } @Test - public void testExecuteDismiss() throws Exception { + public void testExecuteDismiss() { WebDriver.TargetLocator locator = Mockito.mock(WebDriver.TargetLocator.class); when(webDriver.switchTo()).thenReturn(locator); when(locator.alert()).thenReturn(alert); @@ -85,7 +85,7 @@ public void testExecuteDismiss() throws Exception { } @Test - public void testExecuteTextValidation() throws Exception { + public void testExecuteTextValidation() { when(locator.alert()).thenReturn(alert); AlertAction action = new AlertAction.Builder() @@ -98,7 +98,7 @@ public void testExecuteTextValidation() throws Exception { } @Test - public void testExecuteTextValidationVariableSupport() throws Exception { + public void testExecuteTextValidationVariableSupport() { when(locator.alert()).thenReturn(alert); context.setVariable("alertText","This is a warning!"); @@ -112,7 +112,7 @@ public void testExecuteTextValidationVariableSupport() throws Exception { } @Test - public void testExecuteTextValidationMatcherSupport() throws Exception { + public void testExecuteTextValidationMatcherSupport() { when(locator.alert()).thenReturn(alert); AlertAction action = new AlertAction.Builder() @@ -125,7 +125,7 @@ public void testExecuteTextValidationMatcherSupport() throws Exception { } @Test(expectedExceptions = ValidationException.class, expectedExceptionsMessageRegExp = "Failed to validate alert dialog text.*") - public void testExecuteTextValidationError() throws Exception { + public void testExecuteTextValidationError() { when(locator.alert()).thenReturn(alert); AlertAction action = new AlertAction.Builder() diff --git a/connectors/citrus-selenium/src/test/java/org/citrusframework/selenium/actions/CheckInputActionTest.java b/connectors/citrus-selenium/src/test/java/org/citrusframework/selenium/actions/CheckInputActionTest.java index a0308a6ba8..e710df5288 100644 --- a/connectors/citrus-selenium/src/test/java/org/citrusframework/selenium/actions/CheckInputActionTest.java +++ b/connectors/citrus-selenium/src/test/java/org/citrusframework/selenium/actions/CheckInputActionTest.java @@ -48,7 +48,7 @@ public void setup() { } @Test - public void testExecuteCheck() throws Exception { + public void testExecuteCheck() { when(webDriver.findElement(any(By.class))).thenReturn(element); when(element.isSelected()).thenReturn(false); @@ -65,7 +65,7 @@ public void testExecuteCheck() throws Exception { } @Test - public void testExecuteUncheck() throws Exception { + public void testExecuteUncheck() { when(webDriver.findElement(any(By.class))).thenReturn(element); when(element.isSelected()).thenReturn(true); @@ -81,7 +81,7 @@ public void testExecuteUncheck() throws Exception { } @Test - public void testExecuteAlreadyChecked() throws Exception { + public void testExecuteAlreadyChecked() { when(webDriver.findElement(any(By.class))).thenReturn(element); when(element.isSelected()).thenReturn(true); diff --git a/connectors/citrus-selenium/src/test/java/org/citrusframework/selenium/actions/ClearBrowserCacheActionTest.java b/connectors/citrus-selenium/src/test/java/org/citrusframework/selenium/actions/ClearBrowserCacheActionTest.java index 3903eab508..b1a554cee3 100644 --- a/connectors/citrus-selenium/src/test/java/org/citrusframework/selenium/actions/ClearBrowserCacheActionTest.java +++ b/connectors/citrus-selenium/src/test/java/org/citrusframework/selenium/actions/ClearBrowserCacheActionTest.java @@ -44,7 +44,7 @@ public void setup() { } @Test - public void testExecute() throws Exception { + public void testExecute() { ClearBrowserCacheAction action = new ClearBrowserCacheAction.Builder() .browser(seleniumBrowser) .build(); diff --git a/connectors/citrus-selenium/src/test/java/org/citrusframework/selenium/actions/CloseWindowActionTest.java b/connectors/citrus-selenium/src/test/java/org/citrusframework/selenium/actions/CloseWindowActionTest.java index 7652304b81..2b6ef201ce 100644 --- a/connectors/citrus-selenium/src/test/java/org/citrusframework/selenium/actions/CloseWindowActionTest.java +++ b/connectors/citrus-selenium/src/test/java/org/citrusframework/selenium/actions/CloseWindowActionTest.java @@ -53,7 +53,7 @@ public void setup() { } @Test - public void testCloseActiveWindow() throws Exception { + public void testCloseActiveWindow() { Set windows = new HashSet<>(); windows.add("active_window"); windows.add("last_window"); @@ -77,7 +77,7 @@ public void testCloseActiveWindow() throws Exception { } @Test - public void testCloseActiveWindowReturnToDefault() throws Exception { + public void testCloseActiveWindowReturnToDefault() { Set windows = new HashSet<>(); windows.add("active_window"); windows.add("main_window"); @@ -100,7 +100,7 @@ public void testCloseActiveWindowReturnToDefault() throws Exception { } @Test - public void testCloseOtherWindow() throws Exception { + public void testCloseOtherWindow() { Set windows = new HashSet<>(); windows.add("active_window"); windows.add("last_window"); @@ -128,7 +128,7 @@ public void testCloseOtherWindow() throws Exception { } @Test - public void testCloseOtherWindowNoActiveWindow() throws Exception { + public void testCloseOtherWindowNoActiveWindow() { Set windows = new HashSet<>(); windows.add("active_window"); windows.add("other_window"); @@ -153,7 +153,7 @@ public void testCloseOtherWindowNoActiveWindow() throws Exception { } @Test(expectedExceptions = CitrusRuntimeException.class, expectedExceptionsMessageRegExp = "Failed to find window handle.*") - public void testCloseWindowInvalidWindowName() throws Exception { + public void testCloseWindowInvalidWindowName() { CloseWindowAction action = new CloseWindowAction.Builder() .browser(seleniumBrowser) .window("myWindow") @@ -162,7 +162,7 @@ public void testCloseWindowInvalidWindowName() throws Exception { } @Test(expectedExceptions = CitrusRuntimeException.class, expectedExceptionsMessageRegExp = "Failed to find window.*") - public void testCloseWindowNotFound() throws Exception { + public void testCloseWindowNotFound() { Set windows = new HashSet<>(); windows.add("active_window"); windows.add("last_window"); diff --git a/connectors/citrus-selenium/src/test/java/org/citrusframework/selenium/actions/DropDownSelectActionTest.java b/connectors/citrus-selenium/src/test/java/org/citrusframework/selenium/actions/DropDownSelectActionTest.java index 6c9b41684f..295ba26b1c 100644 --- a/connectors/citrus-selenium/src/test/java/org/citrusframework/selenium/actions/DropDownSelectActionTest.java +++ b/connectors/citrus-selenium/src/test/java/org/citrusframework/selenium/actions/DropDownSelectActionTest.java @@ -52,7 +52,7 @@ public void setup() { } @Test - public void testExecuteSelect() throws Exception { + public void testExecuteSelect() { WebElement option = Mockito.mock(WebElement.class); when(webDriver.findElement(any(By.class))).thenReturn(element); @@ -72,7 +72,7 @@ public void testExecuteSelect() throws Exception { } @Test - public void testExecuteMultiSelect() throws Exception { + public void testExecuteMultiSelect() { WebElement option = Mockito.mock(WebElement.class); seleniumBrowser.getEndpointConfiguration().setBrowserType(Browser.IE.browserName()); diff --git a/connectors/citrus-selenium/src/test/java/org/citrusframework/selenium/actions/FillFormActionTest.java b/connectors/citrus-selenium/src/test/java/org/citrusframework/selenium/actions/FillFormActionTest.java index df6d3cea87..9dd01513b3 100644 --- a/connectors/citrus-selenium/src/test/java/org/citrusframework/selenium/actions/FillFormActionTest.java +++ b/connectors/citrus-selenium/src/test/java/org/citrusframework/selenium/actions/FillFormActionTest.java @@ -47,7 +47,7 @@ public void setup() { } @Test - public void testExecute() throws Exception { + public void testExecute() { when(webDriver.findElement(any(By.class))).thenReturn(element); FillFormAction action = new FillFormAction.Builder() @@ -63,7 +63,7 @@ public void testExecute() throws Exception { } @Test - public void testExecuteWithSelect() throws Exception { + public void testExecuteWithSelect() { WebElement option = Mockito.mock(WebElement.class); when(webDriver.findElement(any(By.class))).thenReturn(element); @@ -83,7 +83,7 @@ public void testExecuteWithSelect() throws Exception { } @Test - public void testExecuteWithJson() throws Exception { + public void testExecuteWithJson() { when(webDriver.findElement(any(By.class))).thenReturn(element); FillFormAction action = new FillFormAction.Builder() @@ -103,7 +103,7 @@ public void testExecuteWithJson() throws Exception { } @Test - public void testExecuteWithFormSubmit() throws Exception { + public void testExecuteWithFormSubmit() { when(webDriver.findElement(any(By.class))).thenReturn(element); FillFormAction action = new FillFormAction.Builder() diff --git a/connectors/citrus-selenium/src/test/java/org/citrusframework/selenium/actions/GetStoredFileActionTest.java b/connectors/citrus-selenium/src/test/java/org/citrusframework/selenium/actions/GetStoredFileActionTest.java index c95eb4abbe..b853802174 100644 --- a/connectors/citrus-selenium/src/test/java/org/citrusframework/selenium/actions/GetStoredFileActionTest.java +++ b/connectors/citrus-selenium/src/test/java/org/citrusframework/selenium/actions/GetStoredFileActionTest.java @@ -44,7 +44,7 @@ public void setup() { } @Test - public void testExecute() throws Exception { + public void testExecute() { seleniumBrowser.storeFile("classpath:download/file.txt"); GetStoredFileAction action = new GetStoredFileAction.Builder() @@ -57,7 +57,7 @@ public void testExecute() throws Exception { } @Test(expectedExceptions = CitrusRuntimeException.class, expectedExceptionsMessageRegExp = "Failed to access stored file.*") - public void testExecuteError() throws Exception { + public void testExecuteError() { GetStoredFileAction action = new GetStoredFileAction.Builder() .browser(seleniumBrowser) .fileName("unknown.txt") diff --git a/connectors/citrus-selenium/src/test/java/org/citrusframework/selenium/actions/HoverActionTest.java b/connectors/citrus-selenium/src/test/java/org/citrusframework/selenium/actions/HoverActionTest.java index 2745d7a876..2b785a7c8a 100644 --- a/connectors/citrus-selenium/src/test/java/org/citrusframework/selenium/actions/HoverActionTest.java +++ b/connectors/citrus-selenium/src/test/java/org/citrusframework/selenium/actions/HoverActionTest.java @@ -52,7 +52,7 @@ public void setup() { } @Test - public void testExecute() throws Exception { + public void testExecute() { Coordinates coordinates = Mockito.mock(Coordinates.class); when(element.getCoordinates()).thenReturn(coordinates); diff --git a/connectors/citrus-selenium/src/test/java/org/citrusframework/selenium/actions/JavaScriptActionTest.java b/connectors/citrus-selenium/src/test/java/org/citrusframework/selenium/actions/JavaScriptActionTest.java index 5ec6b5f86d..d40b0999cd 100644 --- a/connectors/citrus-selenium/src/test/java/org/citrusframework/selenium/actions/JavaScriptActionTest.java +++ b/connectors/citrus-selenium/src/test/java/org/citrusframework/selenium/actions/JavaScriptActionTest.java @@ -50,7 +50,7 @@ public void setup() { } @Test - public void testExecute() throws Exception { + public void testExecute() { when(webDriver.executeScript(eq("return window._selenide_jsErrors"))).thenReturn(Collections.emptyList()); JavaScriptAction action = new JavaScriptAction.Builder() @@ -66,7 +66,7 @@ public void testExecute() throws Exception { } @Test - public void testExecuteVariableSupport() throws Exception { + public void testExecuteVariableSupport() { when(webDriver.executeScript(eq("return window._selenide_jsErrors"))).thenReturn(Collections.emptyList()); context.setVariable("text", "Hello"); @@ -84,7 +84,7 @@ public void testExecuteVariableSupport() throws Exception { } @Test - public void testExecuteWithErrorValidation() throws Exception { + public void testExecuteWithErrorValidation() { when(webDriver.executeScript(eq("return window._selenide_jsErrors"))).thenReturn(Collections.singletonList("This went totally wrong!")); JavaScriptAction action = new JavaScriptAction.Builder() @@ -101,7 +101,7 @@ public void testExecuteWithErrorValidation() throws Exception { } @Test(expectedExceptions = ValidationException.class) - public void testExecuteWithErrorValidationFailed() throws Exception { + public void testExecuteWithErrorValidationFailed() { when(webDriver.executeScript(eq("return window._selenide_jsErrors"))).thenReturn(Collections.emptyList()); JavaScriptAction action = new JavaScriptAction.Builder() diff --git a/connectors/citrus-selenium/src/test/java/org/citrusframework/selenium/actions/MakeScreenshotActionTest.java b/connectors/citrus-selenium/src/test/java/org/citrusframework/selenium/actions/MakeScreenshotActionTest.java index 87692e6bdb..0fddae15e0 100644 --- a/connectors/citrus-selenium/src/test/java/org/citrusframework/selenium/actions/MakeScreenshotActionTest.java +++ b/connectors/citrus-selenium/src/test/java/org/citrusframework/selenium/actions/MakeScreenshotActionTest.java @@ -49,7 +49,7 @@ public void setup() { } @Test - public void testExecute() throws Exception { + public void testExecute() { when(webDriver.getScreenshotAs(OutputType.FILE)).thenReturn(Resources.fromClasspath("screenshot.png").getFile()); MakeScreenshotAction action = new MakeScreenshotAction.Builder() @@ -63,7 +63,7 @@ public void testExecute() throws Exception { } @Test - public void testExecuteOutputDir() throws Exception { + public void testExecuteOutputDir() { when(webDriver.getScreenshotAs(OutputType.FILE)).thenReturn(Resources.fromClasspath("screenshot.png").getFile()); context.setVariable(CitrusSettings.TEST_NAME_VARIABLE, "MyTest"); diff --git a/connectors/citrus-selenium/src/test/java/org/citrusframework/selenium/actions/OpenWindowActionTest.java b/connectors/citrus-selenium/src/test/java/org/citrusframework/selenium/actions/OpenWindowActionTest.java index 7671f70ea2..2e268a50c7 100644 --- a/connectors/citrus-selenium/src/test/java/org/citrusframework/selenium/actions/OpenWindowActionTest.java +++ b/connectors/citrus-selenium/src/test/java/org/citrusframework/selenium/actions/OpenWindowActionTest.java @@ -55,7 +55,7 @@ public void setup() { } @Test - public void testOpenWindow() throws Exception { + public void testOpenWindow() { Set windows = new HashSet<>(); windows.add("active_window"); windows.add("new_window"); @@ -79,7 +79,7 @@ public void testOpenWindow() throws Exception { } @Test(expectedExceptions = CitrusRuntimeException.class, expectedExceptionsMessageRegExp = "Failed to open new window") - public void testOpenWindowFailed() throws Exception { + public void testOpenWindowFailed() { when(webDriver.getWindowHandles()).thenReturn(Collections.singleton("active_window")); when(webDriver.getWindowHandle()).thenReturn("active_window"); diff --git a/connectors/citrus-selenium/src/test/java/org/citrusframework/selenium/actions/PageActionTest.java b/connectors/citrus-selenium/src/test/java/org/citrusframework/selenium/actions/PageActionTest.java index eb5cb752fd..b3855c34d0 100644 --- a/connectors/citrus-selenium/src/test/java/org/citrusframework/selenium/actions/PageActionTest.java +++ b/connectors/citrus-selenium/src/test/java/org/citrusframework/selenium/actions/PageActionTest.java @@ -75,7 +75,7 @@ public void setup() { } @Test - public void testExecutePageValidation() throws Exception { + public void testExecutePageValidation() { when(inputElement.getAttribute("value")).thenReturn("TestUser"); PageAction action = new PageAction.Builder() @@ -87,7 +87,7 @@ public void testExecutePageValidation() throws Exception { } @Test - public void testExecutePageType() throws Exception { + public void testExecutePageType() { when(inputElement.getAttribute("value")).thenReturn("TestUser"); PageAction action = new PageAction.Builder() @@ -99,7 +99,7 @@ public void testExecutePageType() throws Exception { } @Test - public void testExecutePageValidator() throws Exception { + public void testExecutePageValidator() { when(inputElement.getAttribute("value")).thenReturn("TestUser"); UserFormPage userForm = new UserFormPage(); @@ -116,7 +116,7 @@ public void testExecutePageValidator() throws Exception { } @Test - public void testExecuteAction() throws Exception { + public void testExecuteAction() { PageAction action = new PageAction.Builder() .browser(seleniumBrowser) .action("setUserName") @@ -130,7 +130,7 @@ public void testExecuteAction() throws Exception { } @Test - public void testExecuteActionWithArguments() throws Exception { + public void testExecuteActionWithArguments() { when(webDriver.findElement(By.id("form"))).thenReturn(formElement); PageAction action = new PageAction.Builder() @@ -167,7 +167,7 @@ public void testExecuteActionWithArguments() throws Exception { } @Test(expectedExceptions = CitrusRuntimeException.class, expectedExceptionsMessageRegExp = "Unsupported method signature for page action.*") - public void testExecuteActionNotMatchingArguments() throws Exception { + public void testExecuteActionNotMatchingArguments() { when(webDriver.findElement(By.id("form"))).thenReturn(formElement); PageAction action = new PageAction.Builder() @@ -185,7 +185,7 @@ public void testExecuteActionNotMatchingArguments() throws Exception { } @Test(expectedExceptions = ValidationException.class, expectedExceptionsMessageRegExp = "Page validation failed!") - public void testExecuteValidationFailed() throws Exception { + public void testExecuteValidationFailed() { PageAction action = new PageAction.Builder() .browser(seleniumBrowser) .action("validate") @@ -195,7 +195,7 @@ public void testExecuteValidationFailed() throws Exception { } @Test(expectedExceptions = CitrusRuntimeException.class, expectedExceptionsMessageRegExp = "Failed to access page type.*") - public void testInvalidPageType() throws Exception { + public void testInvalidPageType() { PageAction action = new PageAction.Builder() .browser(seleniumBrowser) diff --git a/connectors/citrus-selenium/src/test/java/org/citrusframework/selenium/actions/SetInputActionTest.java b/connectors/citrus-selenium/src/test/java/org/citrusframework/selenium/actions/SetInputActionTest.java index 91290094c8..f19b3f90cc 100644 --- a/connectors/citrus-selenium/src/test/java/org/citrusframework/selenium/actions/SetInputActionTest.java +++ b/connectors/citrus-selenium/src/test/java/org/citrusframework/selenium/actions/SetInputActionTest.java @@ -53,7 +53,7 @@ public void setup() { } @Test - public void testExecute() throws Exception { + public void testExecute() { when(webDriver.findElement(any(By.class))).thenReturn(element); SetInputAction action = new SetInputAction.Builder() @@ -68,7 +68,7 @@ public void testExecute() throws Exception { } @Test - public void testExecuteOnSelect() throws Exception { + public void testExecuteOnSelect() { WebElement option = Mockito.mock(WebElement.class); when(webDriver.findElement(any(By.class))).thenReturn(element); diff --git a/connectors/citrus-selenium/src/test/java/org/citrusframework/selenium/actions/StartBrowserActionTest.java b/connectors/citrus-selenium/src/test/java/org/citrusframework/selenium/actions/StartBrowserActionTest.java index 2b800e0d21..b1664cba1b 100644 --- a/connectors/citrus-selenium/src/test/java/org/citrusframework/selenium/actions/StartBrowserActionTest.java +++ b/connectors/citrus-selenium/src/test/java/org/citrusframework/selenium/actions/StartBrowserActionTest.java @@ -54,7 +54,7 @@ public void setup() { } @Test - public void testStart() throws Exception { + public void testStart() { when(seleniumBrowser.isStarted()).thenReturn(false); StartBrowserAction action = new StartBrowserAction.Builder() @@ -68,7 +68,7 @@ public void testStart() throws Exception { } @Test - public void testStartWithStartPage() throws Exception { + public void testStartWithStartPage() { when(seleniumBrowser.isStarted()).thenReturn(false); when(seleniumBrowserConfiguration.getStartPageUrl()).thenReturn("http://localhost:8080"); @@ -89,7 +89,7 @@ public void testStartWithStartPage() throws Exception { } @Test - public void testStartAlreadyStarted() throws Exception { + public void testStartAlreadyStarted() { when(seleniumBrowser.isStarted()).thenReturn(true); StartBrowserAction action = new StartBrowserAction.Builder() @@ -104,7 +104,7 @@ public void testStartAlreadyStarted() throws Exception { } @Test - public void testStartAlreadyStartedNotAllowed() throws Exception { + public void testStartAlreadyStartedNotAllowed() { when(seleniumBrowser.isStarted()).thenReturn(true); StartBrowserAction action = new StartBrowserAction.Builder() diff --git a/connectors/citrus-selenium/src/test/java/org/citrusframework/selenium/actions/StopBrowserActionTest.java b/connectors/citrus-selenium/src/test/java/org/citrusframework/selenium/actions/StopBrowserActionTest.java index 4af807e044..4bfc8976fd 100644 --- a/connectors/citrus-selenium/src/test/java/org/citrusframework/selenium/actions/StopBrowserActionTest.java +++ b/connectors/citrus-selenium/src/test/java/org/citrusframework/selenium/actions/StopBrowserActionTest.java @@ -46,7 +46,7 @@ public void setup() { } @Test - public void testStop() throws Exception { + public void testStop() { context.setVariable(SeleniumHeaders.SELENIUM_BROWSER, "ChromeBrowser"); StopBrowserAction action = new StopBrowserAction.Builder() diff --git a/connectors/citrus-selenium/src/test/java/org/citrusframework/selenium/actions/StoreFileActionTest.java b/connectors/citrus-selenium/src/test/java/org/citrusframework/selenium/actions/StoreFileActionTest.java index 307937b30f..d5a72bac35 100644 --- a/connectors/citrus-selenium/src/test/java/org/citrusframework/selenium/actions/StoreFileActionTest.java +++ b/connectors/citrus-selenium/src/test/java/org/citrusframework/selenium/actions/StoreFileActionTest.java @@ -42,7 +42,7 @@ public void setup() { } @Test - public void testExecute() throws Exception { + public void testExecute() { StoreFileAction action = new StoreFileAction.Builder() .browser(seleniumBrowser) .filePath("classpath:download/file.txt") @@ -53,7 +53,7 @@ public void testExecute() throws Exception { } @Test - public void testExecuteVariableSupport() throws Exception { + public void testExecuteVariableSupport() { context.setVariable("file", "classpath:download/file.xml"); StoreFileAction action = new StoreFileAction.Builder() diff --git a/connectors/citrus-selenium/src/test/java/org/citrusframework/selenium/actions/SwitchWindowActionTest.java b/connectors/citrus-selenium/src/test/java/org/citrusframework/selenium/actions/SwitchWindowActionTest.java index 8a2da96a97..38fef98fe5 100644 --- a/connectors/citrus-selenium/src/test/java/org/citrusframework/selenium/actions/SwitchWindowActionTest.java +++ b/connectors/citrus-selenium/src/test/java/org/citrusframework/selenium/actions/SwitchWindowActionTest.java @@ -55,7 +55,7 @@ public void setup() { } @Test - public void testSwitchToActiveWindow() throws Exception { + public void testSwitchToActiveWindow() { Set windows = new HashSet<>(); windows.add("active_window"); windows.add("last_window"); @@ -79,7 +79,7 @@ public void testSwitchToActiveWindow() throws Exception { } @Test - public void testSwitchWindow() throws Exception { + public void testSwitchWindow() { Set windows = new HashSet<>(); windows.add("active_window"); windows.add("other_window"); @@ -103,7 +103,7 @@ public void testSwitchWindow() throws Exception { } @Test(expectedExceptions = CitrusRuntimeException.class, expectedExceptionsMessageRegExp = "Failed to find window.*") - public void testSwitchWindowNotFound() throws Exception { + public void testSwitchWindowNotFound() { Set windows = new HashSet<>(); windows.add("active_window"); diff --git a/connectors/citrus-selenium/src/test/java/org/citrusframework/selenium/actions/WaitUntilActionTest.java b/connectors/citrus-selenium/src/test/java/org/citrusframework/selenium/actions/WaitUntilActionTest.java index 98cc6c77a3..8abb732538 100644 --- a/connectors/citrus-selenium/src/test/java/org/citrusframework/selenium/actions/WaitUntilActionTest.java +++ b/connectors/citrus-selenium/src/test/java/org/citrusframework/selenium/actions/WaitUntilActionTest.java @@ -53,7 +53,7 @@ public void setup() { } @Test - public void testWaitForHidden() throws Exception { + public void testWaitForHidden() { when(webDriver.findElement(any(By.class))).thenReturn(element); when(element.isDisplayed()).thenReturn(false); @@ -68,7 +68,7 @@ public void testWaitForHidden() throws Exception { } @Test(expectedExceptions = TimeoutException.class) - public void testWaitForHiddenTimeout() throws Exception { + public void testWaitForHiddenTimeout() { when(webDriver.findElement(any(By.class))).thenReturn(element); when(element.isDisplayed()).thenReturn(true); @@ -82,7 +82,7 @@ public void testWaitForHiddenTimeout() throws Exception { } @Test - public void testWaitForVisible() throws Exception { + public void testWaitForVisible() { when(webDriver.findElement(any(By.class))).thenReturn(element); when(element.isDisplayed()).thenReturn(true); @@ -97,7 +97,7 @@ public void testWaitForVisible() throws Exception { } @Test(expectedExceptions = TimeoutException.class) - public void testWaitForVisibleTimeout() throws Exception { + public void testWaitForVisibleTimeout() { when(webDriver.findElement(any(By.class))).thenReturn(element); when(element.isDisplayed()).thenReturn(false); @@ -111,7 +111,7 @@ public void testWaitForVisibleTimeout() throws Exception { } @Test(expectedExceptions = CitrusRuntimeException.class) - public void testUnsupportedWaitCondition() throws Exception { + public void testUnsupportedWaitCondition() { when(webDriver.findElement(any(By.class))).thenReturn(element); when(element.isDisplayed()).thenReturn(false); diff --git a/connectors/citrus-selenium/src/test/java/org/citrusframework/selenium/endpoint/SeleniumEndpointComponentTest.java b/connectors/citrus-selenium/src/test/java/org/citrusframework/selenium/endpoint/SeleniumEndpointComponentTest.java index 18352a4ceb..2f0a8f4b41 100644 --- a/connectors/citrus-selenium/src/test/java/org/citrusframework/selenium/endpoint/SeleniumEndpointComponentTest.java +++ b/connectors/citrus-selenium/src/test/java/org/citrusframework/selenium/endpoint/SeleniumEndpointComponentTest.java @@ -51,7 +51,7 @@ public void setup() { } @Test - public void testCreateBrowserEndpoint() throws Exception { + public void testCreateBrowserEndpoint() { SeleniumEndpointComponent component = new SeleniumEndpointComponent(); Endpoint endpoint = component.createEndpoint("selenium:browser", context); @@ -69,7 +69,7 @@ public void testCreateBrowserEndpoint() throws Exception { } @Test - public void testCreateBrowserEndpointWithParameters() throws Exception { + public void testCreateBrowserEndpointWithParameters() { SeleniumEndpointComponent component = new SeleniumEndpointComponent(); reset(referenceResolver); diff --git a/connectors/citrus-selenium/src/test/java/org/citrusframework/selenium/groovy/SeleniumTest.java b/connectors/citrus-selenium/src/test/java/org/citrusframework/selenium/groovy/SeleniumTest.java index 76561081e6..74c7fdcd80 100644 --- a/connectors/citrus-selenium/src/test/java/org/citrusframework/selenium/groovy/SeleniumTest.java +++ b/connectors/citrus-selenium/src/test/java/org/citrusframework/selenium/groovy/SeleniumTest.java @@ -110,7 +110,7 @@ public void setupMocks() { } @Test - public void shouldLoadSeleniumActions() throws IOException { + public void shouldLoadSeleniumActions() { GroovyTestLoader testLoader = createTestLoader("classpath:org/citrusframework/selenium/groovy/selenium.citrus.test.groovy"); context.getReferenceResolver().bind("seleniumBrowser", browser); diff --git a/connectors/citrus-selenium/src/test/java/org/citrusframework/selenium/xml/SeleniumTest.java b/connectors/citrus-selenium/src/test/java/org/citrusframework/selenium/xml/SeleniumTest.java index 61689b8b20..a384211179 100644 --- a/connectors/citrus-selenium/src/test/java/org/citrusframework/selenium/xml/SeleniumTest.java +++ b/connectors/citrus-selenium/src/test/java/org/citrusframework/selenium/xml/SeleniumTest.java @@ -111,7 +111,7 @@ public void setupMocks() { } @Test - public void shouldLoadSeleniumActions() throws IOException { + public void shouldLoadSeleniumActions() { XmlTestLoader testLoader = createTestLoader("classpath:org/citrusframework/selenium/xml/selenium.citrus.it.xml"); context.getReferenceResolver().bind("seleniumBrowser", browser); diff --git a/connectors/citrus-selenium/src/test/java/org/citrusframework/selenium/yaml/SeleniumTest.java b/connectors/citrus-selenium/src/test/java/org/citrusframework/selenium/yaml/SeleniumTest.java index 1d27424693..ff3b65b1e1 100644 --- a/connectors/citrus-selenium/src/test/java/org/citrusframework/selenium/yaml/SeleniumTest.java +++ b/connectors/citrus-selenium/src/test/java/org/citrusframework/selenium/yaml/SeleniumTest.java @@ -111,7 +111,7 @@ public void setupMocks() { } @Test - public void shouldLoadSeleniumActions() throws IOException { + public void shouldLoadSeleniumActions() { YamlTestLoader testLoader = createTestLoader("classpath:org/citrusframework/selenium/yaml/selenium.citrus.it.yaml"); context.getReferenceResolver().bind("seleniumBrowser", browser); diff --git a/connectors/citrus-sql/src/main/java/org/citrusframework/config/xml/ExecutePLSQLActionParser.java b/connectors/citrus-sql/src/main/java/org/citrusframework/config/xml/ExecutePLSQLActionParser.java index f33790ab05..2912fa6556 100644 --- a/connectors/citrus-sql/src/main/java/org/citrusframework/config/xml/ExecutePLSQLActionParser.java +++ b/connectors/citrus-sql/src/main/java/org/citrusframework/config/xml/ExecutePLSQLActionParser.java @@ -71,7 +71,7 @@ public static class ExecutePLSQLActionFactoryBean extends AbstractDatabaseConnec private final ExecutePLSQLAction.Builder builder = new ExecutePLSQLAction.Builder(); @Override - public ExecutePLSQLAction getObject() throws Exception { + public ExecutePLSQLAction getObject() { return builder.build(); } diff --git a/connectors/citrus-sql/src/main/java/org/citrusframework/config/xml/SQLActionParser.java b/connectors/citrus-sql/src/main/java/org/citrusframework/config/xml/SQLActionParser.java index 14a5b37d0a..709de945bf 100644 --- a/connectors/citrus-sql/src/main/java/org/citrusframework/config/xml/SQLActionParser.java +++ b/connectors/citrus-sql/src/main/java/org/citrusframework/config/xml/SQLActionParser.java @@ -180,7 +180,7 @@ public static class ExecuteSQLActionFactoryBean extends AbstractDatabaseConnecti private final ExecuteSQLAction.Builder builder = new ExecuteSQLAction.Builder(); @Override - public ExecuteSQLAction getObject() throws Exception { + public ExecuteSQLAction getObject() { return builder.build(); } @@ -215,7 +215,7 @@ public static class ExecuteSQLQueryActionFactoryBean extends AbstractDatabaseCon private final ExecuteSQLQueryAction.Builder builder = new ExecuteSQLQueryAction.Builder(); @Override - public ExecuteSQLQueryAction getObject() throws Exception { + public ExecuteSQLQueryAction getObject() { return builder.build(); } diff --git a/connectors/citrus-sql/src/test/java/org/citrusframework/actions/dsl/ExecutePLSQLTestActionBuilderTest.java b/connectors/citrus-sql/src/test/java/org/citrusframework/actions/dsl/ExecutePLSQLTestActionBuilderTest.java index 9e9168ad47..40649ac407 100644 --- a/connectors/citrus-sql/src/test/java/org/citrusframework/actions/dsl/ExecutePLSQLTestActionBuilderTest.java +++ b/connectors/citrus-sql/src/test/java/org/citrusframework/actions/dsl/ExecutePLSQLTestActionBuilderTest.java @@ -104,7 +104,7 @@ public void testExecutePLSQLBuilderWithTransaction() { } @Test - public void testExecutePLSQLBuilderWithSQLResource() throws IOException { + public void testExecutePLSQLBuilderWithSQLResource() { reset(jdbcTemplate, sqlResource); when(sqlResource.exists()).thenReturn(true); when(sqlResource.getInputStream()).thenReturn(new ByteArrayInputStream((""" @@ -143,7 +143,7 @@ public void testExecutePLSQLBuilderWithSQLResource() throws IOException { } @Test - public void testExecutePLSQLBuilderWithSQLResourcePath() throws IOException { + public void testExecutePLSQLBuilderWithSQLResourcePath() { reset(jdbcTemplate); DefaultTestCaseRunner builder = new DefaultTestCaseRunner(context); builder.$(plsql().jdbcTemplate(jdbcTemplate) diff --git a/connectors/citrus-sql/src/test/java/org/citrusframework/actions/dsl/ExecuteSQLTestActionBuilderTest.java b/connectors/citrus-sql/src/test/java/org/citrusframework/actions/dsl/ExecuteSQLTestActionBuilderTest.java index acb9db132a..677e0c87cd 100644 --- a/connectors/citrus-sql/src/test/java/org/citrusframework/actions/dsl/ExecuteSQLTestActionBuilderTest.java +++ b/connectors/citrus-sql/src/test/java/org/citrusframework/actions/dsl/ExecuteSQLTestActionBuilderTest.java @@ -101,7 +101,7 @@ public void testExecuteSQLBuilderWithTransaction() { } @Test - public void testExecuteSQLBuilderWithResource() throws IOException { + public void testExecuteSQLBuilderWithResource() { reset(jdbcTemplate); DefaultTestCaseRunner builder = new DefaultTestCaseRunner(context); @@ -127,7 +127,7 @@ public void testExecuteSQLBuilderWithResource() throws IOException { } @Test - public void testExecuteSQLBuilderWithResourcePath() throws IOException { + public void testExecuteSQLBuilderWithResourcePath() { reset(jdbcTemplate); DefaultTestCaseRunner builder = new DefaultTestCaseRunner(context); builder.$(sql().jdbcTemplate(jdbcTemplate) diff --git a/core/citrus-api/src/main/java/org/citrusframework/spi/ClasspathResourceResolver.java b/core/citrus-api/src/main/java/org/citrusframework/spi/ClasspathResourceResolver.java index 86d2c81cf3..b8445540a0 100644 --- a/core/citrus-api/src/main/java/org/citrusframework/spi/ClasspathResourceResolver.java +++ b/core/citrus-api/src/main/java/org/citrusframework/spi/ClasspathResourceResolver.java @@ -61,7 +61,7 @@ public Set getClasses(String path) throws IOException { return resources; } - public File getResource(String path) throws IOException { + public File getResource(String path) { if (path.endsWith("/*")) { path = path.substring(0, path.length() - 1); } else if (path.endsWith(".*")) { diff --git a/core/citrus-api/src/main/java/org/citrusframework/spi/Resource.java b/core/citrus-api/src/main/java/org/citrusframework/spi/Resource.java index 0191f5e3e9..943f19102d 100644 --- a/core/citrus-api/src/main/java/org/citrusframework/spi/Resource.java +++ b/core/citrus-api/src/main/java/org/citrusframework/spi/Resource.java @@ -93,7 +93,7 @@ default Reader getReader() throws IOException { * * @see #getInputStream() */ - default Reader getReader(Charset charset) throws IOException { + default Reader getReader(Charset charset) { return new InputStreamReader(getInputStream(), charset); } } diff --git a/core/citrus-api/src/main/java/org/citrusframework/spi/Resources.java b/core/citrus-api/src/main/java/org/citrusframework/spi/Resources.java index b75f1a6af5..cc6f49d89b 100644 --- a/core/citrus-api/src/main/java/org/citrusframework/spi/Resources.java +++ b/core/citrus-api/src/main/java/org/citrusframework/spi/Resources.java @@ -169,15 +169,11 @@ public File getFile() { throw new CitrusRuntimeException(format("Failed to load classpath resource '%s' - does not exist", location)); } - try { - File found = resolver.getResource(location); - if (found == null) { - throw new CitrusRuntimeException(format("Failed to load classpath resource '%s' - does not exist", location)); - } - return found; - } catch (IOException e) { - throw new CitrusRuntimeException(format("Failed to load classpath resource '%s'", location), e); + File found = resolver.getResource(location); + if (found == null) { + throw new CitrusRuntimeException(format("Failed to load classpath resource '%s' - does not exist", location)); } + return found; } @Override diff --git a/core/citrus-api/src/main/java/org/citrusframework/util/ReflectionHelper.java b/core/citrus-api/src/main/java/org/citrusframework/util/ReflectionHelper.java index 48b1d7274d..edaf77b024 100644 --- a/core/citrus-api/src/main/java/org/citrusframework/util/ReflectionHelper.java +++ b/core/citrus-api/src/main/java/org/citrusframework/util/ReflectionHelper.java @@ -49,7 +49,7 @@ public interface FieldCallback { * * @param field the field to operate on */ - void doWith(Field field) throws IllegalArgumentException, IllegalAccessException; + void doWith(Field field) throws IllegalArgumentException; } /** @@ -77,7 +77,7 @@ public interface ClassCallback { * * @param clazz the class to operate on */ - void doWith(Class clazz) throws IllegalArgumentException, IllegalAccessException; + void doWith(Class clazz) throws IllegalArgumentException; } /** @@ -90,11 +90,7 @@ public static void doWithClasses(Class clazz, ClassCallback cc) throws Illega // and then nested classes Class[] classes = clazz.getDeclaredClasses(); for (Class aClazz : classes) { - try { - cc.doWith(aClazz); - } catch (IllegalAccessException ex) { - throw new IllegalStateException("Shouldn't be illegal to access class '" + aClazz.getName() + "': " + ex); - } + cc.doWith(aClazz); } } @@ -111,11 +107,7 @@ public static void doWithFields(Class clazz, FieldCallback fc) throws Illegal do { Field[] fields = targetClass.getDeclaredFields(); for (Field field : fields) { - try { - fc.doWith(field); - } catch (IllegalAccessException ex) { - throw new IllegalStateException("Shouldn't be illegal to access field '" + field.getName() + "': " + ex); - } + fc.doWith(field); } targetClass = targetClass.getSuperclass(); } while (targetClass != null && targetClass != Object.class); diff --git a/core/citrus-spring/src/main/java/org/citrusframework/config/TestCaseFactory.java b/core/citrus-spring/src/main/java/org/citrusframework/config/TestCaseFactory.java index ce9934e053..c470e12f0b 100644 --- a/core/citrus-spring/src/main/java/org/citrusframework/config/TestCaseFactory.java +++ b/core/citrus-spring/src/main/java/org/citrusframework/config/TestCaseFactory.java @@ -36,7 +36,7 @@ public class TestCaseFactory implements FactoryBean { private List finalActions; @Override - public TestCase getObject() throws Exception { + public TestCase getObject() { if (this.testActions != null && !this.testActions.isEmpty()) { for (TestAction action : testActions) { testCase.addTestAction(action); diff --git a/core/citrus-spring/src/main/java/org/citrusframework/config/xml/AbstractTestContainerFactoryBean.java b/core/citrus-spring/src/main/java/org/citrusframework/config/xml/AbstractTestContainerFactoryBean.java index 80790f17fe..028fdb7d45 100644 --- a/core/citrus-spring/src/main/java/org/citrusframework/config/xml/AbstractTestContainerFactoryBean.java +++ b/core/citrus-spring/src/main/java/org/citrusframework/config/xml/AbstractTestContainerFactoryBean.java @@ -39,9 +39,8 @@ public void setActions(List actions) { * Adds test actions to container when building object. * @param container * @return - * @throws Exception */ - public T getObject(T container) throws Exception { + public T getObject(T container) { container.setActions(actions); return container; } diff --git a/core/citrus-spring/src/main/java/org/citrusframework/config/xml/AntRunActionParser.java b/core/citrus-spring/src/main/java/org/citrusframework/config/xml/AntRunActionParser.java index f47e50aa60..dbd33ec8d3 100644 --- a/core/citrus-spring/src/main/java/org/citrusframework/config/xml/AntRunActionParser.java +++ b/core/citrus-spring/src/main/java/org/citrusframework/config/xml/AntRunActionParser.java @@ -125,7 +125,7 @@ public void setBuildListener(BuildListener buildListener) { } @Override - public AntRunAction getObject() throws Exception { + public AntRunAction getObject() { return builder.build(); } diff --git a/core/citrus-spring/src/main/java/org/citrusframework/config/xml/CreateVariablesActionParser.java b/core/citrus-spring/src/main/java/org/citrusframework/config/xml/CreateVariablesActionParser.java index 6a5f47c902..1ddc0f01a6 100644 --- a/core/citrus-spring/src/main/java/org/citrusframework/config/xml/CreateVariablesActionParser.java +++ b/core/citrus-spring/src/main/java/org/citrusframework/config/xml/CreateVariablesActionParser.java @@ -72,7 +72,7 @@ public static class CreateVariablesActionFactoryBean extends AbstractTestActionF private final CreateVariablesAction.Builder builder = new CreateVariablesAction.Builder(); @Override - public CreateVariablesAction getObject() throws Exception { + public CreateVariablesAction getObject() { return builder.build(); } diff --git a/core/citrus-spring/src/main/java/org/citrusframework/config/xml/DirectEndpointAdapterParser.java b/core/citrus-spring/src/main/java/org/citrusframework/config/xml/DirectEndpointAdapterParser.java index bc2e39bd20..a6a2de6aed 100644 --- a/core/citrus-spring/src/main/java/org/citrusframework/config/xml/DirectEndpointAdapterParser.java +++ b/core/citrus-spring/src/main/java/org/citrusframework/config/xml/DirectEndpointAdapterParser.java @@ -82,7 +82,7 @@ public void setFallbackEndpointAdapter(EndpointAdapter fallbackEndpointAdapter) } @Override - public DirectEndpointAdapter getObject() throws Exception { + public DirectEndpointAdapter getObject() { DirectEndpointAdapter endpointAdapter = new DirectEndpointAdapter(endpointConfiguration); endpointAdapter.setTestContextFactory(testContextFactory); diff --git a/core/citrus-spring/src/main/java/org/citrusframework/config/xml/EchoActionParser.java b/core/citrus-spring/src/main/java/org/citrusframework/config/xml/EchoActionParser.java index 24ac438139..f66dba5d53 100644 --- a/core/citrus-spring/src/main/java/org/citrusframework/config/xml/EchoActionParser.java +++ b/core/citrus-spring/src/main/java/org/citrusframework/config/xml/EchoActionParser.java @@ -56,7 +56,7 @@ public void setMessage(String message) { } @Override - public EchoAction getObject() throws Exception { + public EchoAction getObject() { return builder.build(); } diff --git a/core/citrus-spring/src/main/java/org/citrusframework/config/xml/EmptyResponseEndpointAdapterParser.java b/core/citrus-spring/src/main/java/org/citrusframework/config/xml/EmptyResponseEndpointAdapterParser.java index 8ce6459b44..9b54162321 100644 --- a/core/citrus-spring/src/main/java/org/citrusframework/config/xml/EmptyResponseEndpointAdapterParser.java +++ b/core/citrus-spring/src/main/java/org/citrusframework/config/xml/EmptyResponseEndpointAdapterParser.java @@ -49,7 +49,7 @@ public static class EmptyResponseEndpointAdapterFactory implements FactoryBean variableNames) { } @Override - public TraceVariablesAction getObject() throws Exception { + public TraceVariablesAction getObject() { return builder.build(); } diff --git a/core/citrus-spring/src/main/java/org/citrusframework/config/xml/TransformActionParser.java b/core/citrus-spring/src/main/java/org/citrusframework/config/xml/TransformActionParser.java index 5e4fcd0e30..6fdb1923a7 100644 --- a/core/citrus-spring/src/main/java/org/citrusframework/config/xml/TransformActionParser.java +++ b/core/citrus-spring/src/main/java/org/citrusframework/config/xml/TransformActionParser.java @@ -116,7 +116,7 @@ public void setTargetVariable(String targetVariable) { } @Override - public TransformAction getObject() throws Exception { + public TransformAction getObject() { return builder.build(); } diff --git a/core/citrus-spring/src/main/java/org/citrusframework/config/xml/WaitParser.java b/core/citrus-spring/src/main/java/org/citrusframework/config/xml/WaitParser.java index 7f709fdc00..39c8761d34 100644 --- a/core/citrus-spring/src/main/java/org/citrusframework/config/xml/WaitParser.java +++ b/core/citrus-spring/src/main/java/org/citrusframework/config/xml/WaitParser.java @@ -187,7 +187,7 @@ public void setAction(TestAction action) { } @Override - public Wait getObject() throws Exception { + public Wait getObject() { return builder.build(); } diff --git a/core/citrus-spring/src/main/java/org/citrusframework/context/TestContextFactoryBean.java b/core/citrus-spring/src/main/java/org/citrusframework/context/TestContextFactoryBean.java index 23865fc752..7091a6d05f 100644 --- a/core/citrus-spring/src/main/java/org/citrusframework/context/TestContextFactoryBean.java +++ b/core/citrus-spring/src/main/java/org/citrusframework/context/TestContextFactoryBean.java @@ -198,7 +198,7 @@ public boolean isSingleton() { } @Override - public void afterPropertiesSet() throws Exception { + public void afterPropertiesSet() { if (functionRegistry != null) { delegate.setFunctionRegistry(functionRegistry); } diff --git a/core/citrus-spring/src/main/java/org/citrusframework/endpoint/adapter/XmlTestExecutingEndpointAdapter.java b/core/citrus-spring/src/main/java/org/citrusframework/endpoint/adapter/XmlTestExecutingEndpointAdapter.java index 6ad7271da7..e6e977b174 100644 --- a/core/citrus-spring/src/main/java/org/citrusframework/endpoint/adapter/XmlTestExecutingEndpointAdapter.java +++ b/core/citrus-spring/src/main/java/org/citrusframework/endpoint/adapter/XmlTestExecutingEndpointAdapter.java @@ -131,9 +131,8 @@ protected void prepareExecution(Message request, TestCase testCase) { /** * Creates Citrus Spring bean application context with basic beans and settings for Citrus. - * @throws Exception */ - public void afterPropertiesSet() throws Exception { + public void afterPropertiesSet() { if (endpointAdapterDelegate == null) { DirectSyncEndpointConfiguration endpointConfiguration = new DirectSyncEndpointConfiguration(); endpointConfiguration.setQueueName(name + AbstractServer.DEFAULT_CHANNEL_ID_SUFFIX); diff --git a/core/citrus-spring/src/main/java/org/citrusframework/functions/DefaultFunctionLibraryFactory.java b/core/citrus-spring/src/main/java/org/citrusframework/functions/DefaultFunctionLibraryFactory.java index 9c88d9bc48..829c2ef710 100644 --- a/core/citrus-spring/src/main/java/org/citrusframework/functions/DefaultFunctionLibraryFactory.java +++ b/core/citrus-spring/src/main/java/org/citrusframework/functions/DefaultFunctionLibraryFactory.java @@ -31,7 +31,7 @@ public class DefaultFunctionLibraryFactory implements FactoryBean { if (member instanceof ApplicationContextAware) { ((ApplicationContextAware) member).setApplicationContext(applicationContext); diff --git a/core/citrus-spring/src/main/java/org/citrusframework/functions/FunctionRegistryFactory.java b/core/citrus-spring/src/main/java/org/citrusframework/functions/FunctionRegistryFactory.java index 998162e5dc..f55b37a56b 100644 --- a/core/citrus-spring/src/main/java/org/citrusframework/functions/FunctionRegistryFactory.java +++ b/core/citrus-spring/src/main/java/org/citrusframework/functions/FunctionRegistryFactory.java @@ -49,7 +49,7 @@ public FunctionRegistryFactory(FunctionRegistry registry) { } @Override - public FunctionRegistry getObject() throws Exception { + public FunctionRegistry getObject() { if (applicationContext != null) { applicationContext.getBeansOfType(FunctionLibrary.class) .forEach((key, value) -> registry.addFunctionLibrary(value)); diff --git a/core/citrus-spring/src/main/java/org/citrusframework/report/MessageListenersFactory.java b/core/citrus-spring/src/main/java/org/citrusframework/report/MessageListenersFactory.java index 483096bae1..3b1d426834 100644 --- a/core/citrus-spring/src/main/java/org/citrusframework/report/MessageListenersFactory.java +++ b/core/citrus-spring/src/main/java/org/citrusframework/report/MessageListenersFactory.java @@ -47,7 +47,7 @@ public MessageListenersFactory(MessageListeners listeners) { } @Override - public MessageListeners getObject() throws Exception { + public MessageListeners getObject() { if (applicationContext != null) { applicationContext.getBeansOfType(MessageListener.class) .forEach((key, value) -> listeners.addMessageListener(value)); diff --git a/core/citrus-spring/src/main/java/org/citrusframework/report/TestActionListenersFactory.java b/core/citrus-spring/src/main/java/org/citrusframework/report/TestActionListenersFactory.java index e7d0d6f2c1..0dc269e6e8 100644 --- a/core/citrus-spring/src/main/java/org/citrusframework/report/TestActionListenersFactory.java +++ b/core/citrus-spring/src/main/java/org/citrusframework/report/TestActionListenersFactory.java @@ -47,7 +47,7 @@ public TestActionListenersFactory(TestActionListeners listeners) { } @Override - public TestActionListeners getObject() throws Exception { + public TestActionListeners getObject() { if (applicationContext != null) { applicationContext.getBeansOfType(TestActionListener.class) .forEach((key, value) -> listeners.addTestActionListener(value)); diff --git a/core/citrus-spring/src/main/java/org/citrusframework/report/TestListenersFactory.java b/core/citrus-spring/src/main/java/org/citrusframework/report/TestListenersFactory.java index bf6c82c0fc..9dc8f4f2fd 100644 --- a/core/citrus-spring/src/main/java/org/citrusframework/report/TestListenersFactory.java +++ b/core/citrus-spring/src/main/java/org/citrusframework/report/TestListenersFactory.java @@ -47,7 +47,7 @@ public TestListenersFactory(TestListeners listeners) { } @Override - public TestListeners getObject() throws Exception { + public TestListeners getObject() { if (applicationContext != null) { applicationContext.getBeansOfType(TestListener.class) .forEach((key, value) -> listeners.addTestListener(value)); diff --git a/core/citrus-spring/src/main/java/org/citrusframework/report/TestSuiteListenersFactory.java b/core/citrus-spring/src/main/java/org/citrusframework/report/TestSuiteListenersFactory.java index 92c37a9398..f9c4ccf6bd 100644 --- a/core/citrus-spring/src/main/java/org/citrusframework/report/TestSuiteListenersFactory.java +++ b/core/citrus-spring/src/main/java/org/citrusframework/report/TestSuiteListenersFactory.java @@ -47,7 +47,7 @@ public TestSuiteListenersFactory(TestSuiteListeners listeners) { } @Override - public TestSuiteListeners getObject() throws Exception { + public TestSuiteListeners getObject() { if (applicationContext != null) { applicationContext.getBeansOfType(TestSuiteListener.class) .forEach((key, value) -> listeners.addTestSuiteListener(value)); diff --git a/core/citrus-spring/src/main/java/org/citrusframework/reporter/TestReportersFactory.java b/core/citrus-spring/src/main/java/org/citrusframework/reporter/TestReportersFactory.java index 92292e4bb3..6c274ff045 100644 --- a/core/citrus-spring/src/main/java/org/citrusframework/reporter/TestReportersFactory.java +++ b/core/citrus-spring/src/main/java/org/citrusframework/reporter/TestReportersFactory.java @@ -51,7 +51,7 @@ public TestReportersFactory(TestReporters registry) { } @Override - public TestReporters getObject() throws Exception { + public TestReporters getObject() { if (applicationContext != null) { applicationContext.getBeansOfType(TestReporter.class) .forEach((key, value) -> reporters.addTestReporter(value)); diff --git a/core/citrus-spring/src/main/java/org/citrusframework/spi/SpringResourceWrapper.java b/core/citrus-spring/src/main/java/org/citrusframework/spi/SpringResourceWrapper.java index 164fae66c4..fcdaaada0e 100644 --- a/core/citrus-spring/src/main/java/org/citrusframework/spi/SpringResourceWrapper.java +++ b/core/citrus-spring/src/main/java/org/citrusframework/spi/SpringResourceWrapper.java @@ -50,12 +50,12 @@ public URL getURL() throws IOException { } @Override - public URI getURI() throws IOException { + public URI getURI() { return delegate.getURI(); } @Override - public File getFile() throws IOException { + public File getFile() { return delegate.getFile(); } @@ -69,7 +69,7 @@ public long contentLength() throws IOException { } @Override - public long lastModified() throws IOException { + public long lastModified() { try { return delegate.getFile().lastModified(); } catch (Exception e) { @@ -78,7 +78,7 @@ public long lastModified() throws IOException { } @Override - public org.springframework.core.io.Resource createRelative(String relativePath) throws IOException { + public org.springframework.core.io.Resource createRelative(String relativePath) { throw new UnsupportedOperationException(); } @@ -93,7 +93,7 @@ public String getDescription() { } @Override - public InputStream getInputStream() throws IOException { + public InputStream getInputStream() { return delegate.getInputStream(); } diff --git a/core/citrus-spring/src/main/java/org/citrusframework/validation/MessageValidatorRegistryFactory.java b/core/citrus-spring/src/main/java/org/citrusframework/validation/MessageValidatorRegistryFactory.java index 961756c017..494c6f4765 100644 --- a/core/citrus-spring/src/main/java/org/citrusframework/validation/MessageValidatorRegistryFactory.java +++ b/core/citrus-spring/src/main/java/org/citrusframework/validation/MessageValidatorRegistryFactory.java @@ -42,7 +42,7 @@ public MessageValidatorRegistryFactory(MessageValidatorRegistry messageValidator } @Override - public MessageValidatorRegistry getObject() throws Exception { + public MessageValidatorRegistry getObject() { if (applicationContext != null) { applicationContext.getBeansOfType(MessageValidator.class) .forEach(registry::addMessageValidator); diff --git a/core/citrus-spring/src/main/java/org/citrusframework/validation/interceptor/MessageProcessorsFactory.java b/core/citrus-spring/src/main/java/org/citrusframework/validation/interceptor/MessageProcessorsFactory.java index 8e6965920f..7f8bb3496a 100644 --- a/core/citrus-spring/src/main/java/org/citrusframework/validation/interceptor/MessageProcessorsFactory.java +++ b/core/citrus-spring/src/main/java/org/citrusframework/validation/interceptor/MessageProcessorsFactory.java @@ -52,7 +52,7 @@ public MessageProcessorsFactory(MessageProcessors registry) { } @Override - public MessageProcessors getObject() throws Exception { + public MessageProcessors getObject() { if (applicationContext != null) { applicationContext.getBeansOfType(MessageProcessor.class) .entrySet() diff --git a/core/citrus-spring/src/main/java/org/citrusframework/validation/matcher/ValidationMatcherRegistryFactory.java b/core/citrus-spring/src/main/java/org/citrusframework/validation/matcher/ValidationMatcherRegistryFactory.java index fb47378545..09c234bd23 100644 --- a/core/citrus-spring/src/main/java/org/citrusframework/validation/matcher/ValidationMatcherRegistryFactory.java +++ b/core/citrus-spring/src/main/java/org/citrusframework/validation/matcher/ValidationMatcherRegistryFactory.java @@ -49,7 +49,7 @@ public ValidationMatcherRegistryFactory(ValidationMatcherRegistry registry) { } @Override - public ValidationMatcherRegistry getObject() throws Exception { + public ValidationMatcherRegistry getObject() { if (applicationContext != null) { applicationContext.getBeansOfType(ValidationMatcherLibrary.class) .forEach((key, value) -> registry.addValidationMatcherLibrary(value)); diff --git a/core/citrus-spring/src/main/java/org/citrusframework/xml/SpringMarshallerAdapter.java b/core/citrus-spring/src/main/java/org/citrusframework/xml/SpringMarshallerAdapter.java index 9d65a4b204..3cc1ed4693 100644 --- a/core/citrus-spring/src/main/java/org/citrusframework/xml/SpringMarshallerAdapter.java +++ b/core/citrus-spring/src/main/java/org/citrusframework/xml/SpringMarshallerAdapter.java @@ -53,7 +53,7 @@ public boolean supports(Class clazz) { } @Override - public Object unmarshal(Source source) throws IOException, XmlMappingException { + public Object unmarshal(Source source) throws XmlMappingException { try { return unmarshaller.unmarshal(source); } catch (Exception e) { @@ -62,7 +62,7 @@ public Object unmarshal(Source source) throws IOException, XmlMappingException { } @Override - public void marshal(Object graph, Result result) throws IOException, XmlMappingException { + public void marshal(Object graph, Result result) throws XmlMappingException { try { marshaller.marshal(graph, result); } catch (Exception e) { diff --git a/core/citrus-spring/src/test/java/org/citrusframework/config/xml/CustomTestCaseParserTest.java b/core/citrus-spring/src/test/java/org/citrusframework/config/xml/CustomTestCaseParserTest.java index 2e5d967763..e559879983 100644 --- a/core/citrus-spring/src/test/java/org/citrusframework/config/xml/CustomTestCaseParserTest.java +++ b/core/citrus-spring/src/test/java/org/citrusframework/config/xml/CustomTestCaseParserTest.java @@ -47,7 +47,7 @@ public static void cleanup() { } @Test - public void testCustomTestCaseParser() throws IOException { + public void testCustomTestCaseParser() { Assert.assertTrue(getTestCase() instanceof CustomTestCase); Assert.assertTrue(getTestCase().getMetaInfo() instanceof CustomTestCaseMetaInfo); Assert.assertEquals(((CustomTestCaseMetaInfo)getTestCase().getMetaInfo()).getDescription(), "Foo bar: F#!$§ed up beyond all repair"); diff --git a/core/citrus-spring/src/test/java/org/citrusframework/config/xml/EmptyResponseEndpointAdapterParserTest.java b/core/citrus-spring/src/test/java/org/citrusframework/config/xml/EmptyResponseEndpointAdapterParserTest.java index adfdf2716f..a1a6d0802d 100644 --- a/core/citrus-spring/src/test/java/org/citrusframework/config/xml/EmptyResponseEndpointAdapterParserTest.java +++ b/core/citrus-spring/src/test/java/org/citrusframework/config/xml/EmptyResponseEndpointAdapterParserTest.java @@ -29,7 +29,7 @@ public class EmptyResponseEndpointAdapterParserTest extends AbstractBeanDefinitionParserTest { @Test - public void testParseBeanDefinition() throws Exception { + public void testParseBeanDefinition() { Map adapters = beanDefinitionContext.getBeansOfType(EmptyResponseEndpointAdapter.class); Assert.assertEquals(adapters.size(), 1); diff --git a/core/citrus-spring/src/test/java/org/citrusframework/config/xml/FunctionLibraryParserTest.java b/core/citrus-spring/src/test/java/org/citrusframework/config/xml/FunctionLibraryParserTest.java index 98422ff540..99ab4556ec 100644 --- a/core/citrus-spring/src/test/java/org/citrusframework/config/xml/FunctionLibraryParserTest.java +++ b/core/citrus-spring/src/test/java/org/citrusframework/config/xml/FunctionLibraryParserTest.java @@ -40,7 +40,7 @@ protected void parseBeanDefinitions() { } @Test - public void testFunctionLibraryParser() throws Exception { + public void testFunctionLibraryParser() { beanDefinitionContext = createApplicationContext("context"); Map functionLibraries = beanDefinitionContext.getBeansOfType(FunctionLibrary.class); diff --git a/core/citrus-spring/src/test/java/org/citrusframework/config/xml/GlobalVariablesParserTest.java b/core/citrus-spring/src/test/java/org/citrusframework/config/xml/GlobalVariablesParserTest.java index fd133ec543..874fcd52a5 100644 --- a/core/citrus-spring/src/test/java/org/citrusframework/config/xml/GlobalVariablesParserTest.java +++ b/core/citrus-spring/src/test/java/org/citrusframework/config/xml/GlobalVariablesParserTest.java @@ -33,7 +33,7 @@ protected void parseBeanDefinitions() { } @Test - public void testGlobalVariablesParser() throws Exception { + public void testGlobalVariablesParser() { beanDefinitionContext = createApplicationContext("context"); Map globalVariables = beanDefinitionContext.getBeansOfType(GlobalVariables.class); Map globalVariablesPropertyLoaders = beanDefinitionContext.getBeansOfType(GlobalVariablesPropertyLoader.class); @@ -54,7 +54,7 @@ public void testGlobalVariablesParser() throws Exception { } @Test - public void testGlobalVariablesEmptyParser() throws Exception { + public void testGlobalVariablesEmptyParser() { beanDefinitionContext = createApplicationContext("empty"); Map globalVariables = beanDefinitionContext.getBeansOfType(GlobalVariables.class); diff --git a/core/citrus-spring/src/test/java/org/citrusframework/config/xml/MessageValidatorRegistryParserTest.java b/core/citrus-spring/src/test/java/org/citrusframework/config/xml/MessageValidatorRegistryParserTest.java index 8d3ef65a3e..0d63d9c6fa 100644 --- a/core/citrus-spring/src/test/java/org/citrusframework/config/xml/MessageValidatorRegistryParserTest.java +++ b/core/citrus-spring/src/test/java/org/citrusframework/config/xml/MessageValidatorRegistryParserTest.java @@ -30,7 +30,7 @@ public class MessageValidatorRegistryParserTest extends AbstractBeanDefinitionParserTest { @Test - public void testNamespaceContextParser() throws Exception { + public void testNamespaceContextParser() { Map messageValidators = beanDefinitionContext.getBeansOfType(MessageValidatorRegistry.class); Assert.assertEquals(messageValidators.size(), 1L); diff --git a/core/citrus-spring/src/test/java/org/citrusframework/config/xml/NamespaceContextParserTest.java b/core/citrus-spring/src/test/java/org/citrusframework/config/xml/NamespaceContextParserTest.java index d7a604f399..652df3fda8 100644 --- a/core/citrus-spring/src/test/java/org/citrusframework/config/xml/NamespaceContextParserTest.java +++ b/core/citrus-spring/src/test/java/org/citrusframework/config/xml/NamespaceContextParserTest.java @@ -32,7 +32,7 @@ protected void parseBeanDefinitions() { } @Test - public void testNamespaceContextParser() throws Exception { + public void testNamespaceContextParser() { beanDefinitionContext = createApplicationContext("context"); Map namespaceContexts = beanDefinitionContext.getBeansOfType(NamespaceContextBuilder.class); diff --git a/core/citrus-spring/src/test/java/org/citrusframework/config/xml/RequestDispatchingEndpointAdapterParserTest.java b/core/citrus-spring/src/test/java/org/citrusframework/config/xml/RequestDispatchingEndpointAdapterParserTest.java index 6aa1719ba6..5cf6719149 100644 --- a/core/citrus-spring/src/test/java/org/citrusframework/config/xml/RequestDispatchingEndpointAdapterParserTest.java +++ b/core/citrus-spring/src/test/java/org/citrusframework/config/xml/RequestDispatchingEndpointAdapterParserTest.java @@ -28,7 +28,7 @@ public class RequestDispatchingEndpointAdapterParserTest extends AbstractBeanDefinitionParserTest { @Test - public void testParseBeanDefinition() throws Exception { + public void testParseBeanDefinition() { Map adapters = beanDefinitionContext.getBeansOfType(RequestDispatchingEndpointAdapter.class); Assert.assertEquals(adapters.size(), 1); diff --git a/core/citrus-spring/src/test/java/org/citrusframework/config/xml/SequenceAfterSuiteParserTest.java b/core/citrus-spring/src/test/java/org/citrusframework/config/xml/SequenceAfterSuiteParserTest.java index b543c2e4c7..6bcad73446 100644 --- a/core/citrus-spring/src/test/java/org/citrusframework/config/xml/SequenceAfterSuiteParserTest.java +++ b/core/citrus-spring/src/test/java/org/citrusframework/config/xml/SequenceAfterSuiteParserTest.java @@ -38,7 +38,7 @@ protected void parseBeanDefinitions() { } @Test - public void testSequenceAfterParser() throws Exception { + public void testSequenceAfterParser() { beanDefinitionContext = createApplicationContext("context"); Map container = beanDefinitionContext.getBeansOfType(SequenceAfterSuite.class); diff --git a/core/citrus-spring/src/test/java/org/citrusframework/config/xml/SequenceAfterTestParserTest.java b/core/citrus-spring/src/test/java/org/citrusframework/config/xml/SequenceAfterTestParserTest.java index b30460e66f..465827ff5b 100644 --- a/core/citrus-spring/src/test/java/org/citrusframework/config/xml/SequenceAfterTestParserTest.java +++ b/core/citrus-spring/src/test/java/org/citrusframework/config/xml/SequenceAfterTestParserTest.java @@ -37,7 +37,7 @@ protected void parseBeanDefinitions() { } @Test - public void testSequenceAfterParser() throws Exception { + public void testSequenceAfterParser() { beanDefinitionContext = createApplicationContext("context"); Map container = beanDefinitionContext.getBeansOfType(SequenceAfterTest.class); diff --git a/core/citrus-spring/src/test/java/org/citrusframework/config/xml/SequenceBeforeSuiteParserTest.java b/core/citrus-spring/src/test/java/org/citrusframework/config/xml/SequenceBeforeSuiteParserTest.java index c32cbe0b48..199793bcbd 100644 --- a/core/citrus-spring/src/test/java/org/citrusframework/config/xml/SequenceBeforeSuiteParserTest.java +++ b/core/citrus-spring/src/test/java/org/citrusframework/config/xml/SequenceBeforeSuiteParserTest.java @@ -38,7 +38,7 @@ protected void parseBeanDefinitions() { } @Test - public void testSequenceBeforeParser() throws Exception { + public void testSequenceBeforeParser() { beanDefinitionContext = createApplicationContext("context"); Map container = beanDefinitionContext.getBeansOfType(SequenceBeforeSuite.class); diff --git a/core/citrus-spring/src/test/java/org/citrusframework/config/xml/SequenceBeforeTestParserTest.java b/core/citrus-spring/src/test/java/org/citrusframework/config/xml/SequenceBeforeTestParserTest.java index d99b2fce15..167b84efe5 100644 --- a/core/citrus-spring/src/test/java/org/citrusframework/config/xml/SequenceBeforeTestParserTest.java +++ b/core/citrus-spring/src/test/java/org/citrusframework/config/xml/SequenceBeforeTestParserTest.java @@ -37,7 +37,7 @@ protected void parseBeanDefinitions() { } @Test - public void testSequenceBeforeParser() throws Exception { + public void testSequenceBeforeParser() { beanDefinitionContext = createApplicationContext("context"); Map container = beanDefinitionContext.getBeansOfType(SequenceBeforeTest.class); diff --git a/core/citrus-spring/src/test/java/org/citrusframework/config/xml/StaticResponseEndpointAdapterParserTest.java b/core/citrus-spring/src/test/java/org/citrusframework/config/xml/StaticResponseEndpointAdapterParserTest.java index 0bc311a05e..2ed4683141 100644 --- a/core/citrus-spring/src/test/java/org/citrusframework/config/xml/StaticResponseEndpointAdapterParserTest.java +++ b/core/citrus-spring/src/test/java/org/citrusframework/config/xml/StaticResponseEndpointAdapterParserTest.java @@ -29,7 +29,7 @@ public class StaticResponseEndpointAdapterParserTest extends AbstractBeanDefinitionParserTest { @Test - public void testParseBeanDefinition() throws Exception { + public void testParseBeanDefinition() { Map adapters = beanDefinitionContext.getBeansOfType(StaticResponseEndpointAdapter.class); Assert.assertEquals(adapters.size(), 2); diff --git a/core/citrus-spring/src/test/java/org/citrusframework/config/xml/TimeoutProducingEndpointAdapterParserTest.java b/core/citrus-spring/src/test/java/org/citrusframework/config/xml/TimeoutProducingEndpointAdapterParserTest.java index fd302dbe2b..67f5774baf 100644 --- a/core/citrus-spring/src/test/java/org/citrusframework/config/xml/TimeoutProducingEndpointAdapterParserTest.java +++ b/core/citrus-spring/src/test/java/org/citrusframework/config/xml/TimeoutProducingEndpointAdapterParserTest.java @@ -29,7 +29,7 @@ public class TimeoutProducingEndpointAdapterParserTest extends AbstractBeanDefinitionParserTest { @Test - public void testParseBeanDefinition() throws Exception { + public void testParseBeanDefinition() { Map adapters = beanDefinitionContext.getBeansOfType(TimeoutProducingEndpointAdapter.class); Assert.assertEquals(adapters.size(), 1); diff --git a/core/citrus-spring/src/test/java/org/citrusframework/config/xml/TimerParserTest.java b/core/citrus-spring/src/test/java/org/citrusframework/config/xml/TimerParserTest.java index b397e704cf..4ceb64d313 100644 --- a/core/citrus-spring/src/test/java/org/citrusframework/config/xml/TimerParserTest.java +++ b/core/citrus-spring/src/test/java/org/citrusframework/config/xml/TimerParserTest.java @@ -27,7 +27,7 @@ public class TimerParserTest extends AbstractActionParserTest { @Test - public void testParse() throws Exception { + public void testParse() { assertActionCount(3); assertActionClassAndName(Timer.class, "timer"); diff --git a/core/citrus-spring/src/test/java/org/citrusframework/config/xml/ValidationMatcherLibraryParserTest.java b/core/citrus-spring/src/test/java/org/citrusframework/config/xml/ValidationMatcherLibraryParserTest.java index 4eca8d8b6a..810f0399f0 100644 --- a/core/citrus-spring/src/test/java/org/citrusframework/config/xml/ValidationMatcherLibraryParserTest.java +++ b/core/citrus-spring/src/test/java/org/citrusframework/config/xml/ValidationMatcherLibraryParserTest.java @@ -41,7 +41,7 @@ protected void parseBeanDefinitions() { } @Test - public void testValidationMatcherParser() throws Exception { + public void testValidationMatcherParser() { beanDefinitionContext = createApplicationContext("context"); Map matcherLibraries = beanDefinitionContext.getBeansOfType(ValidationMatcherLibrary.class); diff --git a/core/citrus-spring/src/test/java/org/citrusframework/endpoint/adapter/mapping/ContextLoadingMappingStrategyTest.java b/core/citrus-spring/src/test/java/org/citrusframework/endpoint/adapter/mapping/ContextLoadingMappingStrategyTest.java index 693097ea60..00acec8adb 100644 --- a/core/citrus-spring/src/test/java/org/citrusframework/endpoint/adapter/mapping/ContextLoadingMappingStrategyTest.java +++ b/core/citrus-spring/src/test/java/org/citrusframework/endpoint/adapter/mapping/ContextLoadingMappingStrategyTest.java @@ -27,7 +27,7 @@ public class ContextLoadingMappingStrategyTest { @Test - public void testGetEndpointAdapter() throws Exception { + public void testGetEndpointAdapter() { ContextLoadingMappingStrategy mappingStrategy = new ContextLoadingMappingStrategy(); mappingStrategy.setContextConfigLocation("classpath:org/citrusframework/endpoint/adapter-mapping-context.xml"); diff --git a/endpoints/citrus-camel/src/main/java/org/citrusframework/camel/actions/CreateCamelRouteAction.java b/endpoints/citrus-camel/src/main/java/org/citrusframework/camel/actions/CreateCamelRouteAction.java index 049e7c2fbb..704c382db3 100644 --- a/endpoints/citrus-camel/src/main/java/org/citrusframework/camel/actions/CreateCamelRouteAction.java +++ b/endpoints/citrus-camel/src/main/java/org/citrusframework/camel/actions/CreateCamelRouteAction.java @@ -100,7 +100,7 @@ public void doExecute(TestContext context) { } else { routeBuilder = new RouteBuilder(camelContext) { @Override - public void configure() throws Exception { + public void configure() { new GroovySupport() .withTestContext(context) .withDelegate(this) @@ -129,7 +129,7 @@ protected void configureRoute(RouteDefinition route) { if (!routesToUse.isEmpty()) { camelContext.addRoutes(new RouteBuilder(camelContext) { @Override - public void configure() throws Exception { + public void configure() { for (RouteDefinition routeDefinition : routesToUse) { try { getRouteCollection().getRoutes().add(routeDefinition); diff --git a/endpoints/citrus-camel/src/main/java/org/citrusframework/camel/config/xml/CamelControlBusActionParser.java b/endpoints/citrus-camel/src/main/java/org/citrusframework/camel/config/xml/CamelControlBusActionParser.java index dd540e4ad8..0d0698e388 100644 --- a/endpoints/citrus-camel/src/main/java/org/citrusframework/camel/config/xml/CamelControlBusActionParser.java +++ b/endpoints/citrus-camel/src/main/java/org/citrusframework/camel/config/xml/CamelControlBusActionParser.java @@ -107,7 +107,7 @@ public void setLanguageExpression(String languageExpression) { } @Override - public CamelControlBusAction getObject() throws Exception { + public CamelControlBusAction getObject() { builder.route(routeId, action); builder.language(languageType, languageExpression); diff --git a/endpoints/citrus-camel/src/main/java/org/citrusframework/camel/config/xml/CreateCamelRouteActionParser.java b/endpoints/citrus-camel/src/main/java/org/citrusframework/camel/config/xml/CreateCamelRouteActionParser.java index 7b882383fe..3f6fedac47 100644 --- a/endpoints/citrus-camel/src/main/java/org/citrusframework/camel/config/xml/CreateCamelRouteActionParser.java +++ b/endpoints/citrus-camel/src/main/java/org/citrusframework/camel/config/xml/CreateCamelRouteActionParser.java @@ -71,7 +71,7 @@ public void setRoute(String routeSpec) { } @Override - public CreateCamelRouteAction getObject() throws Exception { + public CreateCamelRouteAction getObject() { return builder.build(); } diff --git a/endpoints/citrus-camel/src/main/java/org/citrusframework/camel/config/xml/RemoveCamelRouteActionParser.java b/endpoints/citrus-camel/src/main/java/org/citrusframework/camel/config/xml/RemoveCamelRouteActionParser.java index fc5d0f5c9d..fff88cd301 100644 --- a/endpoints/citrus-camel/src/main/java/org/citrusframework/camel/config/xml/RemoveCamelRouteActionParser.java +++ b/endpoints/citrus-camel/src/main/java/org/citrusframework/camel/config/xml/RemoveCamelRouteActionParser.java @@ -59,7 +59,7 @@ public static class RemoveCamelRouteActionFactoryBean extends AbstractCamelRoute private final RemoveCamelRouteAction.Builder builder = new RemoveCamelRouteAction.Builder(); @Override - public RemoveCamelRouteAction getObject() throws Exception { + public RemoveCamelRouteAction getObject() { return builder.build(); } diff --git a/endpoints/citrus-camel/src/main/java/org/citrusframework/camel/config/xml/StartCamelRouteActionParser.java b/endpoints/citrus-camel/src/main/java/org/citrusframework/camel/config/xml/StartCamelRouteActionParser.java index 9ac2d82d3f..65703458f9 100644 --- a/endpoints/citrus-camel/src/main/java/org/citrusframework/camel/config/xml/StartCamelRouteActionParser.java +++ b/endpoints/citrus-camel/src/main/java/org/citrusframework/camel/config/xml/StartCamelRouteActionParser.java @@ -59,7 +59,7 @@ public static class StartCamelRouteActionFactoryBean extends AbstractCamelRouteA private final StartCamelRouteAction.Builder builder = new StartCamelRouteAction.Builder(); @Override - public StartCamelRouteAction getObject() throws Exception { + public StartCamelRouteAction getObject() { return builder.build(); } diff --git a/endpoints/citrus-camel/src/main/java/org/citrusframework/camel/config/xml/StopCamelRouteActionParser.java b/endpoints/citrus-camel/src/main/java/org/citrusframework/camel/config/xml/StopCamelRouteActionParser.java index be4f4866c4..b66a3dced0 100644 --- a/endpoints/citrus-camel/src/main/java/org/citrusframework/camel/config/xml/StopCamelRouteActionParser.java +++ b/endpoints/citrus-camel/src/main/java/org/citrusframework/camel/config/xml/StopCamelRouteActionParser.java @@ -59,7 +59,7 @@ public static class StopCamelRouteActionFactoryBean extends AbstractCamelRouteAc private final StopCamelRouteAction.Builder builder = new StopCamelRouteAction.Builder(); @Override - public StopCamelRouteAction getObject() throws Exception { + public StopCamelRouteAction getObject() { return builder.build(); } diff --git a/endpoints/citrus-camel/src/main/java/org/citrusframework/camel/message/CamelRouteProcessor.java b/endpoints/citrus-camel/src/main/java/org/citrusframework/camel/message/CamelRouteProcessor.java index f6d82be9fb..2330131784 100644 --- a/endpoints/citrus-camel/src/main/java/org/citrusframework/camel/message/CamelRouteProcessor.java +++ b/endpoints/citrus-camel/src/main/java/org/citrusframework/camel/message/CamelRouteProcessor.java @@ -126,7 +126,7 @@ public final CamelRouteProcessor build() { if (routeBuilder == null) { routeBuilder = new RouteBuilder(camelContext) { @Override - public void configure() throws Exception { + public void configure() { RouteDefinition routeDefinition = from("direct:" + routeId) .routeId(routeId); diff --git a/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/actions/CamelCmdReceiveActionTest.java b/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/actions/CamelCmdReceiveActionTest.java index 5ae755ed53..6da02540a7 100644 --- a/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/actions/CamelCmdReceiveActionTest.java +++ b/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/actions/CamelCmdReceiveActionTest.java @@ -50,7 +50,7 @@ public void setUp() { } @Test - public void shouldReceiveMessage() throws Exception { + public void shouldReceiveMessage() { String output = """ Starting to receive messages from existing Camel: my-route (pid: 12345) Waiting for messages ... @@ -91,7 +91,7 @@ public void shouldReceiveMessage() throws Exception { } @Test - public void shouldReceiveMessageJsonOutput() throws Exception { + public void shouldReceiveMessageJsonOutput() { String output = """ Starting to receive messages from existing Camel: my-route (pid: 12345) Waiting for messages ... @@ -160,7 +160,7 @@ public void shouldReceiveMessageJsonOutput() throws Exception { } @Test - public void shouldStoreLastMessage() throws Exception { + public void shouldStoreLastMessage() { String output = """ Starting to receive messages from existing Camel: my-route (pid: 12345) Waiting for messages ... @@ -243,7 +243,7 @@ public void shouldStoreLastMessage() throws Exception { } @Test(expectedExceptions = ActionTimeoutException.class) - public void shouldTimeoutWhenNoMessage() throws Exception { + public void shouldTimeoutWhenNoMessage() { String output = """ Starting to receive messages from existing Camel: my-route (pid: 12345) Waiting for messages ... @@ -269,7 +269,7 @@ public void shouldTimeoutWhenNoMessage() throws Exception { } @Test(expectedExceptions = ActionTimeoutException.class) - public void shouldTimeoutWhenNoMessageJsonOutput() throws Exception { + public void shouldTimeoutWhenNoMessageJsonOutput() { String output = """ Starting to receive messages from existing Camel: my-route (pid: 12345) Waiting for messages ... diff --git a/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/actions/CamelControlBusActionTest.java b/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/actions/CamelControlBusActionTest.java index ff458e4bca..cb0ce66676 100644 --- a/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/actions/CamelControlBusActionTest.java +++ b/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/actions/CamelControlBusActionTest.java @@ -43,7 +43,7 @@ public class CamelControlBusActionTest extends AbstractTestNGUnitTest { private final ProducerTemplate producerTemplate = Mockito.mock(ProducerTemplate.class); @Test - public void testControlBusRouteAction() throws Exception { + public void testControlBusRouteAction() { String endpointUri = "controlbus:route?routeId=route_1&action=status"; DefaultMessage message = new DefaultMessage(camelContext); @@ -68,7 +68,7 @@ public void testControlBusRouteAction() throws Exception { } @Test - public void testControlBusRouteActionVariableSupport() throws Exception { + public void testControlBusRouteActionVariableSupport() { String endpointUri = "controlbus:route?routeId=route_1&action=status"; DefaultMessage message = new DefaultMessage(camelContext); @@ -96,7 +96,7 @@ public void testControlBusRouteActionVariableSupport() throws Exception { } @Test - public void testControlBusRouteActionWithResult() throws Exception { + public void testControlBusRouteActionWithResult() { String endpointUri = "controlbus:route?routeId=route_1&action=status"; DefaultMessage message = new DefaultMessage(camelContext); @@ -122,7 +122,7 @@ public void testControlBusRouteActionWithResult() throws Exception { } @Test(expectedExceptions = ValidationException.class) - public void testControlBusRouteActionWithResultFailed() throws Exception { + public void testControlBusRouteActionWithResultFailed() { String endpointUri = "controlbus:route?routeId=route_1&action=status"; DefaultMessage message = new DefaultMessage(camelContext); @@ -148,7 +148,7 @@ public void testControlBusRouteActionWithResultFailed() throws Exception { } @Test - public void testControlBusLanguageAction() throws Exception { + public void testControlBusLanguageAction() { String endpointUri = "controlbus:language:simple"; DefaultMessage message = new DefaultMessage(camelContext); @@ -173,7 +173,7 @@ public void testControlBusLanguageAction() throws Exception { } @Test - public void testControlBusLanguageActionVariableSupport() throws Exception { + public void testControlBusLanguageActionVariableSupport() { String endpointUri = "controlbus:language:simple"; DefaultMessage message = new DefaultMessage(camelContext); @@ -205,7 +205,7 @@ public void testControlBusLanguageActionVariableSupport() throws Exception { } @Test - public void testControlBusLanguageActionWithResult() throws Exception { + public void testControlBusLanguageActionWithResult() { String endpointUri = "controlbus:language:simple"; DefaultMessage message = new DefaultMessage(camelContext); diff --git a/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/actions/dsl/CamelRouteTestActionRunnerTest.java b/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/actions/dsl/CamelRouteTestActionRunnerTest.java index 903b86e920..fc25f1c36f 100644 --- a/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/actions/dsl/CamelRouteTestActionRunnerTest.java +++ b/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/actions/dsl/CamelRouteTestActionRunnerTest.java @@ -40,13 +40,13 @@ public class CamelRouteTestActionRunnerTest extends UnitTestSupport implements T private DefaultCamelContext camelContext; @BeforeMethod - public void setupCamelContext() throws Exception { + public void setupCamelContext() { camelContext = new DefaultCamelContext(); camelContext.start(); } @AfterMethod(alwaysRun = true) - public void clearCamelContext() throws Exception { + public void clearCamelContext() { if (camelContext != null) { camelContext.shutdown(); } @@ -60,7 +60,7 @@ public void testCreateCamelRouteBuilder() { .route() .create(new RouteBuilder(camelContext) { @Override - public void configure() throws Exception { + public void configure() { from("direct:news") .routeId("route_1") .setHeader("headline", simple("This is BIG news!")) @@ -89,7 +89,7 @@ public void configure() throws Exception { public void testStartCamelRouteBuilder() throws Exception { camelContext.addRoutes(new RouteBuilder(camelContext) { @Override - public void configure() throws Exception { + public void configure() { from("direct:news") .routeId("route_1") .autoStartup(false) @@ -130,7 +130,7 @@ public void configure() throws Exception { public void testRemoveCamelRouteBuilder() throws Exception { camelContext.addRoutes(new RouteBuilder(camelContext) { @Override - public void configure() throws Exception { + public void configure() { from("direct:news") .routeId("route_1") .autoStartup(false) @@ -171,7 +171,7 @@ public void testDefaultCamelContextBuilder() { DefaultTestCaseRunner builder = new DefaultTestCaseRunner(context); builder.$(camel().route().create(new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { from("direct:news") .routeId("route_1") .setHeader("headline", simple("This is BIG news!")) @@ -200,7 +200,7 @@ public void configure() throws Exception { public void testCamelControlBusBuilder() throws Exception { camelContext.addRoutes(new RouteBuilder(camelContext) { @Override - public void configure() throws Exception { + public void configure() { from("direct:news") .routeId("route_1") .autoStartup(false) diff --git a/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/endpoint/CamelEndpointComponentTest.java b/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/endpoint/CamelEndpointComponentTest.java index 7859d688d0..62bebb8af8 100644 --- a/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/endpoint/CamelEndpointComponentTest.java +++ b/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/endpoint/CamelEndpointComponentTest.java @@ -51,7 +51,7 @@ public void setup() { } @Test - public void testCreateEndpoint() throws Exception { + public void testCreateEndpoint() { CamelEndpointComponent component = new CamelEndpointComponent(); reset(referenceResolver); @@ -75,7 +75,7 @@ public void testCreateEndpoint() throws Exception { } @Test - public void testCreateSyncEndpoint() throws Exception { + public void testCreateSyncEndpoint() { CamelEndpointComponent component = new CamelEndpointComponent(); reset(referenceResolver); @@ -99,7 +99,7 @@ public void testCreateSyncEndpoint() throws Exception { } @Test - public void testCreateEndpointWithParameters() throws Exception { + public void testCreateEndpointWithParameters() { CamelEndpointComponent component = new CamelEndpointComponent(); Map camelContextMap = new HashMap<>(); @@ -121,7 +121,7 @@ public void testCreateEndpointWithParameters() throws Exception { } @Test - public void testCreateEndpointWithCamelParameters() throws Exception { + public void testCreateEndpointWithCamelParameters() { CamelEndpointComponent component = new CamelEndpointComponent(); Map camelContextMap = new HashMap<>(); @@ -143,7 +143,7 @@ public void testCreateEndpointWithCamelParameters() throws Exception { } @Test - public void testCreateEndpointWithBeanReference() throws Exception { + public void testCreateEndpointWithBeanReference() { CamelEndpointComponent component = new CamelEndpointComponent(); reset(referenceResolver); diff --git a/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/groovy/ControlBusTest.java b/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/groovy/ControlBusTest.java index 8f5498eb2b..c4c208d7b2 100644 --- a/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/groovy/ControlBusTest.java +++ b/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/groovy/ControlBusTest.java @@ -36,7 +36,7 @@ public void shouldLoadCamelActions() throws Exception { CamelContext citrusCamelContext = new DefaultCamelContext(); citrusCamelContext.addRoutes(new RouteBuilder(citrusCamelContext) { @Override - public void configure() throws Exception { + public void configure() { from("direct:hello") .routeId("route_1") .to("log:info"); diff --git a/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/groovy/CreateRoutesTest.java b/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/groovy/CreateRoutesTest.java index b7518d6d8b..6ec972f7b2 100644 --- a/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/groovy/CreateRoutesTest.java +++ b/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/groovy/CreateRoutesTest.java @@ -29,7 +29,7 @@ public class CreateRoutesTest extends AbstractGroovyActionDslTest { @Test - public void shouldLoadCamelActions() throws Exception { + public void shouldLoadCamelActions() { GroovyTestLoader testLoader = createTestLoader("classpath:org/citrusframework/camel/groovy/camel-create-routes.citrus.test.groovy"); CamelContext citrusCamelContext = new DefaultCamelContext(); diff --git a/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/groovy/RemoveRoutesTest.java b/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/groovy/RemoveRoutesTest.java index 46026989da..feac9167a9 100644 --- a/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/groovy/RemoveRoutesTest.java +++ b/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/groovy/RemoveRoutesTest.java @@ -36,7 +36,7 @@ public void shouldLoadCamelActions() throws Exception { CamelContext citrusCamelContext = new DefaultCamelContext(); citrusCamelContext.addRoutes(new RouteBuilder(citrusCamelContext) { @Override - public void configure() throws Exception { + public void configure() { from("direct:hello") .routeId("route_1") .autoStartup(false) diff --git a/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/groovy/StartRoutesTest.java b/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/groovy/StartRoutesTest.java index 2fe46ea925..6fa80fef3c 100644 --- a/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/groovy/StartRoutesTest.java +++ b/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/groovy/StartRoutesTest.java @@ -36,7 +36,7 @@ public void shouldLoadCamelActions() throws Exception { CamelContext citrusCamelContext = new DefaultCamelContext(); citrusCamelContext.addRoutes(new RouteBuilder(citrusCamelContext) { @Override - public void configure() throws Exception { + public void configure() { from("direct:hello") .routeId("route_1") .autoStartup(false) diff --git a/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/groovy/StopRoutesTest.java b/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/groovy/StopRoutesTest.java index bef62b2cac..4973cf1fe8 100644 --- a/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/groovy/StopRoutesTest.java +++ b/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/groovy/StopRoutesTest.java @@ -36,7 +36,7 @@ public void shouldLoadCamelActions() throws Exception { CamelContext citrusCamelContext = new DefaultCamelContext(); citrusCamelContext.addRoutes(new RouteBuilder(citrusCamelContext) { @Override - public void configure() throws Exception { + public void configure() { from("direct:hello") .routeId("route_1") .to("log:info"); diff --git a/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/integration/CamelControlbusIT.java b/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/integration/CamelControlbusIT.java index 5838446cf7..457f96579a 100644 --- a/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/integration/CamelControlbusIT.java +++ b/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/integration/CamelControlbusIT.java @@ -42,7 +42,7 @@ public class CamelControlbusIT extends TestNGCitrusSpringSupport implements Test public void shouldManageRoutes() throws Exception { camelContext.addRoutes(new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { from(direct("message")) .routeId("message-to-words") .autoStartup(false) diff --git a/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/integration/CamelRouteActionIT.java b/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/integration/CamelRouteActionIT.java index 0a3aa8d3a1..46ef122085 100644 --- a/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/integration/CamelRouteActionIT.java +++ b/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/integration/CamelRouteActionIT.java @@ -39,12 +39,12 @@ public class CamelRouteActionIT extends TestNGCitrusSpringSupport implements Tes @Test @CitrusTest - public void shouldCreateRoutes() throws Exception { + public void shouldCreateRoutes() { given(camel().camelContext(camelContext) .route() .create(new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { from("direct:messages") .split().tokenize(" ") .to("seda:words"); @@ -69,12 +69,12 @@ public void configure() throws Exception { @Test @CitrusTest - public void shouldStartStopRoutes() throws Exception { + public void shouldStartStopRoutes() { given(camel().camelContext(camelContext) .route() .create(new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { from(direct("text")) .routeId("split-text") .autoStartup(false) diff --git a/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/xml/CamelAddPluginTest.java b/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/xml/CamelAddPluginTest.java index 0262976ac7..7c2b1f7912 100644 --- a/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/xml/CamelAddPluginTest.java +++ b/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/xml/CamelAddPluginTest.java @@ -43,7 +43,7 @@ public void setup() { } @Test - public void shouldLoadCamelActions() throws Exception { + public void shouldLoadCamelActions() { XmlTestLoader testLoader = createTestLoader("classpath:org/citrusframework/camel/xml/camel-jbang-add-plugin.citrus.it.xml"); CamelContext citrusCamelContext = new DefaultCamelContext(); diff --git a/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/xml/CamelKubernetesDeleteIntegrationTest.java b/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/xml/CamelKubernetesDeleteIntegrationTest.java index da1c91ca03..d447941bd2 100644 --- a/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/xml/CamelKubernetesDeleteIntegrationTest.java +++ b/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/xml/CamelKubernetesDeleteIntegrationTest.java @@ -63,7 +63,7 @@ public void setup() { } @Test - public void shouldLoadCamelActions() throws Exception { + public void shouldLoadCamelActions() { XmlTestLoader testLoader = createTestLoader("classpath:org/citrusframework/camel/xml/camel-jbang-kubernetes-delete.citrus.it.xml"); CamelContext citrusCamelContext = new DefaultCamelContext(); diff --git a/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/xml/CamelKubernetesRunIntegrationTest.java b/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/xml/CamelKubernetesRunIntegrationTest.java index 1480b47c38..54603c2722 100644 --- a/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/xml/CamelKubernetesRunIntegrationTest.java +++ b/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/xml/CamelKubernetesRunIntegrationTest.java @@ -64,7 +64,7 @@ public void setup() { } @Test - public void shouldLoadCamelActions() throws Exception { + public void shouldLoadCamelActions() { XmlTestLoader testLoader = createTestLoader("classpath:org/citrusframework/camel/xml/camel-jbang-kubernetes-run.citrus.it.xml"); CamelContext citrusCamelContext = new DefaultCamelContext(); diff --git a/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/xml/CamelKubernetesVerifyIntegrationTest.java b/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/xml/CamelKubernetesVerifyIntegrationTest.java index 0cad275c96..3607505602 100644 --- a/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/xml/CamelKubernetesVerifyIntegrationTest.java +++ b/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/xml/CamelKubernetesVerifyIntegrationTest.java @@ -58,7 +58,7 @@ public void setup() { } @Test - public void shouldLoadCamelActions() throws Exception { + public void shouldLoadCamelActions() { XmlTestLoader testLoader = createTestLoader("classpath:org/citrusframework/camel/xml/camel-jbang-kubernetes-verify.citrus.it.xml"); CamelContext citrusCamelContext = new DefaultCamelContext(); diff --git a/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/xml/ControlBusTest.java b/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/xml/ControlBusTest.java index afa9641601..a21772957a 100644 --- a/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/xml/ControlBusTest.java +++ b/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/xml/ControlBusTest.java @@ -36,7 +36,7 @@ public void shouldLoadCamelActions() throws Exception { CamelContext citrusCamelContext = new DefaultCamelContext(); citrusCamelContext.addRoutes(new RouteBuilder(citrusCamelContext) { @Override - public void configure() throws Exception { + public void configure() { from("direct:hello") .routeId("route_1") .to("log:info"); diff --git a/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/xml/CreateRoutesTest.java b/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/xml/CreateRoutesTest.java index be26c55536..57a569d3de 100644 --- a/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/xml/CreateRoutesTest.java +++ b/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/xml/CreateRoutesTest.java @@ -29,7 +29,7 @@ public class CreateRoutesTest extends AbstractXmlActionTest { @Test - public void shouldLoadCamelActions() throws Exception { + public void shouldLoadCamelActions() { XmlTestLoader testLoader = createTestLoader("classpath:org/citrusframework/camel/xml/camel-create-routes.citrus.it.xml"); CamelContext citrusCamelContext = new DefaultCamelContext(); diff --git a/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/xml/JBangCmdReceiveTest.java b/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/xml/JBangCmdReceiveTest.java index 72a4410d15..88fe17d8a4 100644 --- a/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/xml/JBangCmdReceiveTest.java +++ b/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/xml/JBangCmdReceiveTest.java @@ -40,7 +40,7 @@ public static void beforeClass() { } @Test - public void shouldLoadCamelActions() throws Exception { + public void shouldLoadCamelActions() { XmlTestLoader testLoader = createTestLoader("classpath:org/citrusframework/camel/xml/camel-jbang-cmd-receive.citrus.it.xml"); CamelContext citrusCamelContext = new DefaultCamelContext(); diff --git a/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/xml/JBangCmdSendTest.java b/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/xml/JBangCmdSendTest.java index 85db8b178e..e642e85eb0 100644 --- a/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/xml/JBangCmdSendTest.java +++ b/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/xml/JBangCmdSendTest.java @@ -40,7 +40,7 @@ public static void beforeClass() { } @Test - public void shouldLoadCamelActions() throws Exception { + public void shouldLoadCamelActions() { XmlTestLoader testLoader = createTestLoader("classpath:org/citrusframework/camel/xml/camel-jbang-cmd-send.citrus.it.xml"); CamelContext citrusCamelContext = new DefaultCamelContext(); diff --git a/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/xml/JBangTest.java b/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/xml/JBangTest.java index f36ee15d4f..aa9e37d2ca 100644 --- a/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/xml/JBangTest.java +++ b/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/xml/JBangTest.java @@ -42,7 +42,7 @@ public static void beforeClass() { } @Test - public void shouldLoadCamelActions() throws Exception { + public void shouldLoadCamelActions() { XmlTestLoader testLoader = createTestLoader("classpath:org/citrusframework/camel/xml/camel-jbang.citrus.it.xml"); CamelContext citrusCamelContext = new DefaultCamelContext(); diff --git a/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/xml/RemoveRoutesTest.java b/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/xml/RemoveRoutesTest.java index fe2128d396..5bfba25d12 100644 --- a/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/xml/RemoveRoutesTest.java +++ b/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/xml/RemoveRoutesTest.java @@ -36,7 +36,7 @@ public void shouldLoadCamelActions() throws Exception { CamelContext citrusCamelContext = new DefaultCamelContext(); citrusCamelContext.addRoutes(new RouteBuilder(citrusCamelContext) { @Override - public void configure() throws Exception { + public void configure() { from("direct:hello") .routeId("route_1") .autoStartup(false) diff --git a/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/xml/StartRoutesTest.java b/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/xml/StartRoutesTest.java index 8352a187cd..3fea52b2c8 100644 --- a/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/xml/StartRoutesTest.java +++ b/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/xml/StartRoutesTest.java @@ -36,7 +36,7 @@ public void shouldLoadCamelActions() throws Exception { CamelContext citrusCamelContext = new DefaultCamelContext(); citrusCamelContext.addRoutes(new RouteBuilder(citrusCamelContext) { @Override - public void configure() throws Exception { + public void configure() { from("direct:hello") .routeId("route_1") .autoStartup(false) diff --git a/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/xml/StopRoutesTest.java b/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/xml/StopRoutesTest.java index b3a15faeba..cb0d793c89 100644 --- a/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/xml/StopRoutesTest.java +++ b/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/xml/StopRoutesTest.java @@ -36,7 +36,7 @@ public void shouldLoadCamelActions() throws Exception { CamelContext citrusCamelContext = new DefaultCamelContext(); citrusCamelContext.addRoutes(new RouteBuilder(citrusCamelContext) { @Override - public void configure() throws Exception { + public void configure() { from("direct:hello") .routeId("route_1") .to("log:info"); diff --git a/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/xml/infra/CamelRunInfraTest.java b/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/xml/infra/CamelRunInfraTest.java index 8756871faf..78fe129fe3 100644 --- a/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/xml/infra/CamelRunInfraTest.java +++ b/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/xml/infra/CamelRunInfraTest.java @@ -74,7 +74,7 @@ public void init() { } @Test - public void shouldLoadCamelActions() throws Exception { + public void shouldLoadCamelActions() { XmlTestLoader testLoader = createTestLoader("classpath:org/citrusframework/camel/xml/infra/camel-run-infra.citrus.it.xml"); CamelContext citrusCamelContext = new DefaultCamelContext(); diff --git a/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/xml/infra/CamelStopInfraTest.java b/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/xml/infra/CamelStopInfraTest.java index 5f09bd6566..b9847c4059 100644 --- a/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/xml/infra/CamelStopInfraTest.java +++ b/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/xml/infra/CamelStopInfraTest.java @@ -33,7 +33,7 @@ public class CamelStopInfraTest extends AbstractXmlActionTest { @Test - public void shouldLoadCamelActions() throws Exception { + public void shouldLoadCamelActions() { XmlTestLoader testLoader = createTestLoader("classpath:org/citrusframework/camel/xml/infra/camel-stop-infra.citrus.it.xml"); CamelContext citrusCamelContext = new DefaultCamelContext(); diff --git a/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/yaml/CamelAddPluginTest.java b/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/yaml/CamelAddPluginTest.java index d72a95289c..c318853d1b 100644 --- a/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/yaml/CamelAddPluginTest.java +++ b/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/yaml/CamelAddPluginTest.java @@ -43,7 +43,7 @@ public void setup() { } @Test - public void shouldLoadCamelActions() throws Exception { + public void shouldLoadCamelActions() { YamlTestLoader testLoader = createTestLoader("classpath:org/citrusframework/camel/yaml/camel-jbang-add-plugin.citrus.it.yaml"); CamelContext citrusCamelContext = new DefaultCamelContext(); diff --git a/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/yaml/CamelKubernetesDeleteIntegrationTest.java b/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/yaml/CamelKubernetesDeleteIntegrationTest.java index 193fec6b36..7f5a4c0250 100644 --- a/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/yaml/CamelKubernetesDeleteIntegrationTest.java +++ b/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/yaml/CamelKubernetesDeleteIntegrationTest.java @@ -63,7 +63,7 @@ public void setup() { } @Test - public void shouldLoadCamelActions() throws Exception { + public void shouldLoadCamelActions() { YamlTestLoader testLoader = createTestLoader("classpath:org/citrusframework/camel/yaml/camel-jbang-kubernetes-delete.citrus.it.yaml"); CamelContext citrusCamelContext = new DefaultCamelContext(); diff --git a/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/yaml/CamelKubernetesRunIntegrationTest.java b/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/yaml/CamelKubernetesRunIntegrationTest.java index 165c41c725..a8ee3714c1 100644 --- a/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/yaml/CamelKubernetesRunIntegrationTest.java +++ b/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/yaml/CamelKubernetesRunIntegrationTest.java @@ -64,7 +64,7 @@ public void setup() { } @Test - public void shouldLoadCamelActions() throws Exception { + public void shouldLoadCamelActions() { YamlTestLoader testLoader = createTestLoader("classpath:org/citrusframework/camel/yaml/camel-jbang-kubernetes-run.citrus.it.yaml"); CamelContext citrusCamelContext = new DefaultCamelContext(); diff --git a/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/yaml/CamelKubernetesVerifyIntegrationTest.java b/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/yaml/CamelKubernetesVerifyIntegrationTest.java index b658baae58..f8d1449bec 100644 --- a/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/yaml/CamelKubernetesVerifyIntegrationTest.java +++ b/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/yaml/CamelKubernetesVerifyIntegrationTest.java @@ -58,7 +58,7 @@ public void setup() { } @Test - public void shouldLoadCamelActions() throws Exception { + public void shouldLoadCamelActions() { YamlTestLoader testLoader = createTestLoader("classpath:org/citrusframework/camel/yaml/camel-jbang-kubernetes-verify.citrus.it.yaml"); CamelContext citrusCamelContext = new DefaultCamelContext(); diff --git a/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/yaml/ControlBusTest.java b/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/yaml/ControlBusTest.java index a86b86d24e..45656a346d 100644 --- a/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/yaml/ControlBusTest.java +++ b/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/yaml/ControlBusTest.java @@ -36,7 +36,7 @@ public void shouldLoadCamelActions() throws Exception { CamelContext citrusCamelContext = new DefaultCamelContext(); citrusCamelContext.addRoutes(new RouteBuilder(citrusCamelContext) { @Override - public void configure() throws Exception { + public void configure() { from("direct:hello") .routeId("route_1") .to("log:info"); diff --git a/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/yaml/CreateRoutesTest.java b/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/yaml/CreateRoutesTest.java index 04d479bd41..cd80829f2e 100644 --- a/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/yaml/CreateRoutesTest.java +++ b/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/yaml/CreateRoutesTest.java @@ -29,7 +29,7 @@ public class CreateRoutesTest extends AbstractYamlActionTest { @Test - public void shouldLoadCamelActions() throws Exception { + public void shouldLoadCamelActions() { YamlTestLoader testLoader = createTestLoader("classpath:org/citrusframework/camel/yaml/camel-create-route.citrus.it.yaml"); CamelContext citrusCamelContext = new DefaultCamelContext(); diff --git a/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/yaml/JBangCmdReceiveTest.java b/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/yaml/JBangCmdReceiveTest.java index 4c6ffe0733..1f3b7026d3 100644 --- a/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/yaml/JBangCmdReceiveTest.java +++ b/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/yaml/JBangCmdReceiveTest.java @@ -40,7 +40,7 @@ public static void beforeClass() { } @Test - public void shouldLoadCamelActions() throws Exception { + public void shouldLoadCamelActions() { YamlTestLoader testLoader = createTestLoader("classpath:org/citrusframework/camel/yaml/camel-jbang-cmd-receive.citrus.it.yaml"); CamelContext citrusCamelContext = new DefaultCamelContext(); diff --git a/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/yaml/JBangCmdSendTest.java b/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/yaml/JBangCmdSendTest.java index 566bc816af..b9b772e795 100644 --- a/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/yaml/JBangCmdSendTest.java +++ b/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/yaml/JBangCmdSendTest.java @@ -40,7 +40,7 @@ public static void beforeClass() { } @Test - public void shouldLoadCamelActions() throws Exception { + public void shouldLoadCamelActions() { YamlTestLoader testLoader = createTestLoader("classpath:org/citrusframework/camel/yaml/camel-jbang-cmd-send.citrus.it.yaml"); CamelContext citrusCamelContext = new DefaultCamelContext(); diff --git a/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/yaml/JBangTest.java b/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/yaml/JBangTest.java index 4106e6d325..1022ca260c 100644 --- a/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/yaml/JBangTest.java +++ b/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/yaml/JBangTest.java @@ -42,7 +42,7 @@ public static void beforeClass() { } @Test - public void shouldLoadCamelActions() throws Exception { + public void shouldLoadCamelActions() { YamlTestLoader testLoader = createTestLoader("classpath:org/citrusframework/camel/yaml/camel-jbang.citrus.it.yaml"); CamelContext citrusCamelContext = new DefaultCamelContext(); diff --git a/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/yaml/RemoveRouteTest.java b/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/yaml/RemoveRouteTest.java index d4b8058e9f..12b40b91e8 100644 --- a/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/yaml/RemoveRouteTest.java +++ b/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/yaml/RemoveRouteTest.java @@ -36,7 +36,7 @@ public void shouldLoadCamelActions() throws Exception { CamelContext citrusCamelContext = new DefaultCamelContext(); citrusCamelContext.addRoutes(new RouteBuilder(citrusCamelContext) { @Override - public void configure() throws Exception { + public void configure() { from("direct:hello") .routeId("route_1") .autoStartup(false) diff --git a/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/yaml/StartRouteTest.java b/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/yaml/StartRouteTest.java index 0dca478350..4719ff117d 100644 --- a/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/yaml/StartRouteTest.java +++ b/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/yaml/StartRouteTest.java @@ -36,7 +36,7 @@ public void shouldLoadCamelActions() throws Exception { CamelContext citrusCamelContext = new DefaultCamelContext(); citrusCamelContext.addRoutes(new RouteBuilder(citrusCamelContext) { @Override - public void configure() throws Exception { + public void configure() { from("direct:hello") .routeId("route_1") .autoStartup(false) diff --git a/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/yaml/StopRouteTest.java b/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/yaml/StopRouteTest.java index 00645d7372..1196a43834 100644 --- a/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/yaml/StopRouteTest.java +++ b/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/yaml/StopRouteTest.java @@ -36,7 +36,7 @@ public void shouldLoadCamelActions() throws Exception { CamelContext citrusCamelContext = new DefaultCamelContext(); citrusCamelContext.addRoutes(new RouteBuilder(citrusCamelContext) { @Override - public void configure() throws Exception { + public void configure() { from("direct:hello") .routeId("route_1") .to("log:info"); diff --git a/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/yaml/infra/CamelRunInfraTest.java b/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/yaml/infra/CamelRunInfraTest.java index 1ef8ebd140..2b20c6f0c8 100644 --- a/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/yaml/infra/CamelRunInfraTest.java +++ b/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/yaml/infra/CamelRunInfraTest.java @@ -74,7 +74,7 @@ public void init() { } @Test - public void shouldLoadCamelActions() throws Exception { + public void shouldLoadCamelActions() { YamlTestLoader testLoader = createTestLoader("classpath:org/citrusframework/camel/yaml/infra/camel-run-infra.citrus.it.yaml"); CamelContext citrusCamelContext = new DefaultCamelContext(); diff --git a/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/yaml/infra/CamelStopInfraTest.java b/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/yaml/infra/CamelStopInfraTest.java index 264275eb7d..02fdaed808 100644 --- a/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/yaml/infra/CamelStopInfraTest.java +++ b/endpoints/citrus-camel/src/test/java/org/citrusframework/camel/yaml/infra/CamelStopInfraTest.java @@ -33,7 +33,7 @@ public class CamelStopInfraTest extends AbstractYamlActionTest { @Test - public void shouldLoadCamelActions() throws Exception { + public void shouldLoadCamelActions() { YamlTestLoader testLoader = createTestLoader("classpath:org/citrusframework/camel/yaml/infra/camel-stop-infra.citrus.it.yaml"); CamelContext citrusCamelContext = new DefaultCamelContext(); diff --git a/endpoints/citrus-ftp/src/test/java/org/citrusframework/ftp/client/FtpClientTest.java b/endpoints/citrus-ftp/src/test/java/org/citrusframework/ftp/client/FtpClientTest.java index 3a8040e2ea..fcbb16ffd1 100644 --- a/endpoints/citrus-ftp/src/test/java/org/citrusframework/ftp/client/FtpClientTest.java +++ b/endpoints/citrus-ftp/src/test/java/org/citrusframework/ftp/client/FtpClientTest.java @@ -127,7 +127,7 @@ private void initMockFtpServer() throws InterruptedException { } @AfterClass - public void tearDown() throws Exception { + public void tearDown() { ftpClient.destroy(); fakeFtpServer.stop(); } diff --git a/endpoints/citrus-ftp/src/test/java/org/citrusframework/ftp/client/FtpEndpointComponentTest.java b/endpoints/citrus-ftp/src/test/java/org/citrusframework/ftp/client/FtpEndpointComponentTest.java index 59c26ce838..5449970739 100644 --- a/endpoints/citrus-ftp/src/test/java/org/citrusframework/ftp/client/FtpEndpointComponentTest.java +++ b/endpoints/citrus-ftp/src/test/java/org/citrusframework/ftp/client/FtpEndpointComponentTest.java @@ -34,7 +34,7 @@ public class FtpEndpointComponentTest { private TestContext context = new TestContext(); @Test - public void testCreateClientEndpoint() throws Exception { + public void testCreateClientEndpoint() { FtpEndpointComponent component = new FtpEndpointComponent(); Endpoint endpoint = component.createEndpoint("ftp://localhost:2221", context); @@ -59,7 +59,7 @@ public void testCreateClientEndpoint() throws Exception { } @Test - public void testCreateClientEndpointWithParameters() throws Exception { + public void testCreateClientEndpointWithParameters() { FtpEndpointComponent component = new FtpEndpointComponent(); Endpoint endpoint = component.createEndpoint("ftp:localhost:22220?user=admin&password=consol&timeout=10000", context); diff --git a/endpoints/citrus-ftp/src/test/java/org/citrusframework/ftp/client/SftpEndpointComponentTest.java b/endpoints/citrus-ftp/src/test/java/org/citrusframework/ftp/client/SftpEndpointComponentTest.java index 1268e5c5c8..01bc94c9ac 100644 --- a/endpoints/citrus-ftp/src/test/java/org/citrusframework/ftp/client/SftpEndpointComponentTest.java +++ b/endpoints/citrus-ftp/src/test/java/org/citrusframework/ftp/client/SftpEndpointComponentTest.java @@ -34,7 +34,7 @@ public class SftpEndpointComponentTest { private TestContext context = new TestContext(); @Test - public void testCreateClientEndpoint() throws Exception { + public void testCreateClientEndpoint() { SftpEndpointComponent component = new SftpEndpointComponent(); Endpoint endpoint = component.createEndpoint("sftp://localhost:2221", context); @@ -59,7 +59,7 @@ public void testCreateClientEndpoint() throws Exception { } @Test - public void testCreateClientEndpointWithParameters() throws Exception { + public void testCreateClientEndpointWithParameters() { SftpEndpointComponent component = new SftpEndpointComponent(); Endpoint endpoint = component.createEndpoint("sftp:localhost:22220?user=admin&password=consol&timeout=10000", context); diff --git a/endpoints/citrus-ftp/src/test/java/org/citrusframework/ftp/config/annotation/FtpServerConfigParserTest.java b/endpoints/citrus-ftp/src/test/java/org/citrusframework/ftp/config/annotation/FtpServerConfigParserTest.java index a0e3ada34a..1e12c2ef8a 100644 --- a/endpoints/citrus-ftp/src/test/java/org/citrusframework/ftp/config/annotation/FtpServerConfigParserTest.java +++ b/endpoints/citrus-ftp/src/test/java/org/citrusframework/ftp/config/annotation/FtpServerConfigParserTest.java @@ -101,7 +101,7 @@ public void setMocks() { } @Test - public void testHttpServerParser() throws IOException { + public void testHttpServerParser() { CitrusAnnotations.injectEndpoints(this, context); // 1st message sender diff --git a/endpoints/citrus-ftp/src/test/java/org/citrusframework/ftp/config/xml/FtpServerParserTest.java b/endpoints/citrus-ftp/src/test/java/org/citrusframework/ftp/config/xml/FtpServerParserTest.java index 3c7aa14254..2f1227e0d1 100644 --- a/endpoints/citrus-ftp/src/test/java/org/citrusframework/ftp/config/xml/FtpServerParserTest.java +++ b/endpoints/citrus-ftp/src/test/java/org/citrusframework/ftp/config/xml/FtpServerParserTest.java @@ -40,7 +40,7 @@ public class FtpServerParserTest extends AbstractBeanDefinitionParserTest { @Test - public void testFtpServerParser() throws IOException { + public void testFtpServerParser() { Map servers = beanDefinitionContext.getBeansOfType(FtpServer.class); Assert.assertEquals(servers.size(), 4); diff --git a/endpoints/citrus-ftp/src/test/java/org/citrusframework/ftp/server/FtpServerTest.java b/endpoints/citrus-ftp/src/test/java/org/citrusframework/ftp/server/FtpServerTest.java index 934435f045..ed61174cd8 100644 --- a/endpoints/citrus-ftp/src/test/java/org/citrusframework/ftp/server/FtpServerTest.java +++ b/endpoints/citrus-ftp/src/test/java/org/citrusframework/ftp/server/FtpServerTest.java @@ -26,7 +26,7 @@ public class FtpServerTest extends AbstractTestNGUnitTest { @Test - public void startupAndShutdownTest() throws Exception { + public void startupAndShutdownTest() { FtpEndpointConfiguration endpointConfiguration = new FtpEndpointConfiguration(); FtpServer server = new FtpServer(endpointConfiguration); diff --git a/endpoints/citrus-http/src/main/java/org/citrusframework/http/client/BasicAuthClientHttpRequestFactory.java b/endpoints/citrus-http/src/main/java/org/citrusframework/http/client/BasicAuthClientHttpRequestFactory.java index ca1bc5c774..3d734739f2 100644 --- a/endpoints/citrus-http/src/main/java/org/citrusframework/http/client/BasicAuthClientHttpRequestFactory.java +++ b/endpoints/citrus-http/src/main/java/org/citrusframework/http/client/BasicAuthClientHttpRequestFactory.java @@ -62,7 +62,7 @@ public class BasicAuthClientHttpRequestFactory implements FactoryBean, Ini /** * Construct new security handler for basic authentication. */ - public SecurityHandler getObject() throws Exception { + public SecurityHandler getObject() { ConstraintSecurityHandler securityHandler = new ConstraintSecurityHandler(); securityHandler.setAuthenticator(authenticator); securityHandler.setRealmName(realm); diff --git a/endpoints/citrus-http/src/test/java/org/citrusframework/http/client/HttpEndpointComponentTest.java b/endpoints/citrus-http/src/test/java/org/citrusframework/http/client/HttpEndpointComponentTest.java index e83fbd5f02..fef27af67d 100644 --- a/endpoints/citrus-http/src/test/java/org/citrusframework/http/client/HttpEndpointComponentTest.java +++ b/endpoints/citrus-http/src/test/java/org/citrusframework/http/client/HttpEndpointComponentTest.java @@ -49,7 +49,7 @@ public void setup() { } @Test - public void testCreateClientEndpoint() throws Exception { + public void testCreateClientEndpoint() { HttpEndpointComponent component = new HttpEndpointComponent(); Endpoint endpoint = component.createEndpoint("http://localhost:8088/test", context); @@ -63,7 +63,7 @@ public void testCreateClientEndpoint() throws Exception { } @Test - public void testCreateClientEndpointWithParameters() throws Exception { + public void testCreateClientEndpointWithParameters() { HttpEndpointComponent component = new HttpEndpointComponent(); reset(referenceResolver); @@ -82,7 +82,7 @@ public void testCreateClientEndpointWithParameters() throws Exception { } @Test - public void testCreateClientEndpointWithCustomParameters() throws Exception { + public void testCreateClientEndpointWithCustomParameters() { HttpEndpointComponent component = new HttpEndpointComponent(); Endpoint endpoint = component.createEndpoint("http://localhost:8088/test?requestMethod=DELETE&customParam=foo", context); diff --git a/endpoints/citrus-http/src/test/java/org/citrusframework/http/client/HttpsEndpointComponentTest.java b/endpoints/citrus-http/src/test/java/org/citrusframework/http/client/HttpsEndpointComponentTest.java index 6040cdfb65..f46ec50da9 100644 --- a/endpoints/citrus-http/src/test/java/org/citrusframework/http/client/HttpsEndpointComponentTest.java +++ b/endpoints/citrus-http/src/test/java/org/citrusframework/http/client/HttpsEndpointComponentTest.java @@ -49,7 +49,7 @@ public void setup() { } @Test - public void testCreateClientEndpoint() throws Exception { + public void testCreateClientEndpoint() { HttpsEndpointComponent component = new HttpsEndpointComponent(); Endpoint endpoint = component.createEndpoint("https://localhost:8088/test", context); @@ -63,7 +63,7 @@ public void testCreateClientEndpoint() throws Exception { } @Test - public void testCreateClientEndpointWithParameters() throws Exception { + public void testCreateClientEndpointWithParameters() { HttpsEndpointComponent component = new HttpsEndpointComponent(); reset(referenceResolver); @@ -80,7 +80,7 @@ public void testCreateClientEndpointWithParameters() throws Exception { } @Test - public void testCreateClientEndpointWithCustomParameters() throws Exception { + public void testCreateClientEndpointWithCustomParameters() { HttpsEndpointComponent component = new HttpsEndpointComponent(); Endpoint endpoint = component.createEndpoint("https://localhost:8088/test?requestMethod=DELETE&customParam=foo", context); diff --git a/endpoints/citrus-http/src/test/java/org/citrusframework/http/servlet/CitrusDispatcherServletTest.java b/endpoints/citrus-http/src/test/java/org/citrusframework/http/servlet/CitrusDispatcherServletTest.java index fa1a89c17b..1fed7ab419 100644 --- a/endpoints/citrus-http/src/test/java/org/citrusframework/http/servlet/CitrusDispatcherServletTest.java +++ b/endpoints/citrus-http/src/test/java/org/citrusframework/http/servlet/CitrusDispatcherServletTest.java @@ -57,7 +57,7 @@ public void setUp() { } @Test - public void testNoBeansInContext() throws Exception { + public void testNoBeansInContext() { reset(httpServer); GenericApplicationContext applicationContext = new GenericApplicationContext(); applicationContext.refresh(); @@ -67,7 +67,7 @@ public void testNoBeansInContext() throws Exception { } @Test - public void testConfigureHandlerInterceptor() throws Exception { + public void testConfigureHandlerInterceptor() { List interceptors = new ArrayList<>(); interceptors.add(new LoggingHandlerInterceptor()); @@ -92,7 +92,7 @@ public void testConfigureHandlerInterceptor() throws Exception { } @Test - public void testConfigureMessageController() throws Exception { + public void testConfigureMessageController() { reset(httpServer); when(httpServer.getInterceptors()).thenReturn(null); diff --git a/endpoints/citrus-http/src/test/java/org/citrusframework/http/servlet/GzipServletFilterTest.java b/endpoints/citrus-http/src/test/java/org/citrusframework/http/servlet/GzipServletFilterTest.java index e728fcf988..e480a1dcff 100644 --- a/endpoints/citrus-http/src/test/java/org/citrusframework/http/servlet/GzipServletFilterTest.java +++ b/endpoints/citrus-http/src/test/java/org/citrusframework/http/servlet/GzipServletFilterTest.java @@ -74,7 +74,7 @@ public void testDoFilterGzipRequestCompression() throws Exception { MockHttpServletResponse response = new MockHttpServletResponse(); MockFilterChain filterChain = new MockFilterChain(servlet, new GzipServletFilter(), new OncePerRequestFilter() { @Override - protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException { + protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws IOException { Assert.assertEquals(FileUtils.readToString(request.getInputStream()), "Should be decompressed"); } }); @@ -89,7 +89,7 @@ public void testDoFilterGzipResponseCompression() throws Exception { MockHttpServletResponse response = new MockHttpServletResponse(); MockFilterChain filterChain = new MockFilterChain(servlet, new GzipServletFilter(), new OncePerRequestFilter() { @Override - protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException { + protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws IOException { response.getOutputStream().write("Should be compressed".getBytes()); } }); @@ -110,7 +110,7 @@ public void testDoFilterNoCompression() throws Exception { MockHttpServletResponse response = new MockHttpServletResponse(); MockFilterChain filterChain = new MockFilterChain(servlet, new GzipServletFilter(), new OncePerRequestFilter() { @Override - protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException { + protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws IOException { response.getOutputStream().write("Should not be compressed".getBytes()); } }); diff --git a/endpoints/citrus-http/src/test/java/org/citrusframework/http/servlet/RequestCachingServletFilterTest.java b/endpoints/citrus-http/src/test/java/org/citrusframework/http/servlet/RequestCachingServletFilterTest.java index 9ddd272d28..c191990f93 100644 --- a/endpoints/citrus-http/src/test/java/org/citrusframework/http/servlet/RequestCachingServletFilterTest.java +++ b/endpoints/citrus-http/src/test/java/org/citrusframework/http/servlet/RequestCachingServletFilterTest.java @@ -60,7 +60,7 @@ public void testDoFilterCached() throws Exception { MockHttpServletResponse response = new MockHttpServletResponse(); MockFilterChain filterChain = new MockFilterChain(servlet, new RequestCachingServletFilter(), new OncePerRequestFilter() { @Override - protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException { + protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws IOException { StreamUtils.copy(request.getInputStream(), System.out); StreamUtils.copy(request.getInputStream(), System.out); StreamUtils.copy(request.getInputStream(), System.out); @@ -78,7 +78,7 @@ public void testDoFilterGetQueryParamsPost() throws Exception { MockHttpServletResponse response = new MockHttpServletResponse(); MockFilterChain filterChain = new MockFilterChain(servlet, new RequestCachingServletFilter(), new OncePerRequestFilter() { @Override - protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException { + protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws IOException { StreamUtils.copy(request.getInputStream(), System.out); Map parameters = request.getParameterMap(); @@ -98,7 +98,7 @@ public void testDoFilterGetQueryParamsGet() throws Exception { MockHttpServletResponse response = new MockHttpServletResponse(); MockFilterChain filterChain = new MockFilterChain(servlet, new RequestCachingServletFilter(), new OncePerRequestFilter() { @Override - protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException { + protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws IOException { StreamUtils.copy(request.getInputStream(), System.out); Map parameters = request.getParameterMap(); diff --git a/endpoints/citrus-http/src/test/java/org/citrusframework/http/validation/FormUrlEncodedMessageValidatorTest.java b/endpoints/citrus-http/src/test/java/org/citrusframework/http/validation/FormUrlEncodedMessageValidatorTest.java index a04201ad93..a0518c0916 100644 --- a/endpoints/citrus-http/src/test/java/org/citrusframework/http/validation/FormUrlEncodedMessageValidatorTest.java +++ b/endpoints/citrus-http/src/test/java/org/citrusframework/http/validation/FormUrlEncodedMessageValidatorTest.java @@ -57,7 +57,7 @@ protected TestContextFactory createTestContextFactory() { """; @Test - public void testValidateMessagePayload() throws Exception { + public void testValidateMessagePayload() { Message controlMessage = new DefaultMessage(expectedFormData); Message receivedMessage = new DefaultMessage("password=s%21cr%21t&username=test") @@ -68,7 +68,7 @@ public void testValidateMessagePayload() throws Exception { } @Test(expectedExceptions = ValidationException.class) - public void testValidationError() throws Exception { + public void testValidationError() { Message controlMessage = new DefaultMessage(expectedFormData); Message receivedMessage = new DefaultMessage("password=s%21cr%21t&username=other") @@ -79,7 +79,7 @@ public void testValidationError() throws Exception { } @Test(expectedExceptions = ValidationException.class) - public void testValidationErrorMissingFormAction() throws Exception { + public void testValidationErrorMissingFormAction() { Message controlMessage = new DefaultMessage(expectedFormData); Message receivedMessage = new DefaultMessage("password=s%21cr%21t&username=test"); diff --git a/endpoints/citrus-jms/src/main/java/org/citrusframework/jms/config/xml/JmsEndpointAdapterParser.java b/endpoints/citrus-jms/src/main/java/org/citrusframework/jms/config/xml/JmsEndpointAdapterParser.java index 9df9f3bb17..cfa142bd23 100644 --- a/endpoints/citrus-jms/src/main/java/org/citrusframework/jms/config/xml/JmsEndpointAdapterParser.java +++ b/endpoints/citrus-jms/src/main/java/org/citrusframework/jms/config/xml/JmsEndpointAdapterParser.java @@ -82,7 +82,7 @@ public void setFallbackEndpointAdapter(EndpointAdapter fallbackEndpointAdapter) } @Override - public JmsEndpointAdapter getObject() throws Exception { + public JmsEndpointAdapter getObject() { JmsEndpointAdapter endpointAdapter = new JmsEndpointAdapter(endpointConfiguration); endpointAdapter.setTestContextFactory(testContextFactory); diff --git a/endpoints/citrus-jms/src/main/java/org/citrusframework/jms/config/xml/PurgeJmsQueuesActionParser.java b/endpoints/citrus-jms/src/main/java/org/citrusframework/jms/config/xml/PurgeJmsQueuesActionParser.java index 9ab7444b05..f00f827c0b 100644 --- a/endpoints/citrus-jms/src/main/java/org/citrusframework/jms/config/xml/PurgeJmsQueuesActionParser.java +++ b/endpoints/citrus-jms/src/main/java/org/citrusframework/jms/config/xml/PurgeJmsQueuesActionParser.java @@ -133,7 +133,7 @@ public void setSleepTime(long sleepTime) { } @Override - public PurgeJmsQueuesAction getObject() throws Exception { + public PurgeJmsQueuesAction getObject() { return builder.build(); } diff --git a/endpoints/citrus-jms/src/test/java/org/citrusframework/jms/config/annotation/JmsEndpointConfigParserExceptionTest.java b/endpoints/citrus-jms/src/test/java/org/citrusframework/jms/config/annotation/JmsEndpointConfigParserExceptionTest.java index 4a30817e6a..941d67a5e7 100644 --- a/endpoints/citrus-jms/src/test/java/org/citrusframework/jms/config/annotation/JmsEndpointConfigParserExceptionTest.java +++ b/endpoints/citrus-jms/src/test/java/org/citrusframework/jms/config/annotation/JmsEndpointConfigParserExceptionTest.java @@ -40,7 +40,7 @@ public class JmsEndpointConfigParserExceptionTest extends AbstractTestNGUnitTest private ReferenceResolver referenceResolver; @BeforeClass - public void setup() throws JMSException { + public void setup() { MockitoAnnotations.openMocks(this); } diff --git a/endpoints/citrus-jms/src/test/java/org/citrusframework/jms/config/annotation/JmsSyncEndpointConfigParserExceptionTest.java b/endpoints/citrus-jms/src/test/java/org/citrusframework/jms/config/annotation/JmsSyncEndpointConfigParserExceptionTest.java index 8b3febe868..d430ecb32b 100644 --- a/endpoints/citrus-jms/src/test/java/org/citrusframework/jms/config/annotation/JmsSyncEndpointConfigParserExceptionTest.java +++ b/endpoints/citrus-jms/src/test/java/org/citrusframework/jms/config/annotation/JmsSyncEndpointConfigParserExceptionTest.java @@ -40,7 +40,7 @@ public class JmsSyncEndpointConfigParserExceptionTest extends AbstractTestNGUnit private ReferenceResolver referenceResolver; @BeforeClass - public void setup() throws JMSException { + public void setup() { MockitoAnnotations.openMocks(this); } diff --git a/endpoints/citrus-jms/src/test/java/org/citrusframework/jms/config/xml/JmsEndpointAdapterParserTest.java b/endpoints/citrus-jms/src/test/java/org/citrusframework/jms/config/xml/JmsEndpointAdapterParserTest.java index 36d494f6ff..4cfa46aa0e 100644 --- a/endpoints/citrus-jms/src/test/java/org/citrusframework/jms/config/xml/JmsEndpointAdapterParserTest.java +++ b/endpoints/citrus-jms/src/test/java/org/citrusframework/jms/config/xml/JmsEndpointAdapterParserTest.java @@ -31,7 +31,7 @@ public class JmsEndpointAdapterParserTest extends AbstractBeanDefinitionParserTest { @Test - public void testParseBeanDefinition() throws Exception { + public void testParseBeanDefinition() { Map adapters = beanDefinitionContext.getBeansOfType(JmsEndpointAdapter.class); Assert.assertEquals(adapters.size(), 2); diff --git a/endpoints/citrus-jms/src/test/java/org/citrusframework/jms/endpoint/JmsEndpointComponentTest.java b/endpoints/citrus-jms/src/test/java/org/citrusframework/jms/endpoint/JmsEndpointComponentTest.java index fd542e2636..7efb50ab20 100644 --- a/endpoints/citrus-jms/src/test/java/org/citrusframework/jms/endpoint/JmsEndpointComponentTest.java +++ b/endpoints/citrus-jms/src/test/java/org/citrusframework/jms/endpoint/JmsEndpointComponentTest.java @@ -51,7 +51,7 @@ public void setup() { } @Test - public void testCreateQueueEndpoint() throws Exception { + public void testCreateQueueEndpoint() { JmsEndpointComponent component = new JmsEndpointComponent(); reset(referenceResolver); @@ -69,7 +69,7 @@ public void testCreateQueueEndpoint() throws Exception { } @Test - public void testResolveJmsEndpoint() throws Exception { + public void testResolveJmsEndpoint() { reset(referenceResolver); when(referenceResolver.resolveAll(EndpointComponent.class)).thenReturn(Collections.emptyMap()); @@ -84,7 +84,7 @@ public void testResolveJmsEndpoint() throws Exception { } @Test - public void testCreateTopicEndpoint() throws Exception { + public void testCreateTopicEndpoint() { JmsEndpointComponent component = new JmsEndpointComponent(); reset(referenceResolver); @@ -102,7 +102,7 @@ public void testCreateTopicEndpoint() throws Exception { } @Test - public void testCreateSyncQueueEndpoint() throws Exception { + public void testCreateSyncQueueEndpoint() { JmsEndpointComponent component = new JmsEndpointComponent(); reset(referenceResolver); @@ -118,7 +118,7 @@ public void testCreateSyncQueueEndpoint() throws Exception { } @Test - public void testCreateEndpointWithParameters() throws Exception { + public void testCreateEndpointWithParameters() { JmsEndpointComponent component = new JmsEndpointComponent(); reset(referenceResolver); @@ -137,7 +137,7 @@ public void testCreateEndpointWithParameters() throws Exception { } @Test - public void testCreateEndpointWithNullParameters() throws Exception { + public void testCreateEndpointWithNullParameters() { JmsEndpointComponent component = new JmsEndpointComponent(); reset(referenceResolver); @@ -151,7 +151,7 @@ public void testCreateEndpointWithNullParameters() throws Exception { } @Test - public void testCreateSyncEndpointWithParameters() throws Exception { + public void testCreateSyncEndpointWithParameters() { JmsEndpointComponent component = new JmsEndpointComponent(); reset(referenceResolver); @@ -173,7 +173,7 @@ public void testCreateSyncEndpointWithParameters() throws Exception { } @Test - public void testInvalidEndpointUri() throws Exception { + public void testInvalidEndpointUri() { JmsEndpointComponent component = new JmsEndpointComponent(); try { reset(referenceResolver); diff --git a/endpoints/citrus-jms/src/test/java/org/citrusframework/jms/endpoint/JmsEndpointSyncConsumerTest.java b/endpoints/citrus-jms/src/test/java/org/citrusframework/jms/endpoint/JmsEndpointSyncConsumerTest.java index e90e4c2260..557cd8101a 100644 --- a/endpoints/citrus-jms/src/test/java/org/citrusframework/jms/endpoint/JmsEndpointSyncConsumerTest.java +++ b/endpoints/citrus-jms/src/test/java/org/citrusframework/jms/endpoint/JmsEndpointSyncConsumerTest.java @@ -243,7 +243,7 @@ public void testNoCorrelationKeyFound() { @Test(expectedExceptions = CitrusRuntimeException.class, expectedExceptionsMessageRegExp = "Failed to find JMS reply destination for message correlation key: '123456789'") - public void testSendMessageWithMissingReplyTo() throws JMSException { + public void testSendMessageWithMissingReplyTo() { JmsSyncEndpoint endpoint = new JmsSyncEndpoint(); endpoint.getEndpointConfiguration().setConnectionFactory(connectionFactory); diff --git a/endpoints/citrus-jms/src/test/java/org/citrusframework/jms/endpoint/JmsEndpointSyncProducerTest.java b/endpoints/citrus-jms/src/test/java/org/citrusframework/jms/endpoint/JmsEndpointSyncProducerTest.java index 24a0fa8d3b..e2b72ade2d 100644 --- a/endpoints/citrus-jms/src/test/java/org/citrusframework/jms/endpoint/JmsEndpointSyncProducerTest.java +++ b/endpoints/citrus-jms/src/test/java/org/citrusframework/jms/endpoint/JmsEndpointSyncProducerTest.java @@ -229,7 +229,7 @@ public void testSendMessageWithReplyMessageCorrelator() throws JMSException { } @Test(expectedExceptions = CitrusRuntimeException.class, expectedExceptionsMessageRegExp = "Message is empty - unable to send empty message") - public void testSendEmptyMessage() throws JMSException { + public void testSendEmptyMessage() { JmsSyncEndpoint endpoint = new JmsSyncEndpoint(); endpoint.getEndpointConfiguration().setConnectionFactory(connectionFactory); diff --git a/endpoints/citrus-jms/src/test/java/org/citrusframework/jms/integration/JmsByteMessageJavaIT.java b/endpoints/citrus-jms/src/test/java/org/citrusframework/jms/integration/JmsByteMessageJavaIT.java index a534a786a6..4d660e3cdf 100644 --- a/endpoints/citrus-jms/src/test/java/org/citrusframework/jms/integration/JmsByteMessageJavaIT.java +++ b/endpoints/citrus-jms/src/test/java/org/citrusframework/jms/integration/JmsByteMessageJavaIT.java @@ -30,7 +30,7 @@ public class JmsByteMessageJavaIT extends TestNGCitrusSpringSupport implements TestActionSupport { @CitrusTest - public void jmsByteMessage() throws IOException { + public void jmsByteMessage() { when(send("jms:queue:jms.binary.queue") .message(new DefaultMessage( FileUtils.copyToByteArray( diff --git a/endpoints/citrus-jms/src/test/java/org/citrusframework/jms/integration/JmsGzipMessageJavaIT.java b/endpoints/citrus-jms/src/test/java/org/citrusframework/jms/integration/JmsGzipMessageJavaIT.java index 4319d93a13..2a11d2f449 100644 --- a/endpoints/citrus-jms/src/test/java/org/citrusframework/jms/integration/JmsGzipMessageJavaIT.java +++ b/endpoints/citrus-jms/src/test/java/org/citrusframework/jms/integration/JmsGzipMessageJavaIT.java @@ -30,7 +30,7 @@ public class JmsGzipMessageJavaIT extends TestNGCitrusSpringSupport implements TestActionSupport { @CitrusTest - public void jmsByteMessage() throws IOException { + public void jmsByteMessage() { when(send("jms:queue:jms.gzip.queue") .message(new DefaultMessage( FileUtils.copyToByteArray( diff --git a/endpoints/citrus-jmx/src/main/java/org/citrusframework/jmx/server/JmxEndpointMBean.java b/endpoints/citrus-jmx/src/main/java/org/citrusframework/jmx/server/JmxEndpointMBean.java index 7c95dae5e8..df109755e3 100644 --- a/endpoints/citrus-jmx/src/main/java/org/citrusframework/jmx/server/JmxEndpointMBean.java +++ b/endpoints/citrus-jmx/src/main/java/org/citrusframework/jmx/server/JmxEndpointMBean.java @@ -67,7 +67,7 @@ public class JmxEndpointMBean implements DynamicMBean { * Constructor using the managed bean type. * @param mbean */ - public JmxEndpointMBean(ManagedBeanDefinition mbean, JmxEndpointConfiguration endpointConfiguration, EndpointAdapter endpointAdapter) throws NotCompliantMBeanException { + public JmxEndpointMBean(ManagedBeanDefinition mbean, JmxEndpointConfiguration endpointConfiguration, EndpointAdapter endpointAdapter) { this.mbean = mbean; this.endpointConfiguration = endpointConfiguration; this.endpointAdapter = endpointAdapter; @@ -127,7 +127,7 @@ public AttributeList setAttributes(AttributeList attributes) { } @Override - public Object invoke(String actionName, Object[] params, String[] signature) throws MBeanException, ReflectionException { + public Object invoke(String actionName, Object[] params, String[] signature) { if (logger.isDebugEnabled()) { logger.debug("Received message on JMX server: '{}'", endpointConfiguration.getServerUrl()); } diff --git a/endpoints/citrus-jmx/src/test/java/org/citrusframework/jmx/endpoint/JmxEndpointComponentTest.java b/endpoints/citrus-jmx/src/test/java/org/citrusframework/jmx/endpoint/JmxEndpointComponentTest.java index c569a7be72..bcf5ce77aa 100644 --- a/endpoints/citrus-jmx/src/test/java/org/citrusframework/jmx/endpoint/JmxEndpointComponentTest.java +++ b/endpoints/citrus-jmx/src/test/java/org/citrusframework/jmx/endpoint/JmxEndpointComponentTest.java @@ -35,7 +35,7 @@ public class JmxEndpointComponentTest { private TestContext context = new TestContext(); @Test - public void testCreateClientEndpoint() throws Exception { + public void testCreateClientEndpoint() { JmxEndpointComponent component = new JmxEndpointComponent(); Endpoint endpoint = component.createEndpoint("jmx:rmi:///jndi/rmi://localhost:1099/someService", context); @@ -53,7 +53,7 @@ public void testCreateClientEndpoint() throws Exception { } @Test - public void testCreateClientEndpointWithParameters() throws Exception { + public void testCreateClientEndpointWithParameters() { JmxEndpointComponent component = new JmxEndpointComponent(); Endpoint endpoint = component.createEndpoint("jmx:rmi:///jndi/rmi://localhost:1099/someService?autoReconnect=false&timeout=10000", context); diff --git a/endpoints/citrus-mail/src/main/java/org/citrusframework/mail/message/MailMessageConverter.java b/endpoints/citrus-mail/src/main/java/org/citrusframework/mail/message/MailMessageConverter.java index 565ca73256..9b0ed64cc1 100644 --- a/endpoints/citrus-mail/src/main/java/org/citrusframework/mail/message/MailMessageConverter.java +++ b/endpoints/citrus-mail/src/main/java/org/citrusframework/mail/message/MailMessageConverter.java @@ -250,7 +250,7 @@ protected BodyPart handleImageBinaryPart(MimePart image, String contentType) thr /** * Construct simple body part from binary data just adding file name as content. */ - protected BodyPart handleBinaryPart(MimePart mediaPart, String contentType) throws IOException, MessagingException { + protected BodyPart handleBinaryPart(MimePart mediaPart, String contentType) throws MessagingException { String contentId = mediaPart.getContentID() != null ? "(" + mediaPart.getContentID() + ")" : ""; return new BodyPart(mediaPart.getFileName() + contentId, contentType); } diff --git a/endpoints/citrus-mail/src/test/java/org/citrusframework/mail/client/MailEndpointComponentTest.java b/endpoints/citrus-mail/src/test/java/org/citrusframework/mail/client/MailEndpointComponentTest.java index 938c5a9654..db9d89665c 100644 --- a/endpoints/citrus-mail/src/test/java/org/citrusframework/mail/client/MailEndpointComponentTest.java +++ b/endpoints/citrus-mail/src/test/java/org/citrusframework/mail/client/MailEndpointComponentTest.java @@ -45,7 +45,7 @@ public void setup() { } @Test - public void testCreateClientEndpoint() throws Exception { + public void testCreateClientEndpoint() { MailEndpointComponent component = new MailEndpointComponent(); Endpoint endpoint = component.createEndpoint("smtp://localhost:22000", context); @@ -74,7 +74,7 @@ public void testCreateClientEndpoint() throws Exception { } @Test - public void testCreateClientEndpointWithParameters() throws Exception { + public void testCreateClientEndpointWithParameters() { MailEndpointComponent component = new MailEndpointComponent(); reset(referenceResolver); diff --git a/endpoints/citrus-mail/src/test/java/org/citrusframework/mail/message/MailMessageConverterTest.java b/endpoints/citrus-mail/src/test/java/org/citrusframework/mail/message/MailMessageConverterTest.java index 77c58f8fdc..cc34668490 100644 --- a/endpoints/citrus-mail/src/test/java/org/citrusframework/mail/message/MailMessageConverterTest.java +++ b/endpoints/citrus-mail/src/test/java/org/citrusframework/mail/message/MailMessageConverterTest.java @@ -29,7 +29,7 @@ */ public class MailMessageConverterTest { @Test - public void testParseCharsetFromContentType() throws Exception { + public void testParseCharsetFromContentType() { assertEquals(parseCharsetFromContentType("text/plain; charset=UTF-8"), StandardCharsets.UTF_8.name()); assertEquals(parseCharsetFromContentType("text/plain;charset=UTF-8"), StandardCharsets.UTF_8.name()); assertEquals(parseCharsetFromContentType("text/*; charset=ISO-8859-1"), StandardCharsets.ISO_8859_1.name()); diff --git a/endpoints/citrus-mail/src/test/java/org/citrusframework/mail/model/MailMarshallerTest.java b/endpoints/citrus-mail/src/test/java/org/citrusframework/mail/model/MailMarshallerTest.java index b23bd48b20..da5bc9287c 100644 --- a/endpoints/citrus-mail/src/test/java/org/citrusframework/mail/model/MailMarshallerTest.java +++ b/endpoints/citrus-mail/src/test/java/org/citrusframework/mail/model/MailMarshallerTest.java @@ -51,7 +51,7 @@ public void testUnmarshalAccept(String requestSource, String responseSource) thr } @Test - public void testMarshal() throws Exception { + public void testMarshal() { MailRequest mailRequest = new MailRequest(); mailRequest.setFrom("foo@mail.com"); mailRequest.setTo("bar@mail.com,copy@mail.com"); diff --git a/endpoints/citrus-rmi/src/test/java/org/citrusframework/rmi/endpoint/RmiEndpointComponentTest.java b/endpoints/citrus-rmi/src/test/java/org/citrusframework/rmi/endpoint/RmiEndpointComponentTest.java index 549115c506..effb8c2607 100644 --- a/endpoints/citrus-rmi/src/test/java/org/citrusframework/rmi/endpoint/RmiEndpointComponentTest.java +++ b/endpoints/citrus-rmi/src/test/java/org/citrusframework/rmi/endpoint/RmiEndpointComponentTest.java @@ -35,7 +35,7 @@ public class RmiEndpointComponentTest { private final TestContext context = new TestContext(); @Test - public void testCreateClientEndpoint() throws Exception { + public void testCreateClientEndpoint() { RmiEndpointComponent component = new RmiEndpointComponent(); Endpoint endpoint = component.createEndpoint("rmi://localhost:2099", context); @@ -83,7 +83,7 @@ public void testCreateClientEndpoint() throws Exception { } @Test - public void testCreateClientEndpointWithParameters() throws Exception { + public void testCreateClientEndpointWithParameters() { RmiEndpointComponent component = new RmiEndpointComponent(); Endpoint endpoint = component.createEndpoint("rmi://localhost:2099?binding=rmiBinding&timeout=10000", context); diff --git a/endpoints/citrus-spring-integration/src/main/java/org/citrusframework/config/xml/ChannelEndpointAdapterParser.java b/endpoints/citrus-spring-integration/src/main/java/org/citrusframework/config/xml/ChannelEndpointAdapterParser.java index 0ead33f370..21c3072ccf 100644 --- a/endpoints/citrus-spring-integration/src/main/java/org/citrusframework/config/xml/ChannelEndpointAdapterParser.java +++ b/endpoints/citrus-spring-integration/src/main/java/org/citrusframework/config/xml/ChannelEndpointAdapterParser.java @@ -86,7 +86,7 @@ public void setFallbackEndpointAdapter(EndpointAdapter fallbackEndpointAdapter) } @Override - public ChannelEndpointAdapter getObject() throws Exception { + public ChannelEndpointAdapter getObject() { ChannelEndpointAdapter endpointAdapter = new ChannelEndpointAdapter(endpointConfiguration); endpointAdapter.setTestContextFactory(testContextFactory); diff --git a/endpoints/citrus-spring-integration/src/main/java/org/citrusframework/config/xml/PurgeMessageChannelActionParser.java b/endpoints/citrus-spring-integration/src/main/java/org/citrusframework/config/xml/PurgeMessageChannelActionParser.java index 66043748cb..34aac4d955 100644 --- a/endpoints/citrus-spring-integration/src/main/java/org/citrusframework/config/xml/PurgeMessageChannelActionParser.java +++ b/endpoints/citrus-spring-integration/src/main/java/org/citrusframework/config/xml/PurgeMessageChannelActionParser.java @@ -121,7 +121,7 @@ public void setChannelResolver(DestinationResolver channelResolv } @Override - public PurgeMessageChannelAction getObject() throws Exception { + public PurgeMessageChannelAction getObject() { return builder.build(); } diff --git a/endpoints/citrus-spring-integration/src/test/java/org/citrusframework/actions/PurgeMessageChannelActionTest.java b/endpoints/citrus-spring-integration/src/test/java/org/citrusframework/actions/PurgeMessageChannelActionTest.java index e5a911c4e6..c3a760a0e8 100644 --- a/endpoints/citrus-spring-integration/src/test/java/org/citrusframework/actions/PurgeMessageChannelActionTest.java +++ b/endpoints/citrus-spring-integration/src/test/java/org/citrusframework/actions/PurgeMessageChannelActionTest.java @@ -46,7 +46,7 @@ public class PurgeMessageChannelActionTest extends AbstractTestNGUnitTest { private final QueueChannel emptyChannel = Mockito.mock(QueueChannel.class); @Test - public void testPurgeWithChannelNames() throws Exception { + public void testPurgeWithChannelNames() { List> purgedMessages = new ArrayList<>(); purgedMessages.add(MessageBuilder.withPayload("Hello World!").build()); @@ -64,7 +64,7 @@ public void testPurgeWithChannelNames() throws Exception { @SuppressWarnings("unchecked") @Test - public void testPurgeWithChannelObjects() throws Exception { + public void testPurgeWithChannelObjects() { List> purgedMessages = new ArrayList<>(); purgedMessages.add(MessageBuilder.withPayload("Hello World!").build()); @@ -82,7 +82,7 @@ public void testPurgeWithChannelObjects() throws Exception { } @Test - public void testPurgeWithMessageSelector() throws Exception { + public void testPurgeWithMessageSelector() { MessageSelector messageSelector = message -> false; List> purgedMessages = new ArrayList<>(); diff --git a/endpoints/citrus-spring-integration/src/test/java/org/citrusframework/channel/ChannelEndpointComponentTest.java b/endpoints/citrus-spring-integration/src/test/java/org/citrusframework/channel/ChannelEndpointComponentTest.java index 1d4675c2db..0a10a3dcf0 100644 --- a/endpoints/citrus-spring-integration/src/test/java/org/citrusframework/channel/ChannelEndpointComponentTest.java +++ b/endpoints/citrus-spring-integration/src/test/java/org/citrusframework/channel/ChannelEndpointComponentTest.java @@ -50,7 +50,7 @@ public void setup() { } @Test - public void testCreateChannelEndpoint() throws Exception { + public void testCreateChannelEndpoint() { ChannelEndpointComponent component = new ChannelEndpointComponent(); reset(referenceResolver); @@ -66,7 +66,7 @@ public void testCreateChannelEndpoint() throws Exception { } @Test - public void testCreateSyncChannelEndpoint() throws Exception { + public void testCreateSyncChannelEndpoint() { ChannelEndpointComponent component = new ChannelEndpointComponent(); reset(referenceResolver); @@ -81,7 +81,7 @@ public void testCreateSyncChannelEndpoint() throws Exception { } @Test - public void testCreateChannelEndpointWithParameters() throws Exception { + public void testCreateChannelEndpointWithParameters() { ChannelEndpointComponent component = new ChannelEndpointComponent(); reset(referenceResolver); diff --git a/endpoints/citrus-spring-integration/src/test/java/org/citrusframework/config/xml/ChannelEndpointAdapterParserTest.java b/endpoints/citrus-spring-integration/src/test/java/org/citrusframework/config/xml/ChannelEndpointAdapterParserTest.java index 0f5f611c70..85f7ca2cda 100644 --- a/endpoints/citrus-spring-integration/src/test/java/org/citrusframework/config/xml/ChannelEndpointAdapterParserTest.java +++ b/endpoints/citrus-spring-integration/src/test/java/org/citrusframework/config/xml/ChannelEndpointAdapterParserTest.java @@ -29,7 +29,7 @@ public class ChannelEndpointAdapterParserTest extends AbstractBeanDefinitionParserTest { @Test - public void testParseBeanDefinition() throws Exception { + public void testParseBeanDefinition() { Map adapters = beanDefinitionContext.getBeansOfType(ChannelEndpointAdapter.class); Assert.assertEquals(adapters.size(), 2); diff --git a/endpoints/citrus-spring-integration/src/test/java/org/citrusframework/endpoint/ChannelEndpointFactoryTest.java b/endpoints/citrus-spring-integration/src/test/java/org/citrusframework/endpoint/ChannelEndpointFactoryTest.java index 0e48b30f8a..b995c8ad31 100644 --- a/endpoints/citrus-spring-integration/src/test/java/org/citrusframework/endpoint/ChannelEndpointFactoryTest.java +++ b/endpoints/citrus-spring-integration/src/test/java/org/citrusframework/endpoint/ChannelEndpointFactoryTest.java @@ -33,7 +33,7 @@ public class ChannelEndpointFactoryTest { private ReferenceResolver referenceResolver = Mockito.mock(ReferenceResolver.class); @Test - public void testResolveChannelEndpoint() throws Exception { + public void testResolveChannelEndpoint() { reset(referenceResolver); when(referenceResolver.resolveAll(EndpointComponent.class)).thenReturn(Collections.emptyMap()); TestContext context = new TestContext(); diff --git a/endpoints/citrus-spring-integration/src/test/java/org/citrusframework/springintegration/groovy/PurgeChannelsTest.java b/endpoints/citrus-spring-integration/src/test/java/org/citrusframework/springintegration/groovy/PurgeChannelsTest.java index c903795f0f..efdd8b181f 100644 --- a/endpoints/citrus-spring-integration/src/test/java/org/citrusframework/springintegration/groovy/PurgeChannelsTest.java +++ b/endpoints/citrus-spring-integration/src/test/java/org/citrusframework/springintegration/groovy/PurgeChannelsTest.java @@ -38,7 +38,7 @@ public class PurgeChannelsTest extends AbstractGroovyActionDslTest { private MessageSelector messageSelector; @Test - public void shouldLoadActions() throws Exception { + public void shouldLoadActions() { GroovyTestLoader testLoader = createTestLoader("classpath:org/citrusframework/springintegration/groovy/purge-channels.citrus.test.groovy"); context.getReferenceResolver().bind("channelResolver", channelResolver); diff --git a/endpoints/citrus-spring-integration/src/test/java/org/citrusframework/springintegration/xml/PurgeChannelsTest.java b/endpoints/citrus-spring-integration/src/test/java/org/citrusframework/springintegration/xml/PurgeChannelsTest.java index e5029ed905..112173d47d 100644 --- a/endpoints/citrus-spring-integration/src/test/java/org/citrusframework/springintegration/xml/PurgeChannelsTest.java +++ b/endpoints/citrus-spring-integration/src/test/java/org/citrusframework/springintegration/xml/PurgeChannelsTest.java @@ -39,7 +39,7 @@ public class PurgeChannelsTest extends AbstractXmlActionTest { private MessageSelector messageSelector; @Test - public void shouldLoadActions() throws Exception { + public void shouldLoadActions() { XmlTestLoader testLoader = createTestLoader("classpath:org/citrusframework/springintegration/xml/purge-channels.citrus.it.xml"); context.getReferenceResolver().bind("channelResolver", channelResolver); diff --git a/endpoints/citrus-spring-integration/src/test/java/org/citrusframework/springintegration/yaml/PurgeChannelsTest.java b/endpoints/citrus-spring-integration/src/test/java/org/citrusframework/springintegration/yaml/PurgeChannelsTest.java index 140502a121..f935e5a5ae 100644 --- a/endpoints/citrus-spring-integration/src/test/java/org/citrusframework/springintegration/yaml/PurgeChannelsTest.java +++ b/endpoints/citrus-spring-integration/src/test/java/org/citrusframework/springintegration/yaml/PurgeChannelsTest.java @@ -39,7 +39,7 @@ public class PurgeChannelsTest extends AbstractYamlActionTest { private MessageSelector messageSelector; @Test - public void shouldLoadActions() throws Exception { + public void shouldLoadActions() { YamlTestLoader testLoader = createTestLoader("classpath:org/citrusframework/springintegration/yaml/purge-channels.citrus.it.yaml"); context.getReferenceResolver().bind("channelResolver", channelResolver); diff --git a/endpoints/citrus-ssh/src/main/java/org/citrusframework/ssh/SshCommand.java b/endpoints/citrus-ssh/src/main/java/org/citrusframework/ssh/SshCommand.java index 1a8d7480fd..53e3a258a5 100644 --- a/endpoints/citrus-ssh/src/main/java/org/citrusframework/ssh/SshCommand.java +++ b/endpoints/citrus-ssh/src/main/java/org/citrusframework/ssh/SshCommand.java @@ -76,7 +76,7 @@ public SshCommand(String command, EndpointAdapter endpointAdapter, SshEndpointCo } @Override - public void start(ChannelSession session, Environment env) throws IOException { + public void start(ChannelSession session, Environment env) { user = env.getEnv().get(Environment.ENV_USER); new Thread(this, "CitrusSshCommand: " + command).start(); } diff --git a/endpoints/citrus-ssh/src/test/java/org/citrusframework/ssh/client/SshClientTest.java b/endpoints/citrus-ssh/src/test/java/org/citrusframework/ssh/client/SshClientTest.java index 90e3540164..24a99e5e17 100644 --- a/endpoints/citrus-ssh/src/test/java/org/citrusframework/ssh/client/SshClientTest.java +++ b/endpoints/citrus-ssh/src/test/java/org/citrusframework/ssh/client/SshClientTest.java @@ -95,19 +95,19 @@ public void noUser() { } @Test(expectedExceptions = CitrusRuntimeException.class,expectedExceptionsMessageRegExp = ".*knownHosts.*") - public void strictHostCheckingWithoutKnownHosts() throws JSchException { + public void strictHostCheckingWithoutKnownHosts() { strictHostChecking(true, null); send(); } @Test(expectedExceptions = CitrusRuntimeException.class,expectedExceptionsMessageRegExp = ".*blaHosts.*") - public void strictHostCheckingWithFaultyKnownHosts() throws JSchException { + public void strictHostCheckingWithFaultyKnownHosts() { strictHostChecking(true, "classpath:/org/citrusframework/ssh/blaHosts"); send(); } @Test(expectedExceptions = CitrusRuntimeException.class,expectedExceptionsMessageRegExp = ".*/does/not/exist.*") - public void strictHostCheckingWithFaultyKnownHosts2() throws JSchException { + public void strictHostCheckingWithFaultyKnownHosts2() { strictHostChecking(true, "/file/that/does/not/exist"); send(); } diff --git a/endpoints/citrus-ssh/src/test/java/org/citrusframework/ssh/client/SshEndpointComponentTest.java b/endpoints/citrus-ssh/src/test/java/org/citrusframework/ssh/client/SshEndpointComponentTest.java index 8c41a71e4b..28bce7020b 100644 --- a/endpoints/citrus-ssh/src/test/java/org/citrusframework/ssh/client/SshEndpointComponentTest.java +++ b/endpoints/citrus-ssh/src/test/java/org/citrusframework/ssh/client/SshEndpointComponentTest.java @@ -31,7 +31,7 @@ public class SshEndpointComponentTest { private TestContext context = new TestContext(); @Test - public void testCreateEndpoint() throws Exception { + public void testCreateEndpoint() { SshEndpointComponent component = new SshEndpointComponent(); Endpoint endpoint = component.createEndpoint("ssh://localhost:2200", context); @@ -44,7 +44,7 @@ public void testCreateEndpoint() throws Exception { } @Test - public void testCreateEndpointWithoutPort() throws Exception { + public void testCreateEndpointWithoutPort() { SshEndpointComponent component = new SshEndpointComponent(); Endpoint endpoint = component.createEndpoint("ssh:127.0.0.1", context); @@ -57,7 +57,7 @@ public void testCreateEndpointWithoutPort() throws Exception { } @Test - public void testCreateEndpointWithParameters() throws Exception { + public void testCreateEndpointWithParameters() { SshEndpointComponent component = new SshEndpointComponent(); Endpoint endpoint = component.createEndpoint("ssh://localhost:2200?timeout=10000&strictHostChecking=true&user=foo&password=12345678", context); diff --git a/endpoints/citrus-ssh/src/test/java/org/citrusframework/ssh/server/SinglePublicKeyAuthenticatorTest.java b/endpoints/citrus-ssh/src/test/java/org/citrusframework/ssh/server/SinglePublicKeyAuthenticatorTest.java index 939ccd12f1..38a08ea4eb 100644 --- a/endpoints/citrus-ssh/src/test/java/org/citrusframework/ssh/server/SinglePublicKeyAuthenticatorTest.java +++ b/endpoints/citrus-ssh/src/test/java/org/citrusframework/ssh/server/SinglePublicKeyAuthenticatorTest.java @@ -96,9 +96,8 @@ public void invalidFilePath() { * Gets public key instance from resource. * @param pResource * @return - * @throws IOException */ - private PublicKey getPublicKey(String pResource) throws IOException { + private PublicKey getPublicKey(String pResource) { return getPublicKeyFromStream(getClass().getResourceAsStream(pResource)); } diff --git a/endpoints/citrus-vertx/src/test/java/org/citrusframework/vertx/endpoint/VertxEndpointComponentTest.java b/endpoints/citrus-vertx/src/test/java/org/citrusframework/vertx/endpoint/VertxEndpointComponentTest.java index 6be606acdb..04bfb57e7a 100644 --- a/endpoints/citrus-vertx/src/test/java/org/citrusframework/vertx/endpoint/VertxEndpointComponentTest.java +++ b/endpoints/citrus-vertx/src/test/java/org/citrusframework/vertx/endpoint/VertxEndpointComponentTest.java @@ -49,7 +49,7 @@ public void setup() { } @Test - public void testCreateEndpoint() throws Exception { + public void testCreateEndpoint() { VertxEndpointComponent component = new VertxEndpointComponent(); reset(referenceResolver); @@ -75,7 +75,7 @@ public void testCreateEndpoint() throws Exception { } @Test - public void testCreateEndpointWithParameters() throws Exception { + public void testCreateEndpointWithParameters() { VertxEndpointComponent component = new VertxEndpointComponent(); reset(referenceResolver); @@ -93,7 +93,7 @@ public void testCreateEndpointWithParameters() throws Exception { } @Test - public void testCreateEndpointCustomInstanceFactory() throws Exception { + public void testCreateEndpointCustomInstanceFactory() { VertxEndpointComponent component = new VertxEndpointComponent(); reset(referenceResolver); @@ -109,7 +109,7 @@ public void testCreateEndpointCustomInstanceFactory() throws Exception { } @Test - public void testInvalidEndpointUri() throws Exception { + public void testInvalidEndpointUri() { VertxEndpointComponent component = new VertxEndpointComponent(); try { diff --git a/endpoints/citrus-websocket/src/main/java/org/citrusframework/websocket/interceptor/SessionEnricherHandshakeInterceptor.java b/endpoints/citrus-websocket/src/main/java/org/citrusframework/websocket/interceptor/SessionEnricherHandshakeInterceptor.java index b50462c3e5..1ad12fbae3 100644 --- a/endpoints/citrus-websocket/src/main/java/org/citrusframework/websocket/interceptor/SessionEnricherHandshakeInterceptor.java +++ b/endpoints/citrus-websocket/src/main/java/org/citrusframework/websocket/interceptor/SessionEnricherHandshakeInterceptor.java @@ -47,7 +47,7 @@ public SessionEnricherHandshakeInterceptor(String wsId, String wsPath) { } @Override - public boolean beforeHandshake(ServerHttpRequest request, ServerHttpResponse response, WebSocketHandler wsHandler, Map attributes) throws Exception { + public boolean beforeHandshake(ServerHttpRequest request, ServerHttpResponse response, WebSocketHandler wsHandler, Map attributes) { if (request instanceof ServletServerHttpRequest) { attributes.put(WebSocketMessageHeaders.WEB_SOCKET_ID, wsId); attributes.put(WebSocketMessageHeaders.WEB_SOCKET_PATH, wsPath); diff --git a/endpoints/citrus-websocket/src/test/java/org/citrusframework/websocket/endpoint/WebSocketEndpointComponentTest.java b/endpoints/citrus-websocket/src/test/java/org/citrusframework/websocket/endpoint/WebSocketEndpointComponentTest.java index 25c6cc7aa8..22e5aaf061 100644 --- a/endpoints/citrus-websocket/src/test/java/org/citrusframework/websocket/endpoint/WebSocketEndpointComponentTest.java +++ b/endpoints/citrus-websocket/src/test/java/org/citrusframework/websocket/endpoint/WebSocketEndpointComponentTest.java @@ -35,7 +35,7 @@ public class WebSocketEndpointComponentTest { private TestContext context = new TestContext(); @Test - public void testCreateClientEndpoint() throws Exception { + public void testCreateClientEndpoint() { WebSocketEndpointComponent component = new WebSocketEndpointComponent(); Endpoint endpoint = component.createEndpoint("ws://localhost:8088/test", context); @@ -54,7 +54,7 @@ public void testCreateClientEndpoint() throws Exception { } @Test - public void testCreateClientEndpointWithParameters() throws Exception { + public void testCreateClientEndpointWithParameters() { WebSocketEndpointComponent component = new WebSocketEndpointComponent(); Endpoint endpoint = component.createEndpoint("ws:localhost:8088?timeout=10000", context); @@ -66,7 +66,7 @@ public void testCreateClientEndpointWithParameters() throws Exception { } @Test - public void testCreateClientEndpointWithCustomParameters() throws Exception { + public void testCreateClientEndpointWithCustomParameters() { WebSocketEndpointComponent component = new WebSocketEndpointComponent(); Endpoint endpoint = component.createEndpoint("ws://localhost:8088/test?customParam=foo", context); diff --git a/endpoints/citrus-websocket/src/test/java/org/citrusframework/websocket/message/WebSocketMessageConverterTest.java b/endpoints/citrus-websocket/src/test/java/org/citrusframework/websocket/message/WebSocketMessageConverterTest.java index 4098240f0e..622ee62fb9 100644 --- a/endpoints/citrus-websocket/src/test/java/org/citrusframework/websocket/message/WebSocketMessageConverterTest.java +++ b/endpoints/citrus-websocket/src/test/java/org/citrusframework/websocket/message/WebSocketMessageConverterTest.java @@ -37,7 +37,7 @@ public class WebSocketMessageConverterTest extends AbstractTestNGUnitTest { private WebSocketMessageConverter messageConverter = new WebSocketMessageConverter(); @Test - public void testConvertTextMessageOutbound() throws Exception { + public void testConvertTextMessageOutbound() { WebSocketEndpointConfiguration endpointConfiguration = new WebSocketClientEndpointConfiguration(); WebSocketMessage message = new WebSocketMessage("Hello WebSocket!"); @@ -56,7 +56,7 @@ public void testConvertTextMessageOutbound() throws Exception { } @Test - public void testConvertBinaryMessageOutbound() throws Exception { + public void testConvertBinaryMessageOutbound() { WebSocketEndpointConfiguration endpointConfiguration = new WebSocketClientEndpointConfiguration(); WebSocketMessage message = new WebSocketMessage("Hello WebSocket!".getBytes(StandardCharsets.UTF_8)); @@ -68,7 +68,7 @@ public void testConvertBinaryMessageOutbound() throws Exception { } @Test - public void testConvertTextMessageInbound() throws Exception { + public void testConvertTextMessageInbound() { WebSocketEndpointConfiguration endpointConfiguration = new WebSocketClientEndpointConfiguration(); org.springframework.web.socket.WebSocketMessage externalMessage = new TextMessage("Hello WebSocket!"); @@ -87,7 +87,7 @@ public void testConvertTextMessageInbound() throws Exception { } @Test - public void testConvertBinaryMessageInbound() throws Exception { + public void testConvertBinaryMessageInbound() { WebSocketEndpointConfiguration endpointConfiguration = new WebSocketClientEndpointConfiguration(); org.springframework.web.socket.WebSocketMessage externalMessage = new BinaryMessage("Hello WebSocket!".getBytes(StandardCharsets.UTF_8)); diff --git a/endpoints/citrus-ws/src/main/java/org/citrusframework/ws/config/xml/AssertSoapFaultParser.java b/endpoints/citrus-ws/src/main/java/org/citrusframework/ws/config/xml/AssertSoapFaultParser.java index cba1b83eaa..409eba996b 100644 --- a/endpoints/citrus-ws/src/main/java/org/citrusframework/ws/config/xml/AssertSoapFaultParser.java +++ b/endpoints/citrus-ws/src/main/java/org/citrusframework/ws/config/xml/AssertSoapFaultParser.java @@ -196,7 +196,7 @@ public void setValidationContext(SoapFaultValidationContext.Builder validationCo } @Override - public AssertSoapFault getObject() throws Exception { + public AssertSoapFault getObject() { return builder.build(); } diff --git a/endpoints/citrus-ws/src/main/java/org/citrusframework/ws/config/xml/ReceiveSoapMessageActionParser.java b/endpoints/citrus-ws/src/main/java/org/citrusframework/ws/config/xml/ReceiveSoapMessageActionParser.java index d671f630be..58bd5cfb20 100644 --- a/endpoints/citrus-ws/src/main/java/org/citrusframework/ws/config/xml/ReceiveSoapMessageActionParser.java +++ b/endpoints/citrus-ws/src/main/java/org/citrusframework/ws/config/xml/ReceiveSoapMessageActionParser.java @@ -122,7 +122,7 @@ public void setAttachmentValidator(SoapAttachmentValidator attachmentValidator) } @Override - public ReceiveSoapMessageAction getObject() throws Exception { + public ReceiveSoapMessageAction getObject() { return builder.build(); } diff --git a/endpoints/citrus-ws/src/main/java/org/citrusframework/ws/config/xml/SendSoapFaultActionParser.java b/endpoints/citrus-ws/src/main/java/org/citrusframework/ws/config/xml/SendSoapFaultActionParser.java index ea70e3c151..d5fc8f8276 100644 --- a/endpoints/citrus-ws/src/main/java/org/citrusframework/ws/config/xml/SendSoapFaultActionParser.java +++ b/endpoints/citrus-ws/src/main/java/org/citrusframework/ws/config/xml/SendSoapFaultActionParser.java @@ -178,7 +178,7 @@ public void setFaultDetailResourcePaths(List faultDetailResourcePaths) { } @Override - public SendSoapFaultAction getObject() throws Exception { + public SendSoapFaultAction getObject() { return builder.build(); } diff --git a/endpoints/citrus-ws/src/main/java/org/citrusframework/ws/config/xml/SendSoapMessageActionParser.java b/endpoints/citrus-ws/src/main/java/org/citrusframework/ws/config/xml/SendSoapMessageActionParser.java index 8e795c6beb..638c5ea3f2 100644 --- a/endpoints/citrus-ws/src/main/java/org/citrusframework/ws/config/xml/SendSoapMessageActionParser.java +++ b/endpoints/citrus-ws/src/main/java/org/citrusframework/ws/config/xml/SendSoapMessageActionParser.java @@ -118,7 +118,7 @@ public void setMtomEnabled(boolean mtomEnabled) { } @Override - public SendSoapMessageAction getObject() throws Exception { + public SendSoapMessageAction getObject() { return builder.build(); } diff --git a/endpoints/citrus-ws/src/main/java/org/citrusframework/ws/interceptor/LoggingEndpointInterceptor.java b/endpoints/citrus-ws/src/main/java/org/citrusframework/ws/interceptor/LoggingEndpointInterceptor.java index 01a401f9ae..4e5436365d 100644 --- a/endpoints/citrus-ws/src/main/java/org/citrusframework/ws/interceptor/LoggingEndpointInterceptor.java +++ b/endpoints/citrus-ws/src/main/java/org/citrusframework/ws/interceptor/LoggingEndpointInterceptor.java @@ -60,6 +60,6 @@ public boolean handleFault(MessageContext messageContext, Object endpoint) throw /** * {@inheritDoc} */ - public void afterCompletion(MessageContext messageContext, Object endpoint, Exception ex) throws Exception { + public void afterCompletion(MessageContext messageContext, Object endpoint, Exception ex) { } } diff --git a/endpoints/citrus-ws/src/main/java/org/citrusframework/ws/message/SoapAttachment.java b/endpoints/citrus-ws/src/main/java/org/citrusframework/ws/message/SoapAttachment.java index 55f6ae9c32..b0d8c5d680 100644 --- a/endpoints/citrus-ws/src/main/java/org/citrusframework/ws/message/SoapAttachment.java +++ b/endpoints/citrus-ws/src/main/java/org/citrusframework/ws/message/SoapAttachment.java @@ -378,7 +378,7 @@ public String getName() { } @Override - public OutputStream getOutputStream() throws IOException { + public OutputStream getOutputStream() { throw new UnsupportedOperationException(); } } @@ -389,7 +389,7 @@ public OutputStream getOutputStream() throws IOException { private class FileResourceDataSource implements DataSource { @Override - public InputStream getInputStream() throws IOException { + public InputStream getInputStream() { return getFileResource().getInputStream(); } @@ -404,7 +404,7 @@ public String getName() { } @Override - public OutputStream getOutputStream() throws IOException { + public OutputStream getOutputStream() { throw new UnsupportedOperationException(); } diff --git a/endpoints/citrus-ws/src/main/java/org/citrusframework/ws/message/callback/SoapRequestMessageCallback.java b/endpoints/citrus-ws/src/main/java/org/citrusframework/ws/message/callback/SoapRequestMessageCallback.java index fbea8d7a9a..97af98103b 100644 --- a/endpoints/citrus-ws/src/main/java/org/citrusframework/ws/message/callback/SoapRequestMessageCallback.java +++ b/endpoints/citrus-ws/src/main/java/org/citrusframework/ws/message/callback/SoapRequestMessageCallback.java @@ -57,7 +57,7 @@ public SoapRequestMessageCallback(Message message, WebServiceEndpointConfigurati /** * Callback method called before request message is sent. */ - public void doWithMessage(WebServiceMessage requestMessage) throws IOException, TransformerException { + public void doWithMessage(WebServiceMessage requestMessage) throws TransformerException { endpointConfiguration.getMessageConverter().convertOutbound(requestMessage, message, endpointConfiguration, context); } } diff --git a/endpoints/citrus-ws/src/main/java/org/citrusframework/ws/message/callback/SoapResponseMessageCallback.java b/endpoints/citrus-ws/src/main/java/org/citrusframework/ws/message/callback/SoapResponseMessageCallback.java index 357f0febc0..38470c2c37 100644 --- a/endpoints/citrus-ws/src/main/java/org/citrusframework/ws/message/callback/SoapResponseMessageCallback.java +++ b/endpoints/citrus-ws/src/main/java/org/citrusframework/ws/message/callback/SoapResponseMessageCallback.java @@ -55,7 +55,7 @@ public SoapResponseMessageCallback(WebServiceEndpointConfiguration endpointConfi * Callback method called with actual web service response message. Method constructs a Spring Integration * message from this web service message for further processing. */ - public void doWithMessage(WebServiceMessage responseMessage) throws IOException, TransformerException { + public void doWithMessage(WebServiceMessage responseMessage) throws TransformerException { // convert and set response for later access via getResponse(): response = endpointConfiguration.getMessageConverter().convertInbound(responseMessage, endpointConfiguration, context); } diff --git a/endpoints/citrus-ws/src/test/java/org/citrusframework/ws/actions/AssertSoapFaultTest.java b/endpoints/citrus-ws/src/test/java/org/citrusframework/ws/actions/AssertSoapFaultTest.java index 4c48d947f4..7ca44fa5c7 100644 --- a/endpoints/citrus-ws/src/test/java/org/citrusframework/ws/actions/AssertSoapFaultTest.java +++ b/endpoints/citrus-ws/src/test/java/org/citrusframework/ws/actions/AssertSoapFaultTest.java @@ -49,7 +49,7 @@ public class AssertSoapFaultTest extends UnitTestSupport { private SoapFaultValidator soapFaultValidator; @Test - public void testAssertSoapFault() throws Exception { + public void testAssertSoapFault() { TestAction action = action(context -> { SoapMessage faultMessage; @@ -75,7 +75,7 @@ public void testAssertSoapFault() throws Exception { } @Test - public void testAssertSoapFaultWithValidatorName() throws Exception { + public void testAssertSoapFaultWithValidatorName() { TestAction action = action(context -> { SoapMessage faultMessage; @@ -102,7 +102,7 @@ public void testAssertSoapFaultWithValidatorName() throws Exception { } @Test - public void testAssertSoapFaultWithValidationMatchers() throws Exception { + public void testAssertSoapFaultWithValidationMatchers() { TestAction action = action(context -> { SoapMessage faultMessage; @@ -128,7 +128,7 @@ public void testAssertSoapFaultWithValidationMatchers() throws Exception { } @Test - public void testNoPrefix() throws Exception { + public void testNoPrefix() { TestAction action = action(context -> { SoapMessage faultMessage; @@ -151,7 +151,7 @@ public void testNoPrefix() throws Exception { } @Test(expectedExceptions = ValidationException.class, expectedExceptionsMessageRegExp = "SOAP fault validation failed! Fault code does not match - expected: '\\{http://citrusframework.org}TEC-1001' but was: '\\{http://citrusframework.org}TEC-2002'") - public void testWrongFaultCode() throws Exception { + public void testWrongFaultCode() { TestAction action = action(context -> { SoapMessage faultMessage; @@ -174,7 +174,7 @@ public void testWrongFaultCode() throws Exception { } @Test(expectedExceptions = ValidationException.class, expectedExceptionsMessageRegExp = "SOAP fault validation failed! Fault actor does not match - expected: 'SERVER' but was: 'CLIENT'") - public void testWrongFaultActor() throws Exception { + public void testWrongFaultActor() { TestAction action = action(context -> { SoapMessage faultMessage; @@ -200,7 +200,7 @@ public void testWrongFaultActor() throws Exception { } @Test - public void testWrongFaultString() throws Exception { + public void testWrongFaultString() { TestAction action = action(context -> { SoapMessage faultMessage; @@ -230,7 +230,7 @@ public void testWrongFaultString() throws Exception { } @Test - public void testAssertSoapFaultDetail() throws Exception { + public void testAssertSoapFaultDetail() { TestAction action = action(context -> { SoapMessage faultMessage; @@ -263,7 +263,7 @@ public void testAssertSoapFaultDetail() throws Exception { } @Test - public void testAssertSoapFaultDetailVariableSupport() throws Exception { + public void testAssertSoapFaultDetailVariableSupport() { TestAction action = action(context -> { SoapMessage faultMessage; @@ -298,7 +298,7 @@ public void testAssertSoapFaultDetailVariableSupport() throws Exception { } @Test - public void testAssertSoapFaultDetailResource() throws Exception { + public void testAssertSoapFaultDetailResource() { TestAction action = action(context -> { SoapMessage faultMessage; @@ -331,7 +331,7 @@ public void testAssertSoapFaultDetailResource() throws Exception { } @Test - public void testAssertSoapFaultDetailResourceVariableSupport() throws Exception { + public void testAssertSoapFaultDetailResourceVariableSupport() { TestAction action = action(context -> { SoapMessage faultMessage; @@ -366,7 +366,7 @@ public void testAssertSoapFaultDetailResourceVariableSupport() throws Exception } @Test - public void testAssertMultipleSoapFaultDetails() throws Exception { + public void testAssertMultipleSoapFaultDetails() { TestAction action = action(context -> { SoapMessage faultMessage; @@ -402,7 +402,7 @@ public void testAssertMultipleSoapFaultDetails() throws Exception { } @Test - public void testAssertMultipleSoapFaultDetailsWithResource() throws Exception { + public void testAssertMultipleSoapFaultDetailsWithResource() { TestAction action = action(context -> { SoapMessage faultMessage; diff --git a/endpoints/citrus-ws/src/test/java/org/citrusframework/ws/actions/ReceiveSoapMessageActionTest.java b/endpoints/citrus-ws/src/test/java/org/citrusframework/ws/actions/ReceiveSoapMessageActionTest.java index ec3be32434..6210917b63 100644 --- a/endpoints/citrus-ws/src/test/java/org/citrusframework/ws/actions/ReceiveSoapMessageActionTest.java +++ b/endpoints/citrus-ws/src/test/java/org/citrusframework/ws/actions/ReceiveSoapMessageActionTest.java @@ -62,7 +62,7 @@ protected TestContextFactory createTestContextFactory() { } @Test - public void testSoapMessageWithDefaultAttachmentDataTest() throws Exception { + public void testSoapMessageWithDefaultAttachmentDataTest() { DefaultMessageBuilder controlMessageBuilder = new DefaultMessageBuilder(); controlMessageBuilder.setPayloadBuilder(new DefaultPayloadBuilder("Hello World!")); @@ -100,7 +100,7 @@ public void testSoapMessageWithDefaultAttachmentDataTest() throws Exception { } @Test - public void testSoapMessageWithAttachmentDataTest() throws Exception { + public void testSoapMessageWithAttachmentDataTest() { DefaultMessageBuilder controlMessageBuilder = new DefaultMessageBuilder(); controlMessageBuilder.setPayloadBuilder(new DefaultPayloadBuilder("Hello World!")); @@ -142,7 +142,7 @@ public void testSoapMessageWithAttachmentDataTest() throws Exception { } @Test - public void testSoapMessageWithMultipleAttachmentDataTest() throws Exception { + public void testSoapMessageWithMultipleAttachmentDataTest() { DefaultMessageBuilder controlMessageBuilder = new DefaultMessageBuilder(); controlMessageBuilder.setPayloadBuilder(new DefaultPayloadBuilder("Hello World!")); @@ -199,7 +199,7 @@ public void testSoapMessageWithMultipleAttachmentDataTest() throws Exception { } @Test - public void testSoapMessageWithEmptyAttachmentContentTest() throws Exception { + public void testSoapMessageWithEmptyAttachmentContentTest() { DefaultMessageBuilder controlMessageBuilder = new DefaultMessageBuilder(); controlMessageBuilder.setPayloadBuilder(new DefaultPayloadBuilder("Hello World!")); @@ -240,7 +240,7 @@ public void testSoapMessageWithEmptyAttachmentContentTest() throws Exception { } @Test - public void testSoapMessageWithNoAttachmentExpected() throws Exception { + public void testSoapMessageWithNoAttachmentExpected() { DefaultMessageBuilder controlMessageBuilder = new DefaultMessageBuilder(); controlMessageBuilder.setPayloadBuilder(new DefaultPayloadBuilder("Hello World!")); @@ -266,7 +266,7 @@ public void testSoapMessageWithNoAttachmentExpected() throws Exception { } @Test - public void testSoapMessageWithAttachmentResourceTest() throws Exception { + public void testSoapMessageWithAttachmentResourceTest() { DefaultMessageBuilder controlMessageBuilder = new DefaultMessageBuilder(); controlMessageBuilder.setPayloadBuilder(new DefaultPayloadBuilder("Hello World!")); @@ -308,7 +308,7 @@ public void testSoapMessageWithAttachmentResourceTest() throws Exception { } @Test - public void testSoapMessageWithAttachmentResourceVariablesSupportTest() throws Exception { + public void testSoapMessageWithAttachmentResourceVariablesSupportTest() { DefaultMessageBuilder controlMessageBuilder = new DefaultMessageBuilder(); controlMessageBuilder.setPayloadBuilder(new DefaultPayloadBuilder("Hello World!")); @@ -352,7 +352,7 @@ public void testSoapMessageWithAttachmentResourceVariablesSupportTest() throws E } @Test - public void testSoapMessageWithAttachmentDataVariablesSupportTest() throws Exception { + public void testSoapMessageWithAttachmentDataVariablesSupportTest() { DefaultMessageBuilder controlMessageBuilder = new DefaultMessageBuilder(); controlMessageBuilder.setPayloadBuilder(new DefaultPayloadBuilder("Hello World!")); diff --git a/endpoints/citrus-ws/src/test/java/org/citrusframework/ws/actions/SendSoapMessageActionTest.java b/endpoints/citrus-ws/src/test/java/org/citrusframework/ws/actions/SendSoapMessageActionTest.java index 501b8bf0c0..d580bea140 100644 --- a/endpoints/citrus-ws/src/test/java/org/citrusframework/ws/actions/SendSoapMessageActionTest.java +++ b/endpoints/citrus-ws/src/test/java/org/citrusframework/ws/actions/SendSoapMessageActionTest.java @@ -48,7 +48,7 @@ public class SendSoapMessageActionTest extends AbstractTestNGUnitTest { @Test @SuppressWarnings("rawtypes") - public void testSoapMessageWithMtomAttachmentDataTest() throws Exception { + public void testSoapMessageWithMtomAttachmentDataTest() { DefaultMessageBuilder messageBuilder = new DefaultMessageBuilder(); messageBuilder.setPayloadBuilder(new DefaultPayloadBuilder("cid:mtomText@citrusframework.org")); @@ -87,7 +87,7 @@ public void testSoapMessageWithMtomAttachmentDataTest() throws Exception { @Test @SuppressWarnings("rawtypes") - public void testSoapMessageWithMtomInlineBase64BinaryAttachmentDataTest() throws Exception { + public void testSoapMessageWithMtomInlineBase64BinaryAttachmentDataTest() { DefaultMessageBuilder messageBuilder = new DefaultMessageBuilder(); messageBuilder.setPayloadBuilder(new DefaultPayloadBuilder("cid:mtomImage")); @@ -123,7 +123,7 @@ public void testSoapMessageWithMtomInlineBase64BinaryAttachmentDataTest() throws @Test @SuppressWarnings("rawtypes") - public void testSoapMessageWithMtomInlineHexBinaryAttachmentDataTest() throws Exception { + public void testSoapMessageWithMtomInlineHexBinaryAttachmentDataTest() { DefaultMessageBuilder messageBuilder = new DefaultMessageBuilder(); messageBuilder.setPayloadBuilder(new DefaultPayloadBuilder("cid:mtomImage")); @@ -159,7 +159,7 @@ public void testSoapMessageWithMtomInlineHexBinaryAttachmentDataTest() throws Ex @Test @SuppressWarnings("rawtypes") - public void testSoapMessageWithMtomMissingCidAttachmentDataTest() throws Exception { + public void testSoapMessageWithMtomMissingCidAttachmentDataTest() { DefaultMessageBuilder messageBuilder = new DefaultMessageBuilder(); messageBuilder.setPayloadBuilder(new DefaultPayloadBuilder("mtomText")); @@ -198,7 +198,7 @@ public void testSoapMessageWithMtomMissingCidAttachmentDataTest() throws Excepti @Test @SuppressWarnings("rawtypes") - public void testSoapMessageWithMtomInlineMissingCidAttachmentDataTest() throws Exception { + public void testSoapMessageWithMtomInlineMissingCidAttachmentDataTest() { DefaultMessageBuilder messageBuilder = new DefaultMessageBuilder(); messageBuilder.setPayloadBuilder(new DefaultPayloadBuilder("mtomImage")); @@ -239,7 +239,7 @@ public void testSoapMessageWithMtomInlineMissingCidAttachmentDataTest() throws E @Test @SuppressWarnings("rawtypes") - public void testSoapMessageWithMtomInlineInvalidEncodingTypeAttachmentDataTest() throws Exception { + public void testSoapMessageWithMtomInlineInvalidEncodingTypeAttachmentDataTest() { DefaultMessageBuilder messageBuilder = new DefaultMessageBuilder(); messageBuilder.setPayloadBuilder(new DefaultPayloadBuilder("cid:mtomImage")); @@ -269,7 +269,7 @@ public void testSoapMessageWithMtomInlineInvalidEncodingTypeAttachmentDataTest() @Test @SuppressWarnings("rawtypes") - public void testSoapMessageWithDefaultAttachmentDataTest() throws Exception { + public void testSoapMessageWithDefaultAttachmentDataTest() { DefaultMessageBuilder messageBuilder = new DefaultMessageBuilder(); messageBuilder.setPayloadBuilder(new DefaultPayloadBuilder("Hello World!")); @@ -301,7 +301,7 @@ public void testSoapMessageWithDefaultAttachmentDataTest() throws Exception { @Test @SuppressWarnings("rawtypes") - public void testSoapMessageWithAttachmentDataTest() throws Exception { + public void testSoapMessageWithAttachmentDataTest() { DefaultMessageBuilder messageBuilder = new DefaultMessageBuilder(); messageBuilder.setPayloadBuilder(new DefaultPayloadBuilder("Hello World!")); @@ -336,7 +336,7 @@ public void testSoapMessageWithAttachmentDataTest() throws Exception { @Test @SuppressWarnings("rawtypes") - public void testSoapMessageWithMultipleAttachmentDataTest() throws Exception { + public void testSoapMessageWithMultipleAttachmentDataTest() { DefaultMessageBuilder messageBuilder = new DefaultMessageBuilder(); messageBuilder.setPayloadBuilder(new DefaultPayloadBuilder("Hello World!")); @@ -387,7 +387,7 @@ public void testSoapMessageWithMultipleAttachmentDataTest() throws Exception { @Test @SuppressWarnings("rawtypes") - public void testSoapMessageWithEmptyAttachmentContentTest() throws Exception { + public void testSoapMessageWithEmptyAttachmentContentTest() { DefaultMessageBuilder messageBuilder = new DefaultMessageBuilder(); messageBuilder.setPayloadBuilder(new DefaultPayloadBuilder("Hello World!")); @@ -407,7 +407,7 @@ public void testSoapMessageWithEmptyAttachmentContentTest() throws Exception { @Test @SuppressWarnings("rawtypes") - public void testSoapMessageWithAttachmentResourceTest() throws Exception { + public void testSoapMessageWithAttachmentResourceTest() { DefaultMessageBuilder messageBuilder = new DefaultMessageBuilder(); messageBuilder.setPayloadBuilder(new DefaultPayloadBuilder("Hello World!")); @@ -439,7 +439,7 @@ public void testSoapMessageWithAttachmentResourceTest() throws Exception { @Test @SuppressWarnings("rawtypes") - public void testSoapMessageWithAttachmentDataVariableSupportTest() throws Exception { + public void testSoapMessageWithAttachmentDataVariableSupportTest() { DefaultMessageBuilder messageBuilder = new DefaultMessageBuilder(); messageBuilder.setPayloadBuilder(new DefaultPayloadBuilder("Hello World!")); @@ -473,7 +473,7 @@ public void testSoapMessageWithAttachmentDataVariableSupportTest() throws Except @Test @SuppressWarnings("rawtypes") - public void testSoapMessageWithAttachmentResourceVariablesSupportTest() throws Exception { + public void testSoapMessageWithAttachmentResourceVariablesSupportTest() { DefaultMessageBuilder messageBuilder = new DefaultMessageBuilder(); messageBuilder.setPayloadBuilder(new DefaultPayloadBuilder("Hello World!")); @@ -507,7 +507,7 @@ public void testSoapMessageWithAttachmentResourceVariablesSupportTest() throws E @Test @SuppressWarnings("rawtypes") - public void testSoapMessageWithHeaderContentTest() throws Exception { + public void testSoapMessageWithHeaderContentTest() { DefaultMessageBuilder messageBuilder = new DefaultMessageBuilder(); messageBuilder.setPayloadBuilder(new DefaultPayloadBuilder("Hello World!")); @@ -536,7 +536,7 @@ public void testSoapMessageWithHeaderContentTest() throws Exception { @Test @SuppressWarnings("rawtypes") - public void testSoapMessageWithMultipleHeaderContentTest() throws Exception { + public void testSoapMessageWithMultipleHeaderContentTest() { DefaultMessageBuilder messageBuilder = new DefaultMessageBuilder(); messageBuilder.setPayloadBuilder(new DefaultPayloadBuilder("Hello World!")); @@ -568,7 +568,7 @@ public void testSoapMessageWithMultipleHeaderContentTest() throws Exception { @Test @SuppressWarnings("rawtypes") - public void testSoapMessageWithHeaderResourceTest() throws Exception { + public void testSoapMessageWithHeaderResourceTest() { DefaultMessageBuilder messageBuilder = new DefaultMessageBuilder(); messageBuilder.setPayloadBuilder(new DefaultPayloadBuilder("Hello World!")); @@ -597,7 +597,7 @@ public void testSoapMessageWithHeaderResourceTest() throws Exception { @Test @SuppressWarnings("rawtypes") - public void testSoapMessageWithHeaderContentVariableSupportTest() throws Exception { + public void testSoapMessageWithHeaderContentVariableSupportTest() { DefaultMessageBuilder messageBuilder = new DefaultMessageBuilder(); messageBuilder.setPayloadBuilder(new DefaultPayloadBuilder("Hello World!")); @@ -628,7 +628,7 @@ public void testSoapMessageWithHeaderContentVariableSupportTest() throws Excepti @Test @SuppressWarnings("rawtypes") - public void testSoapMessageWithHeaderResourceVariableSupportTest() throws Exception { + public void testSoapMessageWithHeaderResourceVariableSupportTest() { DefaultMessageBuilder messageBuilder = new DefaultMessageBuilder(); messageBuilder.setPayloadBuilder(new DefaultPayloadBuilder("Hello World!")); diff --git a/endpoints/citrus-ws/src/test/java/org/citrusframework/ws/actions/dsl/AssertSoapFaultBuilderTest.java b/endpoints/citrus-ws/src/test/java/org/citrusframework/ws/actions/dsl/AssertSoapFaultBuilderTest.java index e5ecf32fb8..b838cc4775 100644 --- a/endpoints/citrus-ws/src/test/java/org/citrusframework/ws/actions/dsl/AssertSoapFaultBuilderTest.java +++ b/endpoints/citrus-ws/src/test/java/org/citrusframework/ws/actions/dsl/AssertSoapFaultBuilderTest.java @@ -349,7 +349,7 @@ public void testMultipleFaultDetails() { } @Test - public void testFaultDetailResource() throws IOException { + public void testFaultDetailResource() { reset(resource, referenceResolver, soapMessage, soapFaultValidator, soapBody, soapFault, soapFaultDetail, soapFaultDetailElement); when(resource.exists()).thenReturn(true); when(resource.getInputStream()).thenReturn(new ByteArrayInputStream("Something went wrong".getBytes())); @@ -450,7 +450,7 @@ public void testFaultDetailResourcePath() { } @Test - public void testMultipleFaultDetailsInlineAndResource() throws IOException { + public void testMultipleFaultDetailsInlineAndResource() { reset(resource, referenceResolver, soapMessage, soapFaultValidator, soapBody, soapFault, soapFaultDetail, soapFaultDetailElement); when(resource.exists()).thenReturn(true); when(resource.getInputStream()).thenReturn(new ByteArrayInputStream("Something went wrong".getBytes())); diff --git a/endpoints/citrus-ws/src/test/java/org/citrusframework/ws/actions/dsl/ReceiveSoapMessageTestActionBuilderTest.java b/endpoints/citrus-ws/src/test/java/org/citrusframework/ws/actions/dsl/ReceiveSoapMessageTestActionBuilderTest.java index a536b65b2f..a21c6174a7 100644 --- a/endpoints/citrus-ws/src/test/java/org/citrusframework/ws/actions/dsl/ReceiveSoapMessageTestActionBuilderTest.java +++ b/endpoints/citrus-ws/src/test/java/org/citrusframework/ws/actions/dsl/ReceiveSoapMessageTestActionBuilderTest.java @@ -198,7 +198,7 @@ public void testSoapAttachmentData() { } @Test - public void testSoapAttachmentResource() throws IOException { + public void testSoapAttachmentResource() { final Resource attachmentResource = Mockito.mock(Resource.class); reset(server, messageConsumer, configuration, resource, attachmentResource); diff --git a/endpoints/citrus-ws/src/test/java/org/citrusframework/ws/actions/dsl/SendSoapFaultTestActionBuilderTest.java b/endpoints/citrus-ws/src/test/java/org/citrusframework/ws/actions/dsl/SendSoapFaultTestActionBuilderTest.java index a4d131da55..36aa2f2f4a 100644 --- a/endpoints/citrus-ws/src/test/java/org/citrusframework/ws/actions/dsl/SendSoapFaultTestActionBuilderTest.java +++ b/endpoints/citrus-ws/src/test/java/org/citrusframework/ws/actions/dsl/SendSoapFaultTestActionBuilderTest.java @@ -140,7 +140,7 @@ public void testSendSoapFaultByEndpointName() { } @Test - public void testSendSoapFaultWithDetailResource() throws IOException { + public void testSendSoapFaultWithDetailResource() { reset(resource, soapServer, messageProducer); when(soapServer.createProducer()).thenReturn(messageProducer); when(soapServer.getActor()).thenReturn(null); diff --git a/endpoints/citrus-ws/src/test/java/org/citrusframework/ws/actions/dsl/SendSoapMessageTestActionBuilderTest.java b/endpoints/citrus-ws/src/test/java/org/citrusframework/ws/actions/dsl/SendSoapMessageTestActionBuilderTest.java index fddc564baf..5a190a91c0 100644 --- a/endpoints/citrus-ws/src/test/java/org/citrusframework/ws/actions/dsl/SendSoapMessageTestActionBuilderTest.java +++ b/endpoints/citrus-ws/src/test/java/org/citrusframework/ws/actions/dsl/SendSoapMessageTestActionBuilderTest.java @@ -333,7 +333,7 @@ public void testMultipleSoapAttachmentData() { } @Test - public void testSoapAttachmentResource() throws IOException { + public void testSoapAttachmentResource() { reset(resource, soapClient, messageProducer); when(soapClient.createProducer()).thenReturn(messageProducer); when(soapClient.getActor()).thenReturn(null); diff --git a/endpoints/citrus-ws/src/test/java/org/citrusframework/ws/client/WebServiceEndpointComponentTest.java b/endpoints/citrus-ws/src/test/java/org/citrusframework/ws/client/WebServiceEndpointComponentTest.java index 8bdbcedce2..5b7366ce6e 100644 --- a/endpoints/citrus-ws/src/test/java/org/citrusframework/ws/client/WebServiceEndpointComponentTest.java +++ b/endpoints/citrus-ws/src/test/java/org/citrusframework/ws/client/WebServiceEndpointComponentTest.java @@ -49,7 +49,7 @@ public void setup() { } @Test - public void testCreateClientEndpoint() throws Exception { + public void testCreateClientEndpoint() { WebServiceEndpointComponent component = new WebServiceEndpointComponent(); reset(referenceResolver); @@ -64,7 +64,7 @@ public void testCreateClientEndpoint() throws Exception { } @Test - public void testCreateClientEndpointWithParameters() throws Exception { + public void testCreateClientEndpointWithParameters() { WebServiceEndpointComponent component = new WebServiceEndpointComponent(); reset(referenceResolver); diff --git a/endpoints/citrus-ws/src/test/java/org/citrusframework/ws/groovy/SendSoapFaultTest.java b/endpoints/citrus-ws/src/test/java/org/citrusframework/ws/groovy/SendSoapFaultTest.java index 4f529b743d..04619d8ce1 100644 --- a/endpoints/citrus-ws/src/test/java/org/citrusframework/ws/groovy/SendSoapFaultTest.java +++ b/endpoints/citrus-ws/src/test/java/org/citrusframework/ws/groovy/SendSoapFaultTest.java @@ -71,7 +71,7 @@ public void prepareTest() { } @Test - public void shouldLoadSoapServerActions() throws IOException { + public void shouldLoadSoapServerActions() { GroovyTestLoader testLoader = createTestLoader("classpath:org/citrusframework/ws/groovy/send-soap-fault.citrus.test.groovy"); context.getReferenceResolver().bind("soapServer", soapServer); diff --git a/endpoints/citrus-ws/src/test/java/org/citrusframework/ws/integration/SoapAttachmentHandlingEndpoint.java b/endpoints/citrus-ws/src/test/java/org/citrusframework/ws/integration/SoapAttachmentHandlingEndpoint.java index 31481ea16e..7428bcf310 100644 --- a/endpoints/citrus-ws/src/test/java/org/citrusframework/ws/integration/SoapAttachmentHandlingEndpoint.java +++ b/endpoints/citrus-ws/src/test/java/org/citrusframework/ws/integration/SoapAttachmentHandlingEndpoint.java @@ -32,7 +32,7 @@ public class SoapAttachmentHandlingEndpoint implements MessageEndpoint { */ private static final Logger logger = LoggerFactory.getLogger(SoapAttachmentHandlingEndpoint.class); - public void invoke(MessageContext messageContext) throws Exception { + public void invoke(MessageContext messageContext) { Iterator it = ((SoapMessage)messageContext.getRequest()).getAttachments(); while(it.hasNext()) { Attachment attachment = it.next(); diff --git a/endpoints/citrus-ws/src/test/java/org/citrusframework/ws/integration/SoapFaultGeneratingEndpoint.java b/endpoints/citrus-ws/src/test/java/org/citrusframework/ws/integration/SoapFaultGeneratingEndpoint.java index f35a089a5c..cfadf6d895 100644 --- a/endpoints/citrus-ws/src/test/java/org/citrusframework/ws/integration/SoapFaultGeneratingEndpoint.java +++ b/endpoints/citrus-ws/src/test/java/org/citrusframework/ws/integration/SoapFaultGeneratingEndpoint.java @@ -22,7 +22,7 @@ public class SoapFaultGeneratingEndpoint implements MessageEndpoint { - public void invoke(MessageContext messageContext) throws Exception { + public void invoke(MessageContext messageContext) { throw new CitrusRuntimeException(); } } diff --git a/endpoints/citrus-ws/src/test/java/org/citrusframework/ws/message/SoapAttachmentTest.java b/endpoints/citrus-ws/src/test/java/org/citrusframework/ws/message/SoapAttachmentTest.java index 4a66d51b93..f4415e3f96 100644 --- a/endpoints/citrus-ws/src/test/java/org/citrusframework/ws/message/SoapAttachmentTest.java +++ b/endpoints/citrus-ws/src/test/java/org/citrusframework/ws/message/SoapAttachmentTest.java @@ -144,7 +144,7 @@ public String getName() { } @Override - public OutputStream getOutputStream() throws IOException { + public OutputStream getOutputStream() { throw new UnsupportedOperationException(); } } diff --git a/endpoints/citrus-ws/src/test/java/org/citrusframework/ws/message/SoapFormattingMessageProcessorTest.java b/endpoints/citrus-ws/src/test/java/org/citrusframework/ws/message/SoapFormattingMessageProcessorTest.java index 45f83cf25d..6d01af0bfe 100644 --- a/endpoints/citrus-ws/src/test/java/org/citrusframework/ws/message/SoapFormattingMessageProcessorTest.java +++ b/endpoints/citrus-ws/src/test/java/org/citrusframework/ws/message/SoapFormattingMessageProcessorTest.java @@ -31,7 +31,7 @@ public class SoapFormattingMessageProcessorTest extends AbstractTestNGUnitTest { private SoapFormattingMessageProcessor messageProcessor = new SoapFormattingMessageProcessor(); @Test - public void testProcessMessage() throws Exception { + public void testProcessMessage() { SoapMessage message = new SoapMessage("" + "" + "text-value" @@ -45,7 +45,7 @@ public void testProcessMessage() throws Exception { } @Test - public void testProcessSoapFault() throws Exception { + public void testProcessSoapFault() { SoapFault message = new SoapFault("" + "" + "text-value" @@ -63,7 +63,7 @@ public void testProcessSoapFault() throws Exception { } @Test - public void testProcessNonXmlMessage() throws Exception { + public void testProcessNonXmlMessage() { Message message = new DefaultMessage("This is plaintext"); message.setType(MessageType.PLAINTEXT.name()); diff --git a/endpoints/citrus-ws/src/test/java/org/citrusframework/ws/message/converter/WsAddressingMessageConverterTest.java b/endpoints/citrus-ws/src/test/java/org/citrusframework/ws/message/converter/WsAddressingMessageConverterTest.java index 7889f956c8..ef94743f01 100644 --- a/endpoints/citrus-ws/src/test/java/org/citrusframework/ws/message/converter/WsAddressingMessageConverterTest.java +++ b/endpoints/citrus-ws/src/test/java/org/citrusframework/ws/message/converter/WsAddressingMessageConverterTest.java @@ -69,7 +69,7 @@ public void setup() { } @Test - public void testOutboundWsAddressingHeaders() throws TransformerException, IOException { + public void testOutboundWsAddressingHeaders() throws TransformerException { Message testMessage = new DefaultMessage(requestPayload); StringResult soapBodyResult = new StringResult(); @@ -105,7 +105,7 @@ public void testOutboundWsAddressingHeaders() throws TransformerException, IOExc } @Test - public void testOverwriteWsAddressingHeaders() throws TransformerException, IOException { + public void testOverwriteWsAddressingHeaders() throws TransformerException { Message testMessage = new DefaultMessage(requestPayload) .setHeader(WsAddressingMessageHeaders.FROM, "customFrom") .setHeader(WsAddressingMessageHeaders.TO, "customTo") diff --git a/endpoints/citrus-ws/src/test/java/org/citrusframework/ws/validation/SimpleSoapAttachmentValidatorTest.java b/endpoints/citrus-ws/src/test/java/org/citrusframework/ws/validation/SimpleSoapAttachmentValidatorTest.java index 574be5f630..ee3a76bf3b 100644 --- a/endpoints/citrus-ws/src/test/java/org/citrusframework/ws/validation/SimpleSoapAttachmentValidatorTest.java +++ b/endpoints/citrus-ws/src/test/java/org/citrusframework/ws/validation/SimpleSoapAttachmentValidatorTest.java @@ -27,7 +27,7 @@ public class SimpleSoapAttachmentValidatorTest { @Test - public void testSimpleValidation() throws IOException { + public void testSimpleValidation() { SoapAttachment controlAttachment = new SoapAttachment(); controlAttachment.setContentId("soapAttachmentId"); controlAttachment.setContentType("text/plain"); @@ -41,7 +41,7 @@ public void testSimpleValidation() throws IOException { } @Test - public void testSimpleValidationNoControlContentId() throws IOException { + public void testSimpleValidationNoControlContentId() { SoapAttachment receivedAttachment = new SoapAttachment(); receivedAttachment.setContentId("soapAttachmentId"); receivedAttachment.setContentType("text/plain"); @@ -59,7 +59,7 @@ public void testSimpleValidationNoControlContentId() throws IOException { } @Test(expectedExceptions = ValidationException.class) - public void testSimpleValidationWrongContentId() throws IOException { + public void testSimpleValidationWrongContentId() { SoapAttachment receivedAttachment = new SoapAttachment(); receivedAttachment.setContentId("soapAttachmentId"); receivedAttachment.setContentType("text/plain"); @@ -78,7 +78,7 @@ public void testSimpleValidationWrongContentId() throws IOException { } @Test(expectedExceptions = ValidationException.class, expectedExceptionsMessageRegExp = "Values not equal for attachment content 'soapAttachmentId', expected 'ThisisnotOK!' but was 'Thisisatest!'") - public void testSimpleValidationWrongContent() throws IOException { + public void testSimpleValidationWrongContent() { SoapAttachment receivedAttachment = new SoapAttachment(); receivedAttachment.setContentId("soapAttachmentId"); receivedAttachment.setContentType("text/plain"); @@ -97,7 +97,7 @@ public void testSimpleValidationWrongContent() throws IOException { } @Test(expectedExceptions = ValidationException.class, expectedExceptionsMessageRegExp = "Values not equal for attachment contentType, expected 'text/xml' but was 'text/plain'") - public void testSimpleValidationWrongContentType() throws IOException { + public void testSimpleValidationWrongContentType() { SoapAttachment receivedAttachment = new SoapAttachment(); receivedAttachment.setContentId("soapAttachmentId"); receivedAttachment.setContentType("text/plain"); diff --git a/endpoints/citrus-ws/src/test/java/org/citrusframework/ws/xml/SendSoapFaultTest.java b/endpoints/citrus-ws/src/test/java/org/citrusframework/ws/xml/SendSoapFaultTest.java index 16610e3b21..c7c53f5dee 100644 --- a/endpoints/citrus-ws/src/test/java/org/citrusframework/ws/xml/SendSoapFaultTest.java +++ b/endpoints/citrus-ws/src/test/java/org/citrusframework/ws/xml/SendSoapFaultTest.java @@ -71,7 +71,7 @@ public void prepareTest() { } @Test - public void shouldLoadSoapServerActions() throws IOException { + public void shouldLoadSoapServerActions() { XmlTestLoader testLoader = createTestLoader("classpath:org/citrusframework/ws/xml/send-soap-fault.citrus.it.xml"); context.getReferenceResolver().bind("soapServer", soapServer); diff --git a/endpoints/citrus-ws/src/test/java/org/citrusframework/ws/yaml/SendSoapFaultTest.java b/endpoints/citrus-ws/src/test/java/org/citrusframework/ws/yaml/SendSoapFaultTest.java index df1e07f741..d44fb87f32 100644 --- a/endpoints/citrus-ws/src/test/java/org/citrusframework/ws/yaml/SendSoapFaultTest.java +++ b/endpoints/citrus-ws/src/test/java/org/citrusframework/ws/yaml/SendSoapFaultTest.java @@ -71,7 +71,7 @@ public void prepareTest() { } @Test - public void shouldLoadSoapServerActions() throws IOException { + public void shouldLoadSoapServerActions() { YamlTestLoader testLoader = createTestLoader("classpath:org/citrusframework/ws/yaml/send-soap-fault.citrus.it.yaml"); context.getReferenceResolver().bind("soapServer", soapServer); diff --git a/endpoints/citrus-zookeeper/src/main/java/org/citrusframework/zookeeper/config/xml/ZooExecuteActionParser.java b/endpoints/citrus-zookeeper/src/main/java/org/citrusframework/zookeeper/config/xml/ZooExecuteActionParser.java index 8a6e7ad9e5..0c58e07cd3 100644 --- a/endpoints/citrus-zookeeper/src/main/java/org/citrusframework/zookeeper/config/xml/ZooExecuteActionParser.java +++ b/endpoints/citrus-zookeeper/src/main/java/org/citrusframework/zookeeper/config/xml/ZooExecuteActionParser.java @@ -208,7 +208,7 @@ public void setJsonPathMessageValidationContext(JsonPathMessageValidationContext } @Override - public ZooExecuteAction getObject() throws Exception { + public ZooExecuteAction getObject() { if (zookeeperClient != null) { builder.client(zookeeperClient); } diff --git a/endpoints/citrus-zookeeper/src/test/java/org/citrusframework/zookeeper/actions/ZooExecuteActionTest.java b/endpoints/citrus-zookeeper/src/test/java/org/citrusframework/zookeeper/actions/ZooExecuteActionTest.java index df8123098e..a61fe18e84 100644 --- a/endpoints/citrus-zookeeper/src/test/java/org/citrusframework/zookeeper/actions/ZooExecuteActionTest.java +++ b/endpoints/citrus-zookeeper/src/test/java/org/citrusframework/zookeeper/actions/ZooExecuteActionTest.java @@ -31,7 +31,7 @@ public class ZooExecuteActionTest extends AbstractTestNGUnitTest { private final ZooKeeper zookeeper = Mockito.mock(ZooKeeper.class); @Test - public void testInfo() throws Exception { + public void testInfo() { reset(zookeeper); when(zookeeper.getState()).thenReturn(ZooKeeper.States.CONNECTED); diff --git a/endpoints/citrus-zookeeper/src/test/java/org/citrusframework/zookeeper/config/xml/ZooClientParserTest.java b/endpoints/citrus-zookeeper/src/test/java/org/citrusframework/zookeeper/config/xml/ZooClientParserTest.java index f171c65bc6..3296718de4 100644 --- a/endpoints/citrus-zookeeper/src/test/java/org/citrusframework/zookeeper/config/xml/ZooClientParserTest.java +++ b/endpoints/citrus-zookeeper/src/test/java/org/citrusframework/zookeeper/config/xml/ZooClientParserTest.java @@ -31,7 +31,7 @@ public class ZooClientParserTest extends AbstractBeanDefinitionParserTest { @Test - public void testZooKeeperClientParser() throws IOException { + public void testZooKeeperClientParser() { Map clients = beanDefinitionContext.getBeansOfType(ZooClient.class); Assert.assertEquals(clients.size(), 2); diff --git a/runtime/citrus-cucumber/src/main/java/org/citrusframework/cucumber/config/xml/StepTemplateParser.java b/runtime/citrus-cucumber/src/main/java/org/citrusframework/cucumber/config/xml/StepTemplateParser.java index 9aa3a9f663..89e85df7f2 100644 --- a/runtime/citrus-cucumber/src/main/java/org/citrusframework/cucumber/config/xml/StepTemplateParser.java +++ b/runtime/citrus-cucumber/src/main/java/org/citrusframework/cucumber/config/xml/StepTemplateParser.java @@ -106,9 +106,8 @@ public void setActions(List actions) { /** * Adds test actions to container when building object. * @return - * @throws Exception */ - public StepTemplate getObject() throws Exception { + public StepTemplate getObject() { return builder.build(); } diff --git a/runtime/citrus-cucumber/src/test/java/org/citrusframework/cucumber/UnitTestSupport.java b/runtime/citrus-cucumber/src/test/java/org/citrusframework/cucumber/UnitTestSupport.java index 410f6e39b1..1b61d01966 100644 --- a/runtime/citrus-cucumber/src/test/java/org/citrusframework/cucumber/UnitTestSupport.java +++ b/runtime/citrus-cucumber/src/test/java/org/citrusframework/cucumber/UnitTestSupport.java @@ -53,7 +53,7 @@ public class UnitTestSupport extends AbstractTestNGUnitTest { protected Citrus citrus; @BeforeClass(alwaysRun = true) - public void beforeSuite() throws Exception { + public void beforeSuite() { citrus = Citrus.newInstance(new CitrusSpringContextProvider(applicationContext)); citrus.beforeSuite(Reporter.getCurrentTestResult().getTestContext().getSuite().getName(), Arrays.stream(Reporter.getCurrentTestResult().getTestContext().getAllTestMethods()) diff --git a/runtime/citrus-groovy/src/main/java/org/citrusframework/config/xml/GroovyActionParser.java b/runtime/citrus-groovy/src/main/java/org/citrusframework/config/xml/GroovyActionParser.java index 495554fead..abcd47d9b0 100644 --- a/runtime/citrus-groovy/src/main/java/org/citrusframework/config/xml/GroovyActionParser.java +++ b/runtime/citrus-groovy/src/main/java/org/citrusframework/config/xml/GroovyActionParser.java @@ -107,7 +107,7 @@ public void setUseScriptTemplate(boolean useScriptTemplate) { } @Override - public GroovyAction getObject() throws Exception { + public GroovyAction getObject() { return builder.build(); } diff --git a/runtime/citrus-groovy/src/test/java/org/citrusframework/actions/dsl/GroovyTestActionBuilderTest.java b/runtime/citrus-groovy/src/test/java/org/citrusframework/actions/dsl/GroovyTestActionBuilderTest.java index bdf0a389e2..f09517a414 100644 --- a/runtime/citrus-groovy/src/test/java/org/citrusframework/actions/dsl/GroovyTestActionBuilderTest.java +++ b/runtime/citrus-groovy/src/test/java/org/citrusframework/actions/dsl/GroovyTestActionBuilderTest.java @@ -37,7 +37,7 @@ public class GroovyTestActionBuilderTest extends UnitTestSupport implements Test private final Resource scriptResource = Mockito.mock(Resource.class); @Test - public void testGroovyBuilderWithResource() throws IOException { + public void testGroovyBuilderWithResource() { reset(scriptResource); when(scriptResource.exists()).thenReturn(true); when(scriptResource.getInputStream()).thenReturn(new ByteArrayInputStream("println 'Wow groovy!'".getBytes())); @@ -72,7 +72,7 @@ public void testGroovyBuilderWithScript() { } @Test - public void testGroovyBuilderWithTemplate() throws IOException { + public void testGroovyBuilderWithTemplate() { DefaultTestCaseRunner builder = new DefaultTestCaseRunner(context); builder.$(script().groovy().script("context.setVariable('message', 'Groovy!')") .template(Resources.fromClasspath("org/citrusframework/script/script-template.groovy"))); diff --git a/runtime/citrus-groovy/src/test/java/org/citrusframework/config/xml/ReceiveMessageActionParserTest.java b/runtime/citrus-groovy/src/test/java/org/citrusframework/config/xml/ReceiveMessageActionParserTest.java index 4026409cda..19a0300ce7 100644 --- a/runtime/citrus-groovy/src/test/java/org/citrusframework/config/xml/ReceiveMessageActionParserTest.java +++ b/runtime/citrus-groovy/src/test/java/org/citrusframework/config/xml/ReceiveMessageActionParserTest.java @@ -30,7 +30,7 @@ public class ReceiveMessageActionParserTest extends AbstractActionParserTest { @Test - public void testReceiveMessageActionParser() throws IOException { + public void testReceiveMessageActionParser() { assertActionCount(2); assertActionClassAndName(ReceiveMessageAction.class, "receive"); diff --git a/runtime/citrus-groovy/src/test/java/org/citrusframework/config/xml/SendMessageActionParserTest.java b/runtime/citrus-groovy/src/test/java/org/citrusframework/config/xml/SendMessageActionParserTest.java index 8a91c37e39..28658a6f5d 100644 --- a/runtime/citrus-groovy/src/test/java/org/citrusframework/config/xml/SendMessageActionParserTest.java +++ b/runtime/citrus-groovy/src/test/java/org/citrusframework/config/xml/SendMessageActionParserTest.java @@ -28,7 +28,7 @@ public class SendMessageActionParserTest extends AbstractActionParserTest { @Test - public void testSendMessageActionParser() throws IOException { + public void testSendMessageActionParser() { assertActionCount(3); assertActionClassAndName(SendMessageAction.class, "send"); diff --git a/runtime/citrus-junit-jupiter/src/main/java/org/citrusframework/junit/jupiter/CitrusExtension.java b/runtime/citrus-junit-jupiter/src/main/java/org/citrusframework/junit/jupiter/CitrusExtension.java index 49a228b7a2..23965f4de0 100644 --- a/runtime/citrus-junit-jupiter/src/main/java/org/citrusframework/junit/jupiter/CitrusExtension.java +++ b/runtime/citrus-junit-jupiter/src/main/java/org/citrusframework/junit/jupiter/CitrusExtension.java @@ -188,7 +188,7 @@ public void interceptTestMethod(Invocation invocation, ReflectiveInvocatio } @Override - public void interceptTestTemplateMethod(Invocation invocation, ReflectiveInvocationContext invocationContext, ExtensionContext extensionContext) throws Throwable { + public void interceptTestTemplateMethod(Invocation invocation, ReflectiveInvocationContext invocationContext, ExtensionContext extensionContext) { Object testInstance = extensionContext.getRequiredTestInstance(); Citrus citrus = getCitrus(extensionContext); TestContext context = getTestContext(extensionContext); @@ -226,7 +226,7 @@ public void interceptTestTemplateMethod(Invocation invocation, ReflectiveI } @Override - public void afterEach(ExtensionContext extensionContext) throws Exception { + public void afterEach(ExtensionContext extensionContext) { extensionContext.getRoot().getStore(CitrusExtension.NAMESPACE) .remove(getBaseKey(extensionContext) + TestCaseRunner.class.getSimpleName()); } diff --git a/runtime/citrus-junit-jupiter/src/main/java/org/citrusframework/junit/jupiter/spring/CitrusSpringExtension.java b/runtime/citrus-junit-jupiter/src/main/java/org/citrusframework/junit/jupiter/spring/CitrusSpringExtension.java index 8ea3fa80f4..26def891c8 100644 --- a/runtime/citrus-junit-jupiter/src/main/java/org/citrusframework/junit/jupiter/spring/CitrusSpringExtension.java +++ b/runtime/citrus-junit-jupiter/src/main/java/org/citrusframework/junit/jupiter/spring/CitrusSpringExtension.java @@ -82,7 +82,7 @@ public void beforeTestExecution(ExtensionContext extensionContext) { } @Override - public void interceptTestMethod(Invocation invocation, ReflectiveInvocationContext invocationContext, ExtensionContext extensionContext) throws Throwable { + public void interceptTestMethod(Invocation invocation, ReflectiveInvocationContext invocationContext, ExtensionContext extensionContext) { delegate.interceptTestMethod(invocation, invocationContext, extensionContext); } diff --git a/runtime/citrus-junit-jupiter/src/test/java/org/citrusframework/junit/jupiter/integration/FailJUnitJupiterIT.java b/runtime/citrus-junit-jupiter/src/test/java/org/citrusframework/junit/jupiter/integration/FailJUnitJupiterIT.java index eebcb6a003..944a7a4555 100644 --- a/runtime/citrus-junit-jupiter/src/test/java/org/citrusframework/junit/jupiter/integration/FailJUnitJupiterIT.java +++ b/runtime/citrus-junit-jupiter/src/test/java/org/citrusframework/junit/jupiter/integration/FailJUnitJupiterIT.java @@ -52,7 +52,7 @@ public static class ShouldFailExtension implements Extension, TestExecutionExcep static String message = ""; @Override - public void handleTestExecutionException(ExtensionContext context, Throwable throwable) throws Throwable { + public void handleTestExecutionException(ExtensionContext context, Throwable throwable) { Assertions.assertEquals(message, throwable.getMessage()); } } diff --git a/runtime/citrus-junit/src/main/java/org/citrusframework/junit/spring/TestSuiteExecutionListener.java b/runtime/citrus-junit/src/main/java/org/citrusframework/junit/spring/TestSuiteExecutionListener.java index 5b4f2f7bba..d65bcc882d 100644 --- a/runtime/citrus-junit/src/main/java/org/citrusframework/junit/spring/TestSuiteExecutionListener.java +++ b/runtime/citrus-junit/src/main/java/org/citrusframework/junit/spring/TestSuiteExecutionListener.java @@ -35,7 +35,7 @@ public class TestSuiteExecutionListener extends AbstractTestExecutionListener { private static final String SUITE_NAME = "citrus-junit4-suite"; @Override - public void prepareTestInstance(TestContext testContext) throws Exception { + public void prepareTestInstance(TestContext testContext) { if (TestSuiteState.shouldExecuteBeforeSuite()) { ApplicationContext ctx = testContext.getApplicationContext(); diff --git a/runtime/citrus-junit/src/test/java/org/citrusframework/junit/JUnit4TestEngineTest.java b/runtime/citrus-junit/src/test/java/org/citrusframework/junit/JUnit4TestEngineTest.java index 48254ff2fe..1a90049777 100644 --- a/runtime/citrus-junit/src/test/java/org/citrusframework/junit/JUnit4TestEngineTest.java +++ b/runtime/citrus-junit/src/test/java/org/citrusframework/junit/JUnit4TestEngineTest.java @@ -71,7 +71,7 @@ private void runTestEngine(TestRunConfiguration configuration, long failure, lon JUnit4TestEngine engine = new JUnit4TestEngine(configuration); engine.addRunListener(new RunListener() { @Override - public void testRunFinished(Result result) throws Exception { + public void testRunFinished(Result result) { Assert.assertEquals(result.getFailureCount(), failure); Assert.assertEquals(result.getRunCount(), passed); } diff --git a/runtime/citrus-testng/src/test/java/org/citrusframework/actions/dsl/ReceiveMessageTestActionBuilderTest.java b/runtime/citrus-testng/src/test/java/org/citrusframework/actions/dsl/ReceiveMessageTestActionBuilderTest.java index e2541f2206..fe73d720bd 100644 --- a/runtime/citrus-testng/src/test/java/org/citrusframework/actions/dsl/ReceiveMessageTestActionBuilderTest.java +++ b/runtime/citrus-testng/src/test/java/org/citrusframework/actions/dsl/ReceiveMessageTestActionBuilderTest.java @@ -149,7 +149,7 @@ public void testReceiveBuilderWithPayloadString() { } @Test - public void testReceiveBuilderWithPayloadResource() throws IOException { + public void testReceiveBuilderWithPayloadResource() { reset(resource, messageEndpoint, messageConsumer, configuration); when(messageEndpoint.createConsumer()).thenReturn(messageConsumer); when(messageEndpoint.getEndpointConfiguration()).thenReturn(configuration); @@ -408,7 +408,7 @@ public void testReceiveBuilderWithMultipleHeaderData() { } @Test - public void testReceiveBuilderWithHeaderResource() throws IOException { + public void testReceiveBuilderWithHeaderResource() { reset(resource, messageEndpoint, messageConsumer, configuration); when(messageEndpoint.createConsumer()).thenReturn(messageConsumer); when(messageEndpoint.getEndpointConfiguration()).thenReturn(configuration); @@ -466,7 +466,7 @@ public void testReceiveBuilderWithHeaderResource() throws IOException { } @Test - public void testReceiveBuilderWithMultipleHeaderResource() throws IOException { + public void testReceiveBuilderWithMultipleHeaderResource() { reset(resource, messageEndpoint, messageConsumer, configuration); when(messageEndpoint.createConsumer()).thenReturn(messageConsumer); when(messageEndpoint.getEndpointConfiguration()).thenReturn(configuration); diff --git a/runtime/citrus-testng/src/test/java/org/citrusframework/actions/dsl/SendMessageTestActionBuilderTest.java b/runtime/citrus-testng/src/test/java/org/citrusframework/actions/dsl/SendMessageTestActionBuilderTest.java index 134d66328c..9d2acb9dc0 100644 --- a/runtime/citrus-testng/src/test/java/org/citrusframework/actions/dsl/SendMessageTestActionBuilderTest.java +++ b/runtime/citrus-testng/src/test/java/org/citrusframework/actions/dsl/SendMessageTestActionBuilderTest.java @@ -210,7 +210,7 @@ public void testSendBuilderWithPayloadData() { } @Test - public void testSendBuilderWithPayloadResource() throws IOException { + public void testSendBuilderWithPayloadResource() { reset(resource, messageEndpoint, messageProducer); when(messageEndpoint.createProducer()).thenReturn(messageProducer); when(messageEndpoint.getActor()).thenReturn(null); @@ -430,7 +430,7 @@ public void testSendBuilderWithMultipleHeaderData() { } @Test - public void testSendBuilderWithHeaderDataResource() throws IOException { + public void testSendBuilderWithHeaderDataResource() { reset(resource, messageEndpoint, messageProducer); when(messageEndpoint.createProducer()).thenReturn(messageProducer); when(messageEndpoint.getActor()).thenReturn(null); diff --git a/runtime/citrus-testng/src/test/java/org/citrusframework/actions/dsl/TransformTestActionBuilderTest.java b/runtime/citrus-testng/src/test/java/org/citrusframework/actions/dsl/TransformTestActionBuilderTest.java index 5cb3b23b49..c169ea60a7 100644 --- a/runtime/citrus-testng/src/test/java/org/citrusframework/actions/dsl/TransformTestActionBuilderTest.java +++ b/runtime/citrus-testng/src/test/java/org/citrusframework/actions/dsl/TransformTestActionBuilderTest.java @@ -66,7 +66,7 @@ public void testTransformBuilderWithData() { } @Test - public void testTransformBuilderWithResource() throws IOException { + public void testTransformBuilderWithResource() { DefaultTestCaseRunner builder = new DefaultTestCaseRunner(context); builder.$(transform().source(Resources.fromClasspath("org/citrusframework/actions/dsl/transform-source.xml")) .xslt(Resources.fromClasspath("org/citrusframework/actions/dsl/transform.xslt")) diff --git a/runtime/citrus-testng/src/test/java/org/citrusframework/integration/container/WaitJavaIT.java b/runtime/citrus-testng/src/test/java/org/citrusframework/integration/container/WaitJavaIT.java index 0fcb01ea97..feb9567ab8 100644 --- a/runtime/citrus-testng/src/test/java/org/citrusframework/integration/container/WaitJavaIT.java +++ b/runtime/citrus-testng/src/test/java/org/citrusframework/integration/container/WaitJavaIT.java @@ -87,7 +87,7 @@ public void waitMessage() { } @CitrusTest - public void waitFile() throws IOException { + public void waitFile() { run(waitFor() .file() .resource(Resources.fromClasspath("citrus.properties").getFile())); diff --git a/tools/agent/src/main/java/org/citrusframework/agent/ThrowingHandler.java b/tools/agent/src/main/java/org/citrusframework/agent/ThrowingHandler.java index 1b284424b9..5ae9fa3729 100644 --- a/tools/agent/src/main/java/org/citrusframework/agent/ThrowingHandler.java +++ b/tools/agent/src/main/java/org/citrusframework/agent/ThrowingHandler.java @@ -17,5 +17,5 @@ package org.citrusframework.agent; public interface ThrowingHandler { - void handle(T t) throws Exception; + void handle(T t); } diff --git a/tools/cucumber-steps/citrus-cucumber-camel/src/main/java/org/citrusframework/cucumber/steps/camel/CamelSteps.java b/tools/cucumber-steps/citrus-cucumber-camel/src/main/java/org/citrusframework/cucumber/steps/camel/CamelSteps.java index 012b9429f2..4078d2f809 100644 --- a/tools/cucumber-steps/citrus-cucumber-camel/src/main/java/org/citrusframework/cucumber/steps/camel/CamelSteps.java +++ b/tools/cucumber-steps/citrus-cucumber-camel/src/main/java/org/citrusframework/cucumber/steps/camel/CamelSteps.java @@ -182,7 +182,7 @@ public void loadComponent(String filePath) throws IOException { } @Given("^Camel route ([^\\s]+)\\.xml") - public void camelRouteXml(String id, String routeSpec) throws Exception { + public void camelRouteXml(String id, String routeSpec) { runner.run(camel().camelContext(camelContext()) .route() .create(routeSpec) @@ -190,7 +190,7 @@ public void camelRouteXml(String id, String routeSpec) throws Exception { } @Given("^Camel route ([^\\s]+)\\.groovy") - public void camelRouteGroovy(String id, String route) throws Exception { + public void camelRouteGroovy(String id, String route) { runner.run(camel().camelContext(camelContext()) .route() .create(route) diff --git a/tools/cucumber-steps/citrus-cucumber-jms/src/test/java/org/citrusframework/cucumber/steps/jms/connection/ConnectionFactoryCreatorTest.java b/tools/cucumber-steps/citrus-cucumber-jms/src/test/java/org/citrusframework/cucumber/steps/jms/connection/ConnectionFactoryCreatorTest.java index 5bceaebdae..f88c092b9d 100644 --- a/tools/cucumber-steps/citrus-cucumber-jms/src/test/java/org/citrusframework/cucumber/steps/jms/connection/ConnectionFactoryCreatorTest.java +++ b/tools/cucumber-steps/citrus-cucumber-jms/src/test/java/org/citrusframework/cucumber/steps/jms/connection/ConnectionFactoryCreatorTest.java @@ -59,12 +59,12 @@ public void shouldHandleMissingTypeInformation() throws ClassNotFoundException { */ private static class DummyConnectionFactory implements ConnectionFactory { @Override - public Connection createConnection() throws JMSException { + public Connection createConnection() { return null; } @Override - public Connection createConnection(String s, String s1) throws JMSException { + public Connection createConnection(String s, String s1) { return null; } diff --git a/tools/docs-generator/src/main/java/org/citrusframework/docs/AbstractTestDocsGenerator.java b/tools/docs-generator/src/main/java/org/citrusframework/docs/AbstractTestDocsGenerator.java index 88b858dab5..eebb7fe91d 100644 --- a/tools/docs-generator/src/main/java/org/citrusframework/docs/AbstractTestDocsGenerator.java +++ b/tools/docs-generator/src/main/java/org/citrusframework/docs/AbstractTestDocsGenerator.java @@ -161,9 +161,8 @@ public abstract void doHeader(OutputStream buffered) /** * Gets all test files from test directory. * @return - * @throws IOException */ - List getTestFiles() throws IOException { + List getTestFiles() { if (testFiles == null) { testFiles = FileUtils.findFiles(Paths.get(srcDirectory, "resources").toString(), CitrusSettings.getXmlTestFileNamePattern()); } diff --git a/tools/docs-generator/src/main/java/org/citrusframework/docs/ExcelTestDocsGenerator.java b/tools/docs-generator/src/main/java/org/citrusframework/docs/ExcelTestDocsGenerator.java index 5bb6a6a9f4..93569f71a3 100644 --- a/tools/docs-generator/src/main/java/org/citrusframework/docs/ExcelTestDocsGenerator.java +++ b/tools/docs-generator/src/main/java/org/citrusframework/docs/ExcelTestDocsGenerator.java @@ -59,7 +59,7 @@ public ExcelTestDocsGenerator() { @Override public void doHeader(OutputStream buffered) throws TransformerException, - IOException, SAXException { + SAXException { // no header information here. } diff --git a/tools/docs-generator/src/main/java/org/citrusframework/docs/SvgTestDocsGenerator.java b/tools/docs-generator/src/main/java/org/citrusframework/docs/SvgTestDocsGenerator.java index 6f679f1962..053f2e7654 100644 --- a/tools/docs-generator/src/main/java/org/citrusframework/docs/SvgTestDocsGenerator.java +++ b/tools/docs-generator/src/main/java/org/citrusframework/docs/SvgTestDocsGenerator.java @@ -123,13 +123,13 @@ public SvgTestDocsGenerator useSrcDirectory(String testDir) { @Override public void doBody(OutputStream buffered) throws TransformerException, - IOException, SAXException { + SAXException { // no body information here. } @Override public void doHeader(OutputStream buffered) throws TransformerException, - IOException, SAXException { + SAXException { // no header information here. } diff --git a/tools/docs-generator/src/test/java/org/citrusframework/docs/AbstractTestDocsGeneratorTest.java b/tools/docs-generator/src/test/java/org/citrusframework/docs/AbstractTestDocsGeneratorTest.java index adfeebd1ef..dca3801927 100644 --- a/tools/docs-generator/src/test/java/org/citrusframework/docs/AbstractTestDocsGeneratorTest.java +++ b/tools/docs-generator/src/test/java/org/citrusframework/docs/AbstractTestDocsGeneratorTest.java @@ -34,12 +34,12 @@ public class AbstractTestDocsGeneratorTest { private final AbstractTestDocsGenerator abstractTestDocsGenerator = new AbstractTestDocsGenerator("", "") { @Override - public void doBody(final OutputStream buffered) throws TransformerException, IOException, SAXException { + public void doBody(final OutputStream buffered) throws TransformerException, SAXException { } @Override - public void doHeader(final OutputStream buffered) throws TransformerException, IOException, SAXException { + public void doHeader(final OutputStream buffered) throws TransformerException, SAXException { } diff --git a/tools/jbang/src/main/java/org/citrusframework/jbang/CitrusJBangMain.java b/tools/jbang/src/main/java/org/citrusframework/jbang/CitrusJBangMain.java index f0d9056462..9c3e0e9ea7 100644 --- a/tools/jbang/src/main/java/org/citrusframework/jbang/CitrusJBangMain.java +++ b/tools/jbang/src/main/java/org/citrusframework/jbang/CitrusJBangMain.java @@ -59,7 +59,7 @@ public static void run(String... args) { } @Override - public Integer call() throws Exception { + public Integer call() { commandLine.execute("--help"); return 0; } diff --git a/tools/jbang/src/main/java/org/citrusframework/jbang/commands/Agent.java b/tools/jbang/src/main/java/org/citrusframework/jbang/commands/Agent.java index 4163734c33..b65838a42b 100644 --- a/tools/jbang/src/main/java/org/citrusframework/jbang/commands/Agent.java +++ b/tools/jbang/src/main/java/org/citrusframework/jbang/commands/Agent.java @@ -29,7 +29,7 @@ public Agent(CitrusJBangMain main) { } @Override - public Integer call() throws Exception { + public Integer call() { new CommandLine(this).execute("--help"); return 0; } diff --git a/tools/jbang/src/main/java/org/citrusframework/jbang/commands/AgentRun.java b/tools/jbang/src/main/java/org/citrusframework/jbang/commands/AgentRun.java index 2485b00f2c..833e812921 100644 --- a/tools/jbang/src/main/java/org/citrusframework/jbang/commands/AgentRun.java +++ b/tools/jbang/src/main/java/org/citrusframework/jbang/commands/AgentRun.java @@ -128,7 +128,7 @@ public AgentRun(CitrusJBangMain main) { } @Override - public Integer call() throws Exception { + public Integer call() { return runTests(); } diff --git a/tools/jbang/src/main/java/org/citrusframework/jbang/commands/AgentStart.java b/tools/jbang/src/main/java/org/citrusframework/jbang/commands/AgentStart.java index 4f936029c6..af070ce1ca 100644 --- a/tools/jbang/src/main/java/org/citrusframework/jbang/commands/AgentStart.java +++ b/tools/jbang/src/main/java/org/citrusframework/jbang/commands/AgentStart.java @@ -90,7 +90,7 @@ public AgentStart(CitrusJBangMain main) { } @Override - public Integer call() throws Exception { + public Integer call() { return start(); } diff --git a/tools/jbang/src/main/java/org/citrusframework/jbang/commands/Complete.java b/tools/jbang/src/main/java/org/citrusframework/jbang/commands/Complete.java index eb90ccae14..27c597ba2b 100644 --- a/tools/jbang/src/main/java/org/citrusframework/jbang/commands/Complete.java +++ b/tools/jbang/src/main/java/org/citrusframework/jbang/commands/Complete.java @@ -27,7 +27,7 @@ public Complete(CitrusJBangMain main) { } @Override - public Integer call() throws Exception { + public Integer call() { String script = AutoComplete.bash( spec.parent().name(), spec.parent().commandLine()); diff --git a/tools/jbang/src/main/java/org/citrusframework/jbang/commands/ListTests.java b/tools/jbang/src/main/java/org/citrusframework/jbang/commands/ListTests.java index 8c813fb371..8cf92fa56a 100644 --- a/tools/jbang/src/main/java/org/citrusframework/jbang/commands/ListTests.java +++ b/tools/jbang/src/main/java/org/citrusframework/jbang/commands/ListTests.java @@ -49,7 +49,7 @@ public ListTests(CitrusJBangMain main) { } @Override - public Integer call() throws Exception { + public Integer call() { List rows = new ArrayList<>(); final long cur = ProcessHandle.current().pid(); diff --git a/tools/jbang/src/main/java/org/citrusframework/jbang/commands/Run.java b/tools/jbang/src/main/java/org/citrusframework/jbang/commands/Run.java index 3edc3158bb..d6cbfb824d 100644 --- a/tools/jbang/src/main/java/org/citrusframework/jbang/commands/Run.java +++ b/tools/jbang/src/main/java/org/citrusframework/jbang/commands/Run.java @@ -119,7 +119,7 @@ public Run(CitrusJBangMain main) { } @Override - public Integer call() throws Exception { + public Integer call() { return run(); } diff --git a/tools/maven/citrus-agent-maven-plugin/src/main/java/org/citrusframework/agent/plugin/RunTestMojo.java b/tools/maven/citrus-agent-maven-plugin/src/main/java/org/citrusframework/agent/plugin/RunTestMojo.java index d75ba9007c..185818e9a0 100644 --- a/tools/maven/citrus-agent-maven-plugin/src/main/java/org/citrusframework/agent/plugin/RunTestMojo.java +++ b/tools/maven/citrus-agent-maven-plugin/src/main/java/org/citrusframework/agent/plugin/RunTestMojo.java @@ -16,24 +16,6 @@ package org.citrusframework.agent.plugin; -import java.io.File; -import java.io.IOException; -import java.io.StringWriter; -import java.net.URLEncoder; -import java.nio.file.Files; -import java.nio.file.StandardOpenOption; -import java.util.Arrays; -import java.util.List; -import java.util.Objects; -import java.util.Optional; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.concurrent.Future; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.TimeoutException; -import java.util.stream.Stream; - import com.fasterxml.jackson.annotation.JsonIgnoreType; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.core.JsonParser; @@ -75,6 +57,24 @@ import org.citrusframework.spi.Resource; import org.citrusframework.util.StringUtils; +import java.io.File; +import java.io.IOException; +import java.io.StringWriter; +import java.net.URLEncoder; +import java.nio.file.Files; +import java.nio.file.StandardOpenOption; +import java.util.Arrays; +import java.util.List; +import java.util.Objects; +import java.util.Optional; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.Future; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.TimeoutException; +import java.util.stream.Stream; + import static java.util.stream.Collectors.joining; /** @@ -83,7 +83,9 @@ @Mojo(name = "test", defaultPhase = LifecyclePhase.INTEGRATION_TEST, requiresDependencyResolution = ResolutionScope.TEST) public class RunTestMojo extends AbstractAgentMojo { - /** Global url encoding */ + /** + * Global url encoding + */ private static final String ENCODING = "UTF-8"; @Parameter(property = "citrus.agent.skip.test", defaultValue = "false") @@ -106,7 +108,7 @@ public class RunTestMojo extends AbstractAgentMojo { private ObjectMapper mapper; @Override - public void doExecute() throws MojoExecutionException { + public void doExecute() { if (skipRun) { getLog().info("Citrus agent tests are skipped."); return; @@ -410,10 +412,10 @@ private RemoteResult[] pollTestResults() throws MojoExecutionException, IOExcept /** * Check test results for failures. + * * @param results - * @throws IOException */ - private void handleTestResults(TestResult[] results) throws IOException, MojoExecutionException { + private void handleTestResults(TestResult[] results) throws MojoExecutionException { StringWriter resultWriter = new StringWriter(); resultWriter.append(String.format("%n")); @@ -446,7 +448,7 @@ private void getAndSaveReports() throws MojoExecutionException { .build(); String[] reportFiles = {}; - try (var response = getHttpClient().executeOpen(null, httpRequest, null)){ + try (var response = getHttpClient().executeOpen(null, httpRequest, null)) { if (HttpStatus.SC_OK != response.getCode()) { getLog().warn("Failed to get test reports from Citrus agent server"); } @@ -457,7 +459,7 @@ private void getAndSaveReports() throws MojoExecutionException { } File citrusReportsDirectory = new File(getOutputDirectory() + File.separator + getReport().getDirectory()); - if (!citrusReportsDirectory.exists()&& !citrusReportsDirectory.mkdirs()) { + if (!citrusReportsDirectory.exists() && !citrusReportsDirectory.mkdirs()) { throw new MojoExecutionException("Unable to create reports output directory: " + citrusReportsDirectory.getPath()); } @@ -467,32 +469,33 @@ private void getAndSaveReports() throws MojoExecutionException { } Stream.of(reportFiles) - .filter(f -> !f.contains("/")) - .map(reportFile -> new File(citrusReportsDirectory, reportFile)) - .forEach(reportFile -> { - try { - loadAndSaveReportFile(reportFile, getServer().getUrl() + "/results/file/" + URLEncoder.encode(reportFile.getName(), ENCODING), ContentType.APPLICATION_XML.getMimeType()); - } catch (IOException e) { - getLog().warn("Failed to get report file: " + reportFile.getName(), e); - } - }); + .filter(f -> !f.contains("/")) + .map(reportFile -> new File(citrusReportsDirectory, reportFile)) + .forEach(reportFile -> { + try { + loadAndSaveReportFile(reportFile, getServer().getUrl() + "/results/file/" + URLEncoder.encode(reportFile.getName(), ENCODING), ContentType.APPLICATION_XML.getMimeType()); + } catch (IOException e) { + getLog().warn("Failed to get report file: " + reportFile.getName(), e); + } + }); Stream.of(reportFiles) - .filter(f -> f.contains("/")) - .map(f -> f.split("/", 2)) - .forEach(tokens -> { - try { - File subDir = new File(citrusReportsDirectory, tokens[0]); - File reportFile = new File(subDir, tokens[1]); - loadAndSaveReportFile(reportFile, getServer().getUrl() + "/results/file/%s?folder=%s".formatted(URLEncoder.encode(reportFile.getName(), ENCODING), URLEncoder.encode(subDir.getName(), ENCODING)), ContentType.APPLICATION_XML.getMimeType()); - } catch (IOException e) { - getLog().warn("Failed to get report file: %s/%s".formatted(tokens[0], tokens[1]), e); - } - }); + .filter(f -> f.contains("/")) + .map(f -> f.split("/", 2)) + .forEach(tokens -> { + try { + File subDir = new File(citrusReportsDirectory, tokens[0]); + File reportFile = new File(subDir, tokens[1]); + loadAndSaveReportFile(reportFile, getServer().getUrl() + "/results/file/%s?folder=%s".formatted(URLEncoder.encode(reportFile.getName(), ENCODING), URLEncoder.encode(subDir.getName(), ENCODING)), ContentType.APPLICATION_XML.getMimeType()); + } catch (IOException e) { + getLog().warn("Failed to get report file: %s/%s".formatted(tokens[0], tokens[1]), e); + } + }); } /** * Get report file content from server and save content to given file on local file system. + * * @param reportFile * @param serverUrl * @param contentType diff --git a/tools/maven/citrus-agent-maven-plugin/src/main/java/org/citrusframework/agent/plugin/kubernetes/KubernetesManifestHelper.java b/tools/maven/citrus-agent-maven-plugin/src/main/java/org/citrusframework/agent/plugin/kubernetes/KubernetesManifestHelper.java index ece6c82678..93ac1dae4c 100644 --- a/tools/maven/citrus-agent-maven-plugin/src/main/java/org/citrusframework/agent/plugin/kubernetes/KubernetesManifestHelper.java +++ b/tools/maven/citrus-agent-maven-plugin/src/main/java/org/citrusframework/agent/plugin/kubernetes/KubernetesManifestHelper.java @@ -71,7 +71,7 @@ public static ConfigMap createTestSourceConfig(String agentName, Path testJar) t return cm.build(); } - public static Collection createDeploymentManifest(String agentName, String image) throws MojoExecutionException { + public static Collection createDeploymentManifest(String agentName, String image) { List resources = new ArrayList<>(); resources.add(new DeploymentBuilder() diff --git a/tools/maven/citrus-maven-plugin/src/main/java/org/citrusframework/mvn/plugin/AbstractCitrusMojo.java b/tools/maven/citrus-maven-plugin/src/main/java/org/citrusframework/mvn/plugin/AbstractCitrusMojo.java index 85cd8a5fb3..54b10d83f0 100644 --- a/tools/maven/citrus-maven-plugin/src/main/java/org/citrusframework/mvn/plugin/AbstractCitrusMojo.java +++ b/tools/maven/citrus-maven-plugin/src/main/java/org/citrusframework/mvn/plugin/AbstractCitrusMojo.java @@ -74,9 +74,8 @@ public final void execute() throws MojoExecutionException, MojoFailureException /** * Subclass execution logic. * @throws MojoExecutionException - * @throws MojoFailureException */ - public abstract void doExecute() throws MojoExecutionException, MojoFailureException; + public abstract void doExecute() throws MojoExecutionException; /** * Gets the tests. diff --git a/tools/maven/citrus-maven-plugin/src/main/java/org/citrusframework/mvn/plugin/CreateDocsMojo.java b/tools/maven/citrus-maven-plugin/src/main/java/org/citrusframework/mvn/plugin/CreateDocsMojo.java index 14c688ccd1..6f845d1cb3 100644 --- a/tools/maven/citrus-maven-plugin/src/main/java/org/citrusframework/mvn/plugin/CreateDocsMojo.java +++ b/tools/maven/citrus-maven-plugin/src/main/java/org/citrusframework/mvn/plugin/CreateDocsMojo.java @@ -64,7 +64,7 @@ public CreateDocsMojo(ExcelTestDocsGenerator excelTestDocsGenerator, HtmlTestDoc } @Override - public void doExecute() throws MojoExecutionException { + public void doExecute() { if (skipCreateDocs) { return; } diff --git a/tools/maven/citrus-maven-plugin/src/main/java/org/citrusframework/mvn/plugin/CreateTestMojo.java b/tools/maven/citrus-maven-plugin/src/main/java/org/citrusframework/mvn/plugin/CreateTestMojo.java index 92cd8b53c9..9dd90a425c 100644 --- a/tools/maven/citrus-maven-plugin/src/main/java/org/citrusframework/mvn/plugin/CreateTestMojo.java +++ b/tools/maven/citrus-maven-plugin/src/main/java/org/citrusframework/mvn/plugin/CreateTestMojo.java @@ -112,7 +112,7 @@ public CreateTestMojo(XmlTestGenerator xmlTestGenerator, } @Override - public void doExecute() throws MojoExecutionException, MojoFailureException { + public void doExecute() throws MojoExecutionException { if (skipCreateTest) { return; } @@ -224,9 +224,8 @@ public void doExecute() throws MojoExecutionException, MojoFailureException { /** * Creates test case with request and response messages from XML schema. * @param generator - * @throws MojoExecutionException */ - public void createWithXsd(XsdTestGenerator generator) throws MojoExecutionException { + public void createWithXsd(XsdTestGenerator generator) { try { String xsd = null; while(!StringUtils.hasText(xsd)) { diff --git a/tools/maven/citrus-maven-plugin/src/main/java/org/citrusframework/mvn/plugin/GenerateDocsMojo.java b/tools/maven/citrus-maven-plugin/src/main/java/org/citrusframework/mvn/plugin/GenerateDocsMojo.java index f136b3e224..7ad05d611c 100644 --- a/tools/maven/citrus-maven-plugin/src/main/java/org/citrusframework/mvn/plugin/GenerateDocsMojo.java +++ b/tools/maven/citrus-maven-plugin/src/main/java/org/citrusframework/mvn/plugin/GenerateDocsMojo.java @@ -57,7 +57,7 @@ public GenerateDocsMojo(ExcelTestDocsGenerator excelTestDocGenerator, HtmlTestDo } @Override - public void doExecute() throws MojoExecutionException { + public void doExecute() { if (skipGenerateDocs) { return; } diff --git a/tools/maven/citrus-maven-plugin/src/main/java/org/citrusframework/mvn/plugin/GenerateTestMojo.java b/tools/maven/citrus-maven-plugin/src/main/java/org/citrusframework/mvn/plugin/GenerateTestMojo.java index 3709d2aa6f..d045e93f06 100644 --- a/tools/maven/citrus-maven-plugin/src/main/java/org/citrusframework/mvn/plugin/GenerateTestMojo.java +++ b/tools/maven/citrus-maven-plugin/src/main/java/org/citrusframework/mvn/plugin/GenerateTestMojo.java @@ -96,7 +96,7 @@ public GenerateTestMojo(XmlTestGenerator xmlTestGenerator, } @Override - public void doExecute() throws MojoExecutionException, MojoFailureException { + public void doExecute() throws MojoExecutionException { if (skipGenerateTest) { return; } diff --git a/tools/maven/citrus-maven-plugin/src/test/java/org/citrusframework/mvn/plugin/GenerateDocsMojoTest.java b/tools/maven/citrus-maven-plugin/src/test/java/org/citrusframework/mvn/plugin/GenerateDocsMojoTest.java index 8eb9720427..82cf4f82e0 100644 --- a/tools/maven/citrus-maven-plugin/src/test/java/org/citrusframework/mvn/plugin/GenerateDocsMojoTest.java +++ b/tools/maven/citrus-maven-plugin/src/test/java/org/citrusframework/mvn/plugin/GenerateDocsMojoTest.java @@ -45,7 +45,7 @@ public void setup() { } @Test - public void testCreateXls() throws PrompterException, MojoExecutionException, MojoFailureException { + public void testCreateXls() throws MojoExecutionException, MojoFailureException { reset(excelTestDocGenerator); DocsConfiguration docs = new DocsConfiguration(); @@ -72,7 +72,7 @@ public void testCreateXls() throws PrompterException, MojoExecutionException, Mo } @Test - public void testCreateHtml() throws PrompterException, MojoExecutionException, MojoFailureException { + public void testCreateHtml() throws MojoExecutionException, MojoFailureException { reset(htmlTestDocGenerator); DocsConfiguration docs = new DocsConfiguration(); diff --git a/tools/maven/citrus-maven-plugin/src/test/java/org/citrusframework/mvn/plugin/GenerateTestMojoTest.java b/tools/maven/citrus-maven-plugin/src/test/java/org/citrusframework/mvn/plugin/GenerateTestMojoTest.java index d2cc28fffd..a0ef5f8282 100644 --- a/tools/maven/citrus-maven-plugin/src/test/java/org/citrusframework/mvn/plugin/GenerateTestMojoTest.java +++ b/tools/maven/citrus-maven-plugin/src/test/java/org/citrusframework/mvn/plugin/GenerateTestMojoTest.java @@ -72,7 +72,7 @@ public void setup() { } @Test - public void testCreate() throws PrompterException, MojoExecutionException, MojoFailureException { + public void testCreate() throws MojoExecutionException, MojoFailureException { reset(xmlTestGenerator); TestConfiguration configuration = new TestConfiguration(); @@ -97,7 +97,7 @@ public void testCreate() throws PrompterException, MojoExecutionException, MojoF } @Test - public void testSuiteFromXsd() throws MojoExecutionException, PrompterException, MojoFailureException { + public void testSuiteFromXsd() throws MojoExecutionException, MojoFailureException { reset(xsdXmlTestGenerator); TestConfiguration configuration = new TestConfiguration(); @@ -134,7 +134,7 @@ public void testSuiteFromXsd() throws MojoExecutionException, PrompterException, } @Test - public void testSuiteFromWsdl() throws MojoExecutionException, PrompterException, MojoFailureException { + public void testSuiteFromWsdl() throws MojoExecutionException, MojoFailureException { reset(wsdlXmlTestGenerator); TestConfiguration configuration = new TestConfiguration(); @@ -170,7 +170,7 @@ public void testSuiteFromWsdl() throws MojoExecutionException, PrompterException } @Test - public void testSuiteFromSwagger() throws MojoExecutionException, PrompterException, MojoFailureException { + public void testSuiteFromSwagger() throws MojoExecutionException, MojoFailureException { reset(swaggerXmlTestGenerator); TestConfiguration configuration = new TestConfiguration(); diff --git a/tools/restdocs/src/main/java/org/citrusframework/restdocs/soap/RestDocSoapRequestConverter.java b/tools/restdocs/src/main/java/org/citrusframework/restdocs/soap/RestDocSoapRequestConverter.java index 3d2df3787c..046785aa18 100644 --- a/tools/restdocs/src/main/java/org/citrusframework/restdocs/soap/RestDocSoapRequestConverter.java +++ b/tools/restdocs/src/main/java/org/citrusframework/restdocs/soap/RestDocSoapRequestConverter.java @@ -97,7 +97,7 @@ protected HttpHeaders extractHeaders(MessageContext messageContext) { return httpHeaders; } - protected Collection extractParts(MessageContext messageContext) throws IOException { + protected Collection extractParts(MessageContext messageContext) { List parts = new ArrayList<>(); return parts; } diff --git a/tools/restdocs/src/test/java/org/citrusframework/restdocs/util/RestDocTestNameFormatterTest.java b/tools/restdocs/src/test/java/org/citrusframework/restdocs/util/RestDocTestNameFormatterTest.java index 3d1368ae76..293d542807 100644 --- a/tools/restdocs/src/test/java/org/citrusframework/restdocs/util/RestDocTestNameFormatterTest.java +++ b/tools/restdocs/src/test/java/org/citrusframework/restdocs/util/RestDocTestNameFormatterTest.java @@ -25,7 +25,7 @@ public class RestDocTestNameFormatterTest { @Test - public void testFormat() throws Exception { + public void testFormat() { Assert.assertEquals(RestDocTestNameFormatter.format(getClass(), getClass().getSimpleName() + ".testName"), "testName"); Assert.assertEquals(RestDocTestNameFormatter.format(getClass(), getClass().getSimpleName() + ".testNameIT"), "testNameIt"); Assert.assertEquals(RestDocTestNameFormatter.format(getClass(), "someOtherName.testName"), "someOtherName.testName"); diff --git a/tools/test-generator/src/test/java/org/citrusframework/generate/javadsl/XsdJavaTestGeneratorTest.java b/tools/test-generator/src/test/java/org/citrusframework/generate/javadsl/XsdJavaTestGeneratorTest.java index 1065014f55..0674f68090 100644 --- a/tools/test-generator/src/test/java/org/citrusframework/generate/javadsl/XsdJavaTestGeneratorTest.java +++ b/tools/test-generator/src/test/java/org/citrusframework/generate/javadsl/XsdJavaTestGeneratorTest.java @@ -96,7 +96,7 @@ public void testCreateTestWithoutResponse() throws IOException { } @Test(expectedExceptions = CitrusRuntimeException.class, expectedExceptionsMessageRegExp = "Unable to find element with name 'HiRequest'.*") - public void testUnknownRequest() throws IOException { + public void testUnknownRequest() { XsdJavaTestGenerator generator = new XsdJavaTestGenerator(); generator.withAuthor("Christoph") diff --git a/tools/test-generator/src/test/java/org/citrusframework/generate/xml/XsdXmlTestGeneratorTest.java b/tools/test-generator/src/test/java/org/citrusframework/generate/xml/XsdXmlTestGeneratorTest.java index 76f2816c2c..5a5d5af662 100644 --- a/tools/test-generator/src/test/java/org/citrusframework/generate/xml/XsdXmlTestGeneratorTest.java +++ b/tools/test-generator/src/test/java/org/citrusframework/generate/xml/XsdXmlTestGeneratorTest.java @@ -116,7 +116,7 @@ public void testCreateTestWithoutResponse() throws IOException { } @Test(expectedExceptions = CitrusRuntimeException.class, expectedExceptionsMessageRegExp = "Unable to find element with name 'HiRequest'.*") - public void testUnknownRequest() throws IOException { + public void testUnknownRequest() { XsdXmlTestGenerator generator = new XsdXmlTestGenerator(); generator.withAuthor("Christoph") diff --git a/validation/citrus-validation-groovy/src/test/java/org/citrusframework/actions/dsl/ExecuteSQLQueryTestActionBuilderTest.java b/validation/citrus-validation-groovy/src/test/java/org/citrusframework/actions/dsl/ExecuteSQLQueryTestActionBuilderTest.java index fddc054824..66b90a9223 100644 --- a/validation/citrus-validation-groovy/src/test/java/org/citrusframework/actions/dsl/ExecuteSQLQueryTestActionBuilderTest.java +++ b/validation/citrus-validation-groovy/src/test/java/org/citrusframework/actions/dsl/ExecuteSQLQueryTestActionBuilderTest.java @@ -88,7 +88,7 @@ public void testValidationScript() { } @Test - public void testValidationScriptResource() throws IOException { + public void testValidationScriptResource() { List> results = new ArrayList<>(); results.add(Collections.singletonMap("NAME", "Radj")); @@ -152,7 +152,7 @@ public void testGroovyValidationScript() { } @Test - public void testGroovyValidationScriptResource() throws IOException { + public void testGroovyValidationScriptResource() { List> results = new ArrayList<>(); results.add(Collections.singletonMap("NAME", "Penny")); results.add(Collections.singletonMap("NAME", "Howard")); diff --git a/validation/citrus-validation-groovy/src/test/java/org/citrusframework/actions/dsl/ReceiveMessageActionBuilderTest.java b/validation/citrus-validation-groovy/src/test/java/org/citrusframework/actions/dsl/ReceiveMessageActionBuilderTest.java index c2d8912dbf..d1c55b17f9 100644 --- a/validation/citrus-validation-groovy/src/test/java/org/citrusframework/actions/dsl/ReceiveMessageActionBuilderTest.java +++ b/validation/citrus-validation-groovy/src/test/java/org/citrusframework/actions/dsl/ReceiveMessageActionBuilderTest.java @@ -109,7 +109,7 @@ public void testReceiveBuilderWithValidationScript() { } @Test - public void testReceiveBuilderWithValidationScriptResourcePath() throws IOException { + public void testReceiveBuilderWithValidationScriptResourcePath() { final GroovyJsonMessageValidator validator = new GroovyJsonMessageValidator(); reset(referenceResolver, messageEndpoint, messageConsumer, configuration); @@ -160,7 +160,7 @@ public void testReceiveBuilderWithValidationScriptResourcePath() throws IOExcept } @Test - public void testReceiveBuilderWithValidationScriptResource() throws IOException { + public void testReceiveBuilderWithValidationScriptResource() { final GroovyJsonMessageValidator validator = new GroovyJsonMessageValidator(); reset(referenceResolver, messageEndpoint, messageConsumer, configuration); diff --git a/validation/citrus-validation-hamcrest/src/test/java/org/citrusframework/validation/DefaultMessageHeaderValidatorTest.java b/validation/citrus-validation-hamcrest/src/test/java/org/citrusframework/validation/DefaultMessageHeaderValidatorTest.java index 318452fe27..4324293c04 100644 --- a/validation/citrus-validation-hamcrest/src/test/java/org/citrusframework/validation/DefaultMessageHeaderValidatorTest.java +++ b/validation/citrus-validation-hamcrest/src/test/java/org/citrusframework/validation/DefaultMessageHeaderValidatorTest.java @@ -35,7 +35,7 @@ public class DefaultMessageHeaderValidatorTest extends AbstractTestNGUnitTest { private final HeaderValidationContext validationContext = new HeaderValidationContext.Builder().build(); @Test - public void testValidateMessageHeadersHamcrestMatcherSupport() throws Exception { + public void testValidateMessageHeadersHamcrestMatcherSupport() { Message receivedMessage = new DefaultMessage("Hello World!") .setHeader("foo", "foo_test") .setHeader("additional", "additional") @@ -48,7 +48,7 @@ public void testValidateMessageHeadersHamcrestMatcherSupport() throws Exception } @Test(expectedExceptions = ValidationException.class) - public void testValidateHamcrestMatcherError() throws Exception { + public void testValidateHamcrestMatcherError() { Message receivedMessage = new DefaultMessage("Hello World!") .setHeader("foo", "foo_test") .setHeader("bar", "bar_test"); diff --git a/validation/citrus-validation-hamcrest/src/test/java/org/citrusframework/validation/ValidationUtilsTest.java b/validation/citrus-validation-hamcrest/src/test/java/org/citrusframework/validation/ValidationUtilsTest.java index 250722c217..bdbcd14250 100644 --- a/validation/citrus-validation-hamcrest/src/test/java/org/citrusframework/validation/ValidationUtilsTest.java +++ b/validation/citrus-validation-hamcrest/src/test/java/org/citrusframework/validation/ValidationUtilsTest.java @@ -34,12 +34,12 @@ protected TestContextFactory createTestContextFactory() { } @Test(dataProvider = "testData") - public void testValidateValues(String actualValue, Object expectedValue, String path) throws Exception { + public void testValidateValues(String actualValue, Object expectedValue, String path) { ValidationUtils.validateValues(actualValue, expectedValue, path, context); } @Test(dataProvider = "testDataFailed", expectedExceptions = ValidationException.class) - public void testValidateValuesFailure(String actualValue, Object expectedValue, String path) throws Exception { + public void testValidateValuesFailure(String actualValue, Object expectedValue, String path) { ValidationUtils.validateValues(actualValue, expectedValue, path, context); } diff --git a/validation/citrus-validation-json/src/test/java/org/citrusframework/config/xml/JsonDataDictionaryParserTest.java b/validation/citrus-validation-json/src/test/java/org/citrusframework/config/xml/JsonDataDictionaryParserTest.java index 2791d6ffb7..e02f1ced6b 100644 --- a/validation/citrus-validation-json/src/test/java/org/citrusframework/config/xml/JsonDataDictionaryParserTest.java +++ b/validation/citrus-validation-json/src/test/java/org/citrusframework/config/xml/JsonDataDictionaryParserTest.java @@ -31,7 +31,7 @@ public class JsonDataDictionaryParserTest extends AbstractBeanDefinitionParserTest { @Test - public void testDataDictionaryParser() throws Exception { + public void testDataDictionaryParser() { Map dictionaries = beanDefinitionContext.getBeansOfType(JsonMappingDataDictionary.class); Assert.assertEquals(dictionaries.size(), 3L); diff --git a/validation/citrus-validation-json/src/test/java/org/citrusframework/config/xml/JsonPathDataDictionaryParserTest.java b/validation/citrus-validation-json/src/test/java/org/citrusframework/config/xml/JsonPathDataDictionaryParserTest.java index 90373140d8..aee0b4a404 100644 --- a/validation/citrus-validation-json/src/test/java/org/citrusframework/config/xml/JsonPathDataDictionaryParserTest.java +++ b/validation/citrus-validation-json/src/test/java/org/citrusframework/config/xml/JsonPathDataDictionaryParserTest.java @@ -31,7 +31,7 @@ public class JsonPathDataDictionaryParserTest extends AbstractBeanDefinitionParserTest { @Test - public void testDataDictionaryParser() throws Exception { + public void testDataDictionaryParser() { Map dictionaries = beanDefinitionContext.getBeansOfType(JsonPathMappingDataDictionary.class); Assert.assertEquals(dictionaries.size(), 3L); diff --git a/validation/citrus-validation-json/src/test/java/org/citrusframework/endpoint/adapter/mapping/JsonPayloadMappingKeyExtractorTest.java b/validation/citrus-validation-json/src/test/java/org/citrusframework/endpoint/adapter/mapping/JsonPayloadMappingKeyExtractorTest.java index cb2c71296f..5358b52019 100644 --- a/validation/citrus-validation-json/src/test/java/org/citrusframework/endpoint/adapter/mapping/JsonPayloadMappingKeyExtractorTest.java +++ b/validation/citrus-validation-json/src/test/java/org/citrusframework/endpoint/adapter/mapping/JsonPayloadMappingKeyExtractorTest.java @@ -27,7 +27,7 @@ public class JsonPayloadMappingKeyExtractorTest { @Test - public void testExtractMappingKey() throws Exception { + public void testExtractMappingKey() { JsonPayloadMappingKeyExtractor extractor = new JsonPayloadMappingKeyExtractor(); extractor.setJsonPathExpression("$.person.name"); @@ -39,7 +39,7 @@ public void testExtractMappingKey() throws Exception { } @Test - public void testExtractMappingKeyWithoutJsonPathExpressionSet() throws Exception { + public void testExtractMappingKeyWithoutJsonPathExpressionSet() { JsonPayloadMappingKeyExtractor extractor = new JsonPayloadMappingKeyExtractor(); Assert.assertEquals(extractor.extractMappingKey(new DefaultMessage( @@ -50,7 +50,7 @@ public void testExtractMappingKeyWithoutJsonPathExpressionSet() throws Exception } @Test - public void testRouteMessageWithBadJsonPathExpression() throws Exception { + public void testRouteMessageWithBadJsonPathExpression() { JsonPayloadMappingKeyExtractor extractor = new JsonPayloadMappingKeyExtractor(); extractor.setJsonPathExpression("$.I_DO_NOT_EXIST"); diff --git a/validation/citrus-validation-json/src/test/java/org/citrusframework/functions/core/JsonPathFunctionTest.java b/validation/citrus-validation-json/src/test/java/org/citrusframework/functions/core/JsonPathFunctionTest.java index d8536d9c2a..18fe4f9f3d 100644 --- a/validation/citrus-validation-json/src/test/java/org/citrusframework/functions/core/JsonPathFunctionTest.java +++ b/validation/citrus-validation-json/src/test/java/org/citrusframework/functions/core/JsonPathFunctionTest.java @@ -36,7 +36,7 @@ public class JsonPathFunctionTest extends AbstractTestNGUnitTest { private final String jsonSource = "{ \"person\": { \"name\": \"Sheldon\", \"age\": \"29\" } }"; @Test - public void testExecuteJsonPath() throws Exception { + public void testExecuteJsonPath() { List parameters = new ArrayList<>(); parameters.add(jsonSource); parameters.add("$.person.name"); @@ -44,7 +44,7 @@ public void testExecuteJsonPath() throws Exception { } @Test - public void testExecuteJsonPathFunctions() throws Exception { + public void testExecuteJsonPathFunctions() { List parameters = new ArrayList<>(); parameters.add(jsonSource); parameters.add("$.person.keySet()"); @@ -52,7 +52,7 @@ public void testExecuteJsonPathFunctions() throws Exception { } @Test(expectedExceptions = CitrusRuntimeException.class) - public void testExecuteJsonPathUnknown() throws Exception { + public void testExecuteJsonPathUnknown() { List parameters = new ArrayList<>(); parameters.add(jsonSource); parameters.add("$.person.unknown"); diff --git a/validation/citrus-validation-json/src/test/java/org/citrusframework/validation/json/JsonPathVariableExtractorTest.java b/validation/citrus-validation-json/src/test/java/org/citrusframework/validation/json/JsonPathVariableExtractorTest.java index 219ed3e1aa..3b9a763f88 100644 --- a/validation/citrus-validation-json/src/test/java/org/citrusframework/validation/json/JsonPathVariableExtractorTest.java +++ b/validation/citrus-validation-json/src/test/java/org/citrusframework/validation/json/JsonPathVariableExtractorTest.java @@ -36,7 +36,7 @@ public void setup() { } @Test - public void testExtractVariables() throws Exception { + public void testExtractVariables() { JsonPathVariableExtractor variableExtractor = new JsonPathVariableExtractor.Builder() .expression("$['index']", "index") .expression("$.numbers", "numbers") diff --git a/validation/citrus-validation-json/src/test/java/org/citrusframework/variable/dictionary/json/JsonMappingDataDictionaryTest.java b/validation/citrus-validation-json/src/test/java/org/citrusframework/variable/dictionary/json/JsonMappingDataDictionaryTest.java index d45b0ddf76..072afe59e1 100644 --- a/validation/citrus-validation-json/src/test/java/org/citrusframework/variable/dictionary/json/JsonMappingDataDictionaryTest.java +++ b/validation/citrus-validation-json/src/test/java/org/citrusframework/variable/dictionary/json/JsonMappingDataDictionaryTest.java @@ -127,7 +127,7 @@ public void testTranslateWithArraysAndObjects() { } @Test - public void testTranslateFromMappingFile() throws Exception { + public void testTranslateFromMappingFile() { Message message = new DefaultMessage("{\"TestMessage\":{\"Text\":\"Hello World!\",\"OtherText\":\"No changes\"}}"); JsonMappingDataDictionary dictionary = new JsonMappingDataDictionary(); diff --git a/validation/citrus-validation-json/src/test/java/org/citrusframework/variable/dictionary/json/JsonPathMappingDataDictionaryTest.java b/validation/citrus-validation-json/src/test/java/org/citrusframework/variable/dictionary/json/JsonPathMappingDataDictionaryTest.java index f9615902a1..e13cf178a3 100644 --- a/validation/citrus-validation-json/src/test/java/org/citrusframework/variable/dictionary/json/JsonPathMappingDataDictionaryTest.java +++ b/validation/citrus-validation-json/src/test/java/org/citrusframework/variable/dictionary/json/JsonPathMappingDataDictionaryTest.java @@ -114,7 +114,7 @@ public void testTranslateWithArraysAndObjects() { } @Test - public void testTranslateFromMappingFile() throws Exception { + public void testTranslateFromMappingFile() { Message message = new DefaultMessage("{\"TestMessage\":{\"Text\":\"Hello World!\",\"OtherText\":\"No changes\"}}"); JsonPathMappingDataDictionary dictionary = new JsonPathMappingDataDictionary(); diff --git a/validation/citrus-validation-text/src/test/java/org/citrusframework/validation/text/GzipBinaryBase64MessageValidatorTest.java b/validation/citrus-validation-text/src/test/java/org/citrusframework/validation/text/GzipBinaryBase64MessageValidatorTest.java index dd6d3f1808..2bbb42db97 100644 --- a/validation/citrus-validation-text/src/test/java/org/citrusframework/validation/text/GzipBinaryBase64MessageValidatorTest.java +++ b/validation/citrus-validation-text/src/test/java/org/citrusframework/validation/text/GzipBinaryBase64MessageValidatorTest.java @@ -48,7 +48,7 @@ public void testGzipBinaryBase64Validation() throws IOException { } @Test - public void testGzipBinaryBase64ValidationNoBinaryData() throws IOException { + public void testGzipBinaryBase64ValidationNoBinaryData() { Message receivedMessage = new DefaultMessage("SGVsbG8gV29ybGQh"); Message controlMessage = new DefaultMessage(Base64.encodeBase64String("Hello World!".getBytes())); diff --git a/validation/citrus-validation-xml/src/main/java/org/citrusframework/xml/schema/AbstractSchemaCollection.java b/validation/citrus-validation-xml/src/main/java/org/citrusframework/xml/schema/AbstractSchemaCollection.java index 923c5d4008..ee6d671c88 100644 --- a/validation/citrus-validation-xml/src/main/java/org/citrusframework/xml/schema/AbstractSchemaCollection.java +++ b/validation/citrus-validation-xml/src/main/java/org/citrusframework/xml/schema/AbstractSchemaCollection.java @@ -92,7 +92,7 @@ public static org.springframework.core.io.Resource toSpringResource(Resource res * * @param schema */ - protected void addImportedSchemas(Schema schema) throws WSDLException, IOException, TransformerException, TransformerFactoryConfigurationError { + protected void addImportedSchemas(Schema schema) throws TransformerException, TransformerFactoryConfigurationError { for (Object imports : schema.getImports().values()) { for (SchemaImport schemaImport : (Vector)imports) { // Prevent duplicate imports @@ -119,7 +119,7 @@ protected void addImportedSchemas(Schema schema) throws WSDLException, IOExcepti /** * Recursively add all included schemas as schema resource. */ - protected void addIncludedSchemas(Schema schema) throws WSDLException, IOException, TransformerException, TransformerFactoryConfigurationError { + protected void addIncludedSchemas(Schema schema) throws TransformerException, TransformerFactoryConfigurationError { List includes = schema.getIncludes(); for (SchemaReference schemaReference : includes) { String schemaLocation; diff --git a/validation/citrus-validation-xml/src/test/java/org/citrusframework/actions/dsl/ReceiveMessageActionBuilderTest.java b/validation/citrus-validation-xml/src/test/java/org/citrusframework/actions/dsl/ReceiveMessageActionBuilderTest.java index e6b8f71f66..db6559b7f4 100644 --- a/validation/citrus-validation-xml/src/test/java/org/citrusframework/actions/dsl/ReceiveMessageActionBuilderTest.java +++ b/validation/citrus-validation-xml/src/test/java/org/citrusframework/actions/dsl/ReceiveMessageActionBuilderTest.java @@ -298,7 +298,7 @@ public void testReceiveBuilderWithPayloadString() { } @Test - public void testReceiveBuilderWithPayloadResource() throws IOException { + public void testReceiveBuilderWithPayloadResource() { reset(resource, messageEndpoint, messageConsumer, configuration); when(messageEndpoint.createConsumer()).thenReturn(messageConsumer); when(messageEndpoint.getEndpointConfiguration()).thenReturn(configuration); @@ -678,7 +678,7 @@ public void testReceiveBuilderWithHeaderFragmentExplicitMarshallerName() { } @Test - public void testReceiveBuilderWithHeaderResource() throws IOException { + public void testReceiveBuilderWithHeaderResource() { reset(resource, messageEndpoint, messageConsumer, configuration); when(messageEndpoint.createConsumer()).thenReturn(messageConsumer); when(messageEndpoint.getEndpointConfiguration()).thenReturn(configuration); @@ -736,7 +736,7 @@ public void testReceiveBuilderWithHeaderResource() throws IOException { } @Test - public void testReceiveBuilderWithMultipleHeaderResource() throws IOException { + public void testReceiveBuilderWithMultipleHeaderResource() { reset(resource, messageEndpoint, messageConsumer, configuration); when(messageEndpoint.createConsumer()).thenReturn(messageConsumer); when(messageEndpoint.getEndpointConfiguration()).thenReturn(configuration); diff --git a/validation/citrus-validation-xml/src/test/java/org/citrusframework/config/xml/XmlDataDictionaryParserTest.java b/validation/citrus-validation-xml/src/test/java/org/citrusframework/config/xml/XmlDataDictionaryParserTest.java index 323bfd4bf8..97098dee05 100644 --- a/validation/citrus-validation-xml/src/test/java/org/citrusframework/config/xml/XmlDataDictionaryParserTest.java +++ b/validation/citrus-validation-xml/src/test/java/org/citrusframework/config/xml/XmlDataDictionaryParserTest.java @@ -31,7 +31,7 @@ public class XmlDataDictionaryParserTest extends AbstractBeanDefinitionParserTest { @Test - public void testDataDictionaryParser() throws Exception { + public void testDataDictionaryParser() { Map dictionaries = beanDefinitionContext.getBeansOfType(NodeMappingDataDictionary.class); Assert.assertEquals(dictionaries.size(), 3L); diff --git a/validation/citrus-validation-xml/src/test/java/org/citrusframework/config/xml/XpathDataDictionaryParserTest.java b/validation/citrus-validation-xml/src/test/java/org/citrusframework/config/xml/XpathDataDictionaryParserTest.java index 95ef548d27..1b3116f08e 100644 --- a/validation/citrus-validation-xml/src/test/java/org/citrusframework/config/xml/XpathDataDictionaryParserTest.java +++ b/validation/citrus-validation-xml/src/test/java/org/citrusframework/config/xml/XpathDataDictionaryParserTest.java @@ -31,7 +31,7 @@ public class XpathDataDictionaryParserTest extends AbstractBeanDefinitionParserTest { @Test - public void testDataDictionaryParser() throws Exception { + public void testDataDictionaryParser() { Map dictionaries = beanDefinitionContext.getBeansOfType(XpathMappingDataDictionary.class); Assert.assertEquals(dictionaries.size(), 3L); diff --git a/validation/citrus-validation-xml/src/test/java/org/citrusframework/endpoint/adapter/TestBehaviorExecutingEndpointAdapterTest.java b/validation/citrus-validation-xml/src/test/java/org/citrusframework/endpoint/adapter/TestBehaviorExecutingEndpointAdapterTest.java index 7279196e1e..67bcad4e90 100755 --- a/validation/citrus-validation-xml/src/test/java/org/citrusframework/endpoint/adapter/TestBehaviorExecutingEndpointAdapterTest.java +++ b/validation/citrus-validation-xml/src/test/java/org/citrusframework/endpoint/adapter/TestBehaviorExecutingEndpointAdapterTest.java @@ -49,7 +49,7 @@ public class TestBehaviorExecutingEndpointAdapterTest extends UnitTestSupport { * Test for handler routing by node content */ @Test - public void testRouteMessageByElementTextContent() throws Exception { + public void testRouteMessageByElementTextContent() { XPathPayloadMappingKeyExtractor mappingNameExtractor = new XPathPayloadMappingKeyExtractor(); mappingNameExtractor.setXpathExpression("//TestBehavior/@name"); endpointAdapter.setMappingKeyExtractor(mappingNameExtractor); @@ -71,7 +71,7 @@ public void testRouteMessageByElementTextContent() throws Exception { * Test for handler routing without Xpath given (implementation takes the value of first node). */ @Test - public void testRouteMessageWithDefaultXpath() throws Exception { + public void testRouteMessageWithDefaultXpath() { XPathPayloadMappingKeyExtractor mappingNameExtractor = new XPathPayloadMappingKeyExtractor(); endpointAdapter.setMappingKeyExtractor(mappingNameExtractor); @@ -87,7 +87,7 @@ public void testRouteMessageWithDefaultXpath() throws Exception { * Test for Xpath which is not found --> shall raise exception */ @Test - public void testRouteMessageWithBadXpathExpression() throws Exception { + public void testRouteMessageWithBadXpathExpression() { XPathPayloadMappingKeyExtractor mappingNameExtractor = new XPathPayloadMappingKeyExtractor(); mappingNameExtractor.setXpathExpression("//I_DO_NOT_EXIST"); endpointAdapter.setMappingKeyExtractor(mappingNameExtractor); @@ -105,7 +105,7 @@ public void testRouteMessageWithBadXpathExpression() throws Exception { * Test for correct xpath, but no handler bean is found --> shall raise exc */ @Test - public void testRouteMessageWithBadHandlerConfiguration() throws Exception { + public void testRouteMessageWithBadHandlerConfiguration() { XPathPayloadMappingKeyExtractor mappingNameExtractor = new XPathPayloadMappingKeyExtractor(); mappingNameExtractor.setXpathExpression("//TestBehavior/@name"); endpointAdapter.setMappingKeyExtractor(mappingNameExtractor); diff --git a/validation/citrus-validation-xml/src/test/java/org/citrusframework/endpoint/adapter/XmlTestExecutingEndpointAdapterTest.java b/validation/citrus-validation-xml/src/test/java/org/citrusframework/endpoint/adapter/XmlTestExecutingEndpointAdapterTest.java index b0dccb3d9d..cd5aa6dcef 100644 --- a/validation/citrus-validation-xml/src/test/java/org/citrusframework/endpoint/adapter/XmlTestExecutingEndpointAdapterTest.java +++ b/validation/citrus-validation-xml/src/test/java/org/citrusframework/endpoint/adapter/XmlTestExecutingEndpointAdapterTest.java @@ -78,7 +78,7 @@ protected TestContextFactory createTestContextFactory() { * Test for handler routing by node content */ @Test - public void testRouteMessageByElementTextContent() throws Exception { + public void testRouteMessageByElementTextContent() { XPathPayloadMappingKeyExtractor mappingNameExtractor = new XPathPayloadMappingKeyExtractor(); mappingNameExtractor.setXpathExpression("//Test/@name"); endpointAdapter.setMappingKeyExtractor(mappingNameExtractor); @@ -98,7 +98,7 @@ public void testRouteMessageByElementTextContent() throws Exception { * Test for handler routing without Xpath given (implementation takes the value of first node). */ @Test - public void testRouteMessageWithDefaultXpath() throws Exception { + public void testRouteMessageWithDefaultXpath() { XPathPayloadMappingKeyExtractor mappingNameExtractor = new XPathPayloadMappingKeyExtractor(); endpointAdapter.setMappingKeyExtractor(mappingNameExtractor); @@ -113,7 +113,7 @@ public void testRouteMessageWithDefaultXpath() throws Exception { * Test for Xpath which is not found --> shall raise exception */ @Test - public void testRouteMessageWithBadXpathExpression() throws Exception { + public void testRouteMessageWithBadXpathExpression() { XPathPayloadMappingKeyExtractor mappingNameExtractor = new XPathPayloadMappingKeyExtractor(); mappingNameExtractor.setXpathExpression("//I_DO_NOT_EXIST"); endpointAdapter.setMappingKeyExtractor(mappingNameExtractor); @@ -131,7 +131,7 @@ public void testRouteMessageWithBadXpathExpression() throws Exception { * Test for correct xpath, but no handler bean is found --> shall raise exc */ @Test - public void testRouteMessageWithBadHandlerConfiguration() throws Exception { + public void testRouteMessageWithBadHandlerConfiguration() { XPathPayloadMappingKeyExtractor mappingNameExtractor = new XPathPayloadMappingKeyExtractor(); mappingNameExtractor.setXpathExpression("//Test/@name"); endpointAdapter.setMappingKeyExtractor(mappingNameExtractor); diff --git a/validation/citrus-validation-xml/src/test/java/org/citrusframework/endpoint/adapter/mapping/XPathPayloadMappingKeyExtractorTest.java b/validation/citrus-validation-xml/src/test/java/org/citrusframework/endpoint/adapter/mapping/XPathPayloadMappingKeyExtractorTest.java index 64e4912412..75223e032a 100644 --- a/validation/citrus-validation-xml/src/test/java/org/citrusframework/endpoint/adapter/mapping/XPathPayloadMappingKeyExtractorTest.java +++ b/validation/citrus-validation-xml/src/test/java/org/citrusframework/endpoint/adapter/mapping/XPathPayloadMappingKeyExtractorTest.java @@ -24,7 +24,7 @@ public class XPathPayloadMappingKeyExtractorTest { @Test - public void testExtractMappingKey() throws Exception { + public void testExtractMappingKey() { XPathPayloadMappingKeyExtractor extractor = new XPathPayloadMappingKeyExtractor(); extractor.setXpathExpression("local-name(//MessageBody/*)"); @@ -36,7 +36,7 @@ public void testExtractMappingKey() throws Exception { } @Test - public void testExtractMappingKeyWithoutXpathExpressionSet() throws Exception { + public void testExtractMappingKeyWithoutXpathExpressionSet() { XPathPayloadMappingKeyExtractor extractor = new XPathPayloadMappingKeyExtractor(); Assert.assertEquals(extractor.extractMappingKey(new DefaultMessage( @@ -47,7 +47,7 @@ public void testExtractMappingKeyWithoutXpathExpressionSet() throws Exception { } @Test - public void testRouteMessageWithBadXpathExpression() throws Exception { + public void testRouteMessageWithBadXpathExpression() { XPathPayloadMappingKeyExtractor extractor = new XPathPayloadMappingKeyExtractor(); extractor.setXpathExpression("//I_DO_NOT_EXIST"); diff --git a/validation/citrus-validation-xml/src/test/java/org/citrusframework/functions/XmlFunctionsTest.java b/validation/citrus-validation-xml/src/test/java/org/citrusframework/functions/XmlFunctionsTest.java index 8059da51c4..b9db81ca9d 100644 --- a/validation/citrus-validation-xml/src/test/java/org/citrusframework/functions/XmlFunctionsTest.java +++ b/validation/citrus-validation-xml/src/test/java/org/citrusframework/functions/XmlFunctionsTest.java @@ -27,17 +27,17 @@ public class XmlFunctionsTest extends AbstractTestNGUnitTest { @Test - public void testCreateCDataSection() throws Exception { + public void testCreateCDataSection() { Assert.assertEquals(createCDataSection("Some Text", context), "Some Text]]>"); } @Test - public void testEscapeXml() throws Exception { + public void testEscapeXml() { Assert.assertEquals(escapeXml("Some Text", context), "<Test><Message>Some Text</Message></Test>"); } @Test - public void testXpath() throws Exception { + public void testXpath() { Assert.assertEquals(xPath("Some Text", "/Test/Message", context), "Some Text"); } diff --git a/validation/citrus-validation-xml/src/test/java/org/citrusframework/functions/core/XpathFunctionTest.java b/validation/citrus-validation-xml/src/test/java/org/citrusframework/functions/core/XpathFunctionTest.java index 360a618df0..c9f4eadb0b 100644 --- a/validation/citrus-validation-xml/src/test/java/org/citrusframework/functions/core/XpathFunctionTest.java +++ b/validation/citrus-validation-xml/src/test/java/org/citrusframework/functions/core/XpathFunctionTest.java @@ -36,7 +36,7 @@ public class XpathFunctionTest extends AbstractTestNGUnitTest { private final String xmlSource = "Sheldon29"; @Test - public void testExecuteXpath() throws Exception { + public void testExecuteXpath() { List parameters = new ArrayList<>(); parameters.add(xmlSource); parameters.add("/person/name"); @@ -44,7 +44,7 @@ public void testExecuteXpath() throws Exception { } @Test - public void testExecuteXpathWithNamespaces() throws Exception { + public void testExecuteXpathWithNamespaces() { List parameters = new ArrayList<>(); String xmlSourceNamespace = "Sheldon29"; parameters.add(xmlSourceNamespace); @@ -56,7 +56,7 @@ public void testExecuteXpathWithNamespaces() throws Exception { } @Test(expectedExceptions = CitrusRuntimeException.class) - public void testExecuteXpathUnknown() throws Exception { + public void testExecuteXpathUnknown() { List parameters = new ArrayList<>(); parameters.add(xmlSource); parameters.add("/person/unknown"); diff --git a/validation/citrus-validation-xml/src/test/java/org/citrusframework/util/XMLUtilsTest.java b/validation/citrus-validation-xml/src/test/java/org/citrusframework/util/XMLUtilsTest.java index afbea6f6bf..5642cbfe5a 100644 --- a/validation/citrus-validation-xml/src/test/java/org/citrusframework/util/XMLUtilsTest.java +++ b/validation/citrus-validation-xml/src/test/java/org/citrusframework/util/XMLUtilsTest.java @@ -367,7 +367,7 @@ public void testParseEncodingCharset() { } @Test - public void testEncodingRoundTrip() throws Exception { + public void testEncodingRoundTrip() { String payload = "" + "ÄäÖöÜü"; @@ -380,7 +380,7 @@ public void testEncodingRoundTrip() throws Exception { } @Test - public void testOmitXmlDeclaration() throws Exception { + public void testOmitXmlDeclaration() { String payload = "" + " Test"; diff --git a/validation/citrus-validation-xml/src/test/java/org/citrusframework/validation/xml/DomXmlMessageValidatorTest.java b/validation/citrus-validation-xml/src/test/java/org/citrusframework/validation/xml/DomXmlMessageValidatorTest.java index e8eda3fa65..2301f3f0f7 100644 --- a/validation/citrus-validation-xml/src/test/java/org/citrusframework/validation/xml/DomXmlMessageValidatorTest.java +++ b/validation/citrus-validation-xml/src/test/java/org/citrusframework/validation/xml/DomXmlMessageValidatorTest.java @@ -259,7 +259,7 @@ public void validateXMLSchemaNestedWithNamespaceInRootError() throws Exception { } @Test - public void validateWithExplicitXMLSchema() throws SAXException, IOException, ParserConfigurationException { + public void validateWithExplicitXMLSchema() throws SAXException, ParserConfigurationException { Message message = new DefaultMessage("" + "Kx1R123456789" + "Bx1G987654321" @@ -273,7 +273,7 @@ public void validateWithExplicitXMLSchema() throws SAXException, IOException, Pa } @Test - public void validateWithExplicitSpringSchemaRepository() throws SAXException, IOException, ParserConfigurationException { + public void validateWithExplicitSpringSchemaRepository() throws SAXException, ParserConfigurationException { Message message = new DefaultMessage("" + "Kx1R123456789" + "Bx1G987654321" @@ -287,7 +287,7 @@ public void validateWithExplicitSpringSchemaRepository() throws SAXException, IO } @Test - public void validateWithExplicitCitrusSchemaRepository() throws SAXException, IOException, ParserConfigurationException { + public void validateWithExplicitCitrusSchemaRepository() throws SAXException, ParserConfigurationException { Message message = new DefaultMessage("" + "Kx1R123456789" + "Bx1G987654321" @@ -301,7 +301,7 @@ public void validateWithExplicitCitrusSchemaRepository() throws SAXException, IO } @Test - public void validateWithDefaultSchemaRepository() throws SAXException, IOException, ParserConfigurationException { + public void validateWithDefaultSchemaRepository() throws SAXException, ParserConfigurationException { Message message = new DefaultMessage("" + "Kx1R123456789" + "Bx1G987654321" @@ -427,7 +427,7 @@ public void validateNoMatchingSchema() throws SAXException, IOException, ParserC } @Test - public void validateNoSchemaRepositoryAtAll() throws SAXException, IOException, ParserConfigurationException { + public void validateNoSchemaRepositoryAtAll() throws SAXException, ParserConfigurationException { Message message = new DefaultMessage("" + "Kx1R123456789" + "Bx1G987654321" diff --git a/validation/citrus-validation-xml/src/test/java/org/citrusframework/variable/dictionary/xml/NodeMappingDataDictionaryTest.java b/validation/citrus-validation-xml/src/test/java/org/citrusframework/variable/dictionary/xml/NodeMappingDataDictionaryTest.java index 46ed77f0b8..39fb9b0edb 100644 --- a/validation/citrus-validation-xml/src/test/java/org/citrusframework/variable/dictionary/xml/NodeMappingDataDictionaryTest.java +++ b/validation/citrus-validation-xml/src/test/java/org/citrusframework/variable/dictionary/xml/NodeMappingDataDictionaryTest.java @@ -156,7 +156,7 @@ public void testTranslateWithVariables() { } @Test - public void testTranslateFromMappingFile() throws Exception { + public void testTranslateFromMappingFile() { Message message = new DefaultMessage("Hello World!No changes"); context.setVariable("newText", "Hello!"); diff --git a/validation/citrus-validation-xml/src/test/java/org/citrusframework/variable/dictionary/xml/XpathMappingDataDictionaryTest.java b/validation/citrus-validation-xml/src/test/java/org/citrusframework/variable/dictionary/xml/XpathMappingDataDictionaryTest.java index d59a074ad1..b1d71e47d5 100644 --- a/validation/citrus-validation-xml/src/test/java/org/citrusframework/variable/dictionary/xml/XpathMappingDataDictionaryTest.java +++ b/validation/citrus-validation-xml/src/test/java/org/citrusframework/variable/dictionary/xml/XpathMappingDataDictionaryTest.java @@ -50,7 +50,7 @@ public class XpathMappingDataDictionaryTest extends AbstractTestNGUnitTest { + ""; @Test - public void testTranslate() throws Exception { + public void testTranslate() { Message message = new DefaultMessage(payload); Map mappings = new HashMap<>(); @@ -71,7 +71,7 @@ public void testTranslate() throws Exception { } @Test - public void testTranslateMultipleNodes() throws Exception { + public void testTranslateMultipleNodes() { Message message = new DefaultMessage(payload); Map mappings = new HashMap<>(); @@ -91,7 +91,7 @@ public void testTranslateMultipleNodes() throws Exception { } @Test - public void testTranslateWithNamespaceLookup() throws Exception { + public void testTranslateWithNamespaceLookup() { Message message = new DefaultMessage("Hello World!No changes"); Map mappings = new HashMap<>(); @@ -111,7 +111,7 @@ public void testTranslateWithNamespaceLookup() throws Exception { } @Test - public void testTranslateWithNamespaceBuilder() throws Exception { + public void testTranslateWithNamespaceBuilder() { Message message = new DefaultMessage("Hello World!No changes"); Map mappings = new HashMap<>(); @@ -137,7 +137,7 @@ public void testTranslateWithNamespaceBuilder() throws Exception { } @Test - public void testTranslateWithVariables() throws Exception { + public void testTranslateWithVariables() { Message message = new DefaultMessage(payload); Map mappings = new HashMap<>(); @@ -159,7 +159,7 @@ public void testTranslateWithVariables() throws Exception { } @Test - public void testTranslateFromMappingFile() throws Exception { + public void testTranslateFromMappingFile() { Message message = new DefaultMessage(payload); XpathMappingDataDictionary dictionary = new XpathMappingDataDictionary(); @@ -196,7 +196,7 @@ public void testTranslateNoResult() { } @Test - public void testTranslateXhtml() throws Exception { + public void testTranslateXhtml() { Message message = new DefaultMessage(htmlPayload); message.setType(MessageType.XHTML.name()); From caa0c661b78d54d9f9b4b833d8f2cd869e0d3656 Mon Sep 17 00:00:00 2001 From: Timon Borter Date: Tue, 24 Mar 2026 16:01:39 +0100 Subject: [PATCH 7/9] chore: replace statements with enhanced switch --- .../actions/WatchPodLogsAction.java | 36 ++++++++----------- .../functions/core/JsonPatchFunction.java | 22 +++++------- 2 files changed, 22 insertions(+), 36 deletions(-) diff --git a/connectors/citrus-kubernetes/src/main/java/org/citrusframework/kubernetes/actions/WatchPodLogsAction.java b/connectors/citrus-kubernetes/src/main/java/org/citrusframework/kubernetes/actions/WatchPodLogsAction.java index 1dcebfe6dd..631aa5c536 100644 --- a/connectors/citrus-kubernetes/src/main/java/org/citrusframework/kubernetes/actions/WatchPodLogsAction.java +++ b/connectors/citrus-kubernetes/src/main/java/org/citrusframework/kubernetes/actions/WatchPodLogsAction.java @@ -100,30 +100,22 @@ public void doExecute(TestContext context) { private long getDurationMillis() { if (timeout.indexOf(".") > 0) { - switch (timeUnit) { - case MILLISECONDS: - return Math.round(Double.parseDouble(timeout)); - case SECONDS: - return Math.round(Double.parseDouble(timeout) * 1000); - case MINUTES: - return Math.round(Double.parseDouble(timeout) * 60 * 1000); - default: - throw new CitrusRuntimeException("Unsupported time expression for watch pod log action - " + - "please use one of milliseconds, seconds, minutes"); - } - } - - switch (timeUnit) { - case MILLISECONDS: - return Long.parseLong(timeout); - case SECONDS: - return Long.parseLong(timeout) * 1000; - case MINUTES: - return Long.parseLong(timeout) * 60 * 1000; - default: - throw new CitrusRuntimeException("Unsupported time expression for watch pod log action - " + + return switch (timeUnit) { + case MILLISECONDS -> Math.round(Double.parseDouble(timeout)); + case SECONDS -> Math.round(Double.parseDouble(timeout) * 1000); + case MINUTES -> Math.round(Double.parseDouble(timeout) * 60 * 1000); + default -> throw new CitrusRuntimeException("Unsupported time expression for watch pod log action - " + "please use one of milliseconds, seconds, minutes"); + }; } + + return switch (timeUnit) { + case MILLISECONDS -> Long.parseLong(timeout); + case SECONDS -> Long.parseLong(timeout) * 1000; + case MINUTES -> Long.parseLong(timeout) * 60 * 1000; + default -> throw new CitrusRuntimeException("Unsupported time expression for watch pod log action - " + + "please use one of milliseconds, seconds, minutes"); + }; } /** diff --git a/validation/citrus-validation-json/src/main/java/org/citrusframework/functions/core/JsonPatchFunction.java b/validation/citrus-validation-json/src/main/java/org/citrusframework/functions/core/JsonPatchFunction.java index f967b369cc..5f685ad1d6 100644 --- a/validation/citrus-validation-json/src/main/java/org/citrusframework/functions/core/JsonPatchFunction.java +++ b/validation/citrus-validation-json/src/main/java/org/citrusframework/functions/core/JsonPatchFunction.java @@ -68,20 +68,14 @@ public String execute(Parameters params, TestContext context) { private JsonNode applyOperation(JsonNode root, PatchOperation op) { String jsonPointer = convertToJsonPointer(op.getPath()); - switch (op.getOperation()) { - case "add": - return add(root, jsonPointer, op.getValue()); - case "remove": - return remove(root, jsonPointer); - case "replace": - return replace(root, jsonPointer, op.getValue()); - case "move": - return move(root, jsonPointer, convertToJsonPointer(op.getValue())); - case "copy": - return copy(root, jsonPointer, convertToJsonPointer(op.getValue())); - default: - throw new CitrusRuntimeException("Unsupported operation: " + op.getOperation()); - } + return switch (op.getOperation()) { + case "add" -> add(root, jsonPointer, op.getValue()); + case "remove" -> remove(root, jsonPointer); + case "replace" -> replace(root, jsonPointer, op.getValue()); + case "move" -> move(root, jsonPointer, convertToJsonPointer(op.getValue())); + case "copy" -> copy(root, jsonPointer, convertToJsonPointer(op.getValue())); + default -> throw new CitrusRuntimeException("Unsupported operation: " + op.getOperation()); + }; } private JsonNode add(JsonNode root, String path, String value) { From ea3c13c6a6107c7c8654f693cd690e67ff3448b3 Mon Sep 17 00:00:00 2001 From: Timon Borter Date: Tue, 24 Mar 2026 16:02:51 +0100 Subject: [PATCH 8/9] chore: convert value classes to records --- .../connector/actions/AgentRunAction.java | 4 +- .../docker/command/ImageBuild.java | 6 +- .../jbang/actions/JBangAction.java | 4 +- .../jbang/engine/JBangTestEngine.java | 4 +- .../jbang/engine/JBangTestEngineTest.java | 6 +- .../actions/AgentConnectAction.java | 2 +- .../actions/CreateConfigMapAction.java | 2 +- .../actions/CreateSecretAction.java | 2 +- .../openapi/OpenApiSpecification.java | 4 +- .../validation/OpenApiValidationContext.java | 36 ++-- .../openapi/OpenApiSpecificationTest.java | 8 +- .../selenium/endpoint/SeleniumBrowser.java | 4 +- .../actions/MakeScreenshotActionTest.java | 4 +- .../org/citrusframework/util/SqlUtils.java | 2 +- .../actions/StartTestcontainersAction.java | 6 +- .../compose/ComposeUpAction.java | 6 +- .../agent/CitrusAgentConfiguration.java | 2 +- .../main/TestRunConfiguration.java | 2 +- .../citrusframework/spi/PropertiesLoader.java | 4 +- .../org/citrusframework/spi/Resource.java | 6 +- .../org/citrusframework/spi/Resources.java | 160 ++++++++---------- .../variable/VariableExpressionIterator.java | 43 +---- .../log/LogMessageModifierTest.java | 14 +- .../citrusframework/spi/ResourcesTest.java | 22 +-- .../citrusframework/actions/AntRunAction.java | 2 +- .../actions/LoadPropertiesAction.java | 4 +- .../common/JavaTestLoader.java | 6 +- .../condition/FileCondition.java | 2 +- .../citrusframework/container/Parallel.java | 45 ++--- .../citrusframework/message/ZipMessage.java | 4 +- .../builder/FileResourcePayloadBuilder.java | 2 +- .../org/citrusframework/util/FileUtils.java | 10 +- .../dictionary/AbstractDataDictionary.java | 4 +- .../citrusframework/xml/Jaxb2Marshaller.java | 2 +- .../actions/ReceiveMessageBuilderTest.java | 12 +- .../message/ZipMessageTest.java | 4 +- .../validation/FooValueMatcher.java | 7 +- .../AbstractDataDictionaryTest.java | 6 +- .../spi/CitrusResourceWrapper.java | 4 +- .../spi/SpringResourceWrapper.java | 10 +- .../GlobalVariablesPropertyLoader.java | 6 +- .../spi/CitrusResourceWrapperTest.java | 4 +- .../camel/actions/CamelCmdSendAction.java | 2 +- .../CamelCustomizedRunIntegrationAction.java | 2 +- ...amelKubernetesDeleteIntegrationAction.java | 4 +- .../CamelKubernetesRunIntegrationAction.java | 6 +- ...amelKubernetesVerifyIntegrationAction.java | 2 +- .../actions/CamelRunIntegrationAction.java | 8 +- .../actions/CreateCamelComponentAction.java | 4 +- .../camel/actions/CreateCamelRouteAction.java | 2 +- .../camel/message/CamelRouteProcessor.java | 25 +-- .../CamelKubernetesDeleteIntegrationTest.java | 2 +- .../CamelKubernetesRunIntegrationTest.java | 2 +- .../CamelKubernetesDeleteIntegrationTest.java | 2 +- .../CamelKubernetesRunIntegrationTest.java | 2 +- .../citrusframework/ftp/client/ScpClient.java | 22 +-- .../ftp/message/FtpMessage.java | 4 +- .../citrusframework/ftp/server/FtpServer.java | 2 +- .../annotation/FtpServerConfigParserTest.java | 4 +- .../ftp/config/xml/FtpServerParserTest.java | 3 +- .../http/security/SSLConnection.java | 8 +- .../citrusframework/ssh/server/SshServer.java | 4 +- .../ws/message/SoapAttachment.java | 2 +- .../ws/message/SoapAttachmentTest.java | 51 +++--- .../cucumber/CucumberTestEngine.java | 25 +-- .../backend/spring/CitrusSpringBackend.java | 22 +-- .../groovy/GroovyTestLoader.java | 4 +- .../junit/jupiter/CitrusExtension.java | 21 +-- .../junit/jupiter/CitrusExtensionHelper.java | 2 +- .../junit/jupiter/JUnitJupiterEngine.java | 6 +- .../integration/ApplyTestBehaviorIT.java | 20 +-- .../citrusframework/junit/JUnit4Helper.java | 4 +- .../spring/TestSuiteExecutionListener.java | 18 +- .../integration/ApplyTestBehaviorIT.java | 20 +-- .../citrusframework/testng/TestNGEngine.java | 8 +- .../citrusframework/testng/TestNGHelper.java | 2 +- .../actions/ApplyTestBehaviorIT.java | 52 +++--- .../integration/container/WaitJavaIT.java | 2 +- .../testapi/OpenApiParameterFormatter.java | 34 ++-- .../RestApiSendMessageActionBuilder.java | 2 +- .../cucumber/steps/camel/CamelSteps.java | 2 +- .../steps/groovy/GroovyScriptSteps.java | 6 +- .../cucumber/steps/http/HttpServerSteps.java | 2 +- .../jbang/commands/AgentRun.java | 2 +- .../jbang/commands/AgentStart.java | 2 +- .../citrusframework/jbang/commands/Run.java | 2 +- .../jbang/util/CodeAnalyzer.java | 2 +- .../http/RestDocClientInterceptor.java | 12 +- .../soap/RestDocSoapClientInterceptor.java | 12 +- .../RestDocClientInterceptorParserTest.java | 4 +- .../xml/RestDocDocumentationParserTest.java | 4 +- .../javadsl/WsdlJavaTestGenerator.java | 4 +- .../javadsl/XsdJavaTestGenerator.java | 4 +- .../generate/xml/WsdlXmlTestGenerator.java | 2 +- .../generate/xml/XmlTestMarshaller.java | 2 +- .../generate/xml/XsdXmlTestGenerator.java | 4 +- .../json/JsonSchemaRepository.java | 6 +- .../json/schema/SimpleJsonSchemaTest.java | 6 +- .../xhtml/XhtmlMessageConverter.java | 2 +- .../xml/XsdSchemaRepository.java | 10 +- .../xml/schema/AbstractSchemaCollection.java | 5 +- 101 files changed, 418 insertions(+), 569 deletions(-) diff --git a/connectors/citrus-agent-connector/src/main/java/org/citrusframework/agent/connector/actions/AgentRunAction.java b/connectors/citrus-agent-connector/src/main/java/org/citrusframework/agent/connector/actions/AgentRunAction.java index 9c913485dd..aa91cf739e 100644 --- a/connectors/citrus-agent-connector/src/main/java/org/citrusframework/agent/connector/actions/AgentRunAction.java +++ b/connectors/citrus-agent-connector/src/main/java/org/citrusframework/agent/connector/actions/AgentRunAction.java @@ -77,8 +77,8 @@ public void doExecute(TestContext context) { if (StringUtils.hasText(sourceCode)) { source = context.replaceDynamicContentInString(sourceCode); } else if (sourceFile != null) { - fileExt = Optional.ofNullable(fileExt).orElse(FileUtils.getFileExtension(sourceFile.getLocation())); - testName = FileUtils.getBaseName(FileUtils.getFileName(sourceFile.getLocation())); + fileExt = Optional.ofNullable(fileExt).orElse(FileUtils.getFileExtension(sourceFile.location())); + testName = FileUtils.getBaseName(FileUtils.getFileName(sourceFile.location())); source = context.replaceDynamicContentInString(FileUtils.readToString(sourceFile)); } else if (StringUtils.hasText(sourceFilePath)) { fileExt = Optional.ofNullable(fileExt).orElse(FileUtils.getFileExtension(sourceFilePath)); diff --git a/connectors/citrus-docker/src/main/java/org/citrusframework/docker/command/ImageBuild.java b/connectors/citrus-docker/src/main/java/org/citrusframework/docker/command/ImageBuild.java index 6b71d142b2..0a7b06bec9 100644 --- a/connectors/citrus-docker/src/main/java/org/citrusframework/docker/command/ImageBuild.java +++ b/connectors/citrus-docker/src/main/java/org/citrusframework/docker/command/ImageBuild.java @@ -54,14 +54,14 @@ private void executeDockerCommand(BuildImageCmd command, TestContext testContext } if (hasParameter("basedir")) { - command.withBaseDirectory(FileUtils.getFileResource(getParameter("basedir", testContext), testContext).getFile()); + command.withBaseDirectory(FileUtils.getFileResource(getParameter("basedir", testContext), testContext).file()); } if (hasParameter("dockerfile")) { if (getParameters().get("dockerfile") instanceof Resource) { - command.withDockerfile(((Resource)getParameters().get("dockerfile")).getFile()); + command.withDockerfile(((Resource)getParameters().get("dockerfile")).file()); } else { - command.withDockerfile(FileUtils.getFileResource(getParameter("dockerfile", testContext), testContext).getFile()); + command.withDockerfile(FileUtils.getFileResource(getParameter("dockerfile", testContext), testContext).file()); } } diff --git a/connectors/citrus-jbang-connector/src/main/java/org/citrusframework/jbang/actions/JBangAction.java b/connectors/citrus-jbang-connector/src/main/java/org/citrusframework/jbang/actions/JBangAction.java index 7c3fa0079e..d6b7e86126 100644 --- a/connectors/citrus-jbang-connector/src/main/java/org/citrusframework/jbang/actions/JBangAction.java +++ b/connectors/citrus-jbang-connector/src/main/java/org/citrusframework/jbang/actions/JBangAction.java @@ -165,13 +165,13 @@ public Builder script(String script) { @Override public Builder file(String path) { - this.scriptOrFile = Resources.create(path).getFile().getAbsolutePath(); + this.scriptOrFile = Resources.create(path).file().getAbsolutePath(); return this; } @Override public Builder file(Resource resource) { - this.scriptOrFile = resource.getFile().getAbsolutePath(); + this.scriptOrFile = resource.file().getAbsolutePath(); return this; } diff --git a/connectors/citrus-jbang-connector/src/main/java/org/citrusframework/jbang/engine/JBangTestEngine.java b/connectors/citrus-jbang-connector/src/main/java/org/citrusframework/jbang/engine/JBangTestEngine.java index b05fbc05d1..a92c852f80 100644 --- a/connectors/citrus-jbang-connector/src/main/java/org/citrusframework/jbang/engine/JBangTestEngine.java +++ b/connectors/citrus-jbang-connector/src/main/java/org/citrusframework/jbang/engine/JBangTestEngine.java @@ -57,7 +57,7 @@ public void run() { .workingDir(Optional.ofNullable(getConfiguration().getWorkDir()) .filter(StringUtils::isNotEmpty) .map(FileUtils::getFileResource) - .map(Resource::getFile) + .map(Resource::file) .map(File::toPath) .orElse(workingDir)); @@ -128,7 +128,7 @@ private void runTestSources(CitrusJBang citrus, TestRunConfiguration configurati } else if (StringUtils.hasText(source.getFilePath())) { citrus.run(source.getFilePath(), Collections.emptyMap()); } else { - citrus.run(source.getSourceFile().getLocation(), Collections.emptyMap()); + citrus.run(source.getSourceFile().location(), Collections.emptyMap()); } } catch (IOException e) { throw new CitrusRuntimeException("Failed to run test source: %s".formatted(source.getName()), e); diff --git a/connectors/citrus-jbang-connector/src/test/java/org/citrusframework/jbang/engine/JBangTestEngineTest.java b/connectors/citrus-jbang-connector/src/test/java/org/citrusframework/jbang/engine/JBangTestEngineTest.java index 2931d1203b..d6afde40eb 100644 --- a/connectors/citrus-jbang-connector/src/test/java/org/citrusframework/jbang/engine/JBangTestEngineTest.java +++ b/connectors/citrus-jbang-connector/src/test/java/org/citrusframework/jbang/engine/JBangTestEngineTest.java @@ -32,13 +32,13 @@ public class JBangTestEngineTest { @Test public void testRunFromWorkDirectory() { TestRunConfiguration configuration = new TestRunConfiguration(); - runTestEngine(configuration, Resources.fromClasspath("org/citrusframework/jbang/sample").getFile().toPath()); + runTestEngine(configuration, Resources.fromClasspath("org/citrusframework/jbang/sample").file().toPath()); } @Test public void testRunDirectory() { TestRunConfiguration configuration = new TestRunConfiguration(); - configuration.setPackages(Collections.singletonList(Resources.fromClasspath("org/citrusframework/jbang/sample").getFile().getAbsolutePath())); + configuration.setPackages(Collections.singletonList(Resources.fromClasspath("org/citrusframework/jbang/sample").file().getAbsolutePath())); runTestEngine(configuration); } @@ -46,7 +46,7 @@ public void testRunDirectory() { public void testRunSource() { TestRunConfiguration configuration = new TestRunConfiguration(); configuration.setTestSources(Collections.singletonList(new TestSource("yaml", "hello", - Resources.fromClasspath("org/citrusframework/jbang/sample/hello.citrus.it.yaml").getFile().getAbsolutePath()))); + Resources.fromClasspath("org/citrusframework/jbang/sample/hello.citrus.it.yaml").file().getAbsolutePath()))); runTestEngine(configuration); } diff --git a/connectors/citrus-kubernetes/src/main/java/org/citrusframework/kubernetes/actions/AgentConnectAction.java b/connectors/citrus-kubernetes/src/main/java/org/citrusframework/kubernetes/actions/AgentConnectAction.java index c878ab768d..684730be60 100644 --- a/connectors/citrus-kubernetes/src/main/java/org/citrusframework/kubernetes/actions/AgentConnectAction.java +++ b/connectors/citrus-kubernetes/src/main/java/org/citrusframework/kubernetes/actions/AgentConnectAction.java @@ -95,7 +95,7 @@ public void doExecute(TestContext context) { Path testJarPath = null; if (testJar != null) { - testJarPath = Resources.create(testJar).getFile().toPath(); + testJarPath = Resources.create(testJar).file().toPath(); } if (KubernetesSupport.isConnected(context)) { diff --git a/connectors/citrus-kubernetes/src/main/java/org/citrusframework/kubernetes/actions/CreateConfigMapAction.java b/connectors/citrus-kubernetes/src/main/java/org/citrusframework/kubernetes/actions/CreateConfigMapAction.java index 16e7aaf15d..fca7e458a0 100644 --- a/connectors/citrus-kubernetes/src/main/java/org/citrusframework/kubernetes/actions/CreateConfigMapAction.java +++ b/connectors/citrus-kubernetes/src/main/java/org/citrusframework/kubernetes/actions/CreateConfigMapAction.java @@ -56,7 +56,7 @@ public void doExecute(TestContext context) { Resource file = FileUtils.getFileResource(filePath, context); String resolvedFileContent = context.replaceDynamicContentInString(FileUtils.readToString(file, StandardCharsets.UTF_8)); - data.put(FileUtils.getFileName(file.getLocation()), + data.put(FileUtils.getFileName(file.location()), Base64.getEncoder().encodeToString(resolvedFileContent.getBytes(StandardCharsets.UTF_8))); } catch (IOException e) { throw new CitrusRuntimeException("Failed to create config map from filepath", e); diff --git a/connectors/citrus-kubernetes/src/main/java/org/citrusframework/kubernetes/actions/CreateSecretAction.java b/connectors/citrus-kubernetes/src/main/java/org/citrusframework/kubernetes/actions/CreateSecretAction.java index 257de94622..9937b8a2cd 100644 --- a/connectors/citrus-kubernetes/src/main/java/org/citrusframework/kubernetes/actions/CreateSecretAction.java +++ b/connectors/citrus-kubernetes/src/main/java/org/citrusframework/kubernetes/actions/CreateSecretAction.java @@ -56,7 +56,7 @@ public void doExecute(TestContext context) { Resource file = FileUtils.getFileResource(filePath, context); String resolvedFileContent = context.replaceDynamicContentInString(FileUtils.readToString(file, StandardCharsets.UTF_8)); - data.put(FileUtils.getFileName(file.getLocation()), + data.put(FileUtils.getFileName(file.location()), Base64.getEncoder().encodeToString(resolvedFileContent.getBytes(StandardCharsets.UTF_8))); } catch (IOException e) { throw new CitrusRuntimeException("Failed to create secret from filepath", e); diff --git a/connectors/citrus-openapi/src/main/java/org/citrusframework/openapi/OpenApiSpecification.java b/connectors/citrus-openapi/src/main/java/org/citrusframework/openapi/OpenApiSpecification.java index b7f5a29c32..58a61ddb5a 100644 --- a/connectors/citrus-openapi/src/main/java/org/citrusframework/openapi/OpenApiSpecification.java +++ b/connectors/citrus-openapi/src/main/java/org/citrusframework/openapi/OpenApiSpecification.java @@ -306,7 +306,7 @@ public static OpenApiSpecification from(Resource resource, OpenApiValidationPoli .findFirst() .orElse(HTTP); - specification.setSpecUrl(resource.getLocation()); + specification.setSpecUrl(resource.location()); specification.setRequestUrl( format("%s://%s%s", schemeToUse, OasModelHelper.getHost(openApiDoc), getBasePath(openApiDoc))); @@ -790,7 +790,7 @@ static Optional determineResourceAlias(Resource openApiResource) { String resourceAlias = null; try { - File file = openApiResource.getFile(); + File file = openApiResource.file(); if (file != null) { resourceAlias = file.getName(); int index = resourceAlias.lastIndexOf("."); diff --git a/connectors/citrus-openapi/src/main/java/org/citrusframework/openapi/validation/OpenApiValidationContext.java b/connectors/citrus-openapi/src/main/java/org/citrusframework/openapi/validation/OpenApiValidationContext.java index 4b8ea54dbd..8074394feb 100644 --- a/connectors/citrus-openapi/src/main/java/org/citrusframework/openapi/validation/OpenApiValidationContext.java +++ b/connectors/citrus-openapi/src/main/java/org/citrusframework/openapi/validation/OpenApiValidationContext.java @@ -103,26 +103,22 @@ public void setRequestValidationEnabled(boolean requestValidationEnabled) { this.requestValidationEnabled = requestValidationEnabled; } - private static class IgnoreByKeyWhitelistRule implements WhitelistRule { - - private final String name; - - private final String key; - - private IgnoreByKeyWhitelistRule(@Nonnull String name, @Nonnull String key) { - this.name = name; - this.key = key; - } - - @Override - public boolean matches(Message message, @Nullable ApiOperation operation, - @Nullable Request request, @Nullable Response response) { - return key.equals(message.getKey()); - } - - public static IgnoreByKeyWhitelistRule ignoreByKey(String name, String key) { - return new IgnoreByKeyWhitelistRule(name, key); + private record IgnoreByKeyWhitelistRule(String name, String key) implements WhitelistRule { + + private IgnoreByKeyWhitelistRule(@Nonnull String name, @Nonnull String key) { + this.name = name; + this.key = key; + } + + @Override + public boolean matches(Message message, @Nullable ApiOperation operation, + @Nullable Request request, @Nullable Response response) { + return key.equals(message.getKey()); + } + + public static IgnoreByKeyWhitelistRule ignoreByKey(String name, String key) { + return new IgnoreByKeyWhitelistRule(name, key); + } } - } } diff --git a/connectors/citrus-openapi/src/test/java/org/citrusframework/openapi/OpenApiSpecificationTest.java b/connectors/citrus-openapi/src/test/java/org/citrusframework/openapi/OpenApiSpecificationTest.java index a4f55eddb3..99fdff08de 100644 --- a/connectors/citrus-openapi/src/test/java/org/citrusframework/openapi/OpenApiSpecificationTest.java +++ b/connectors/citrus-openapi/src/test/java/org/citrusframework/openapi/OpenApiSpecificationTest.java @@ -185,7 +185,7 @@ public void shouldInitializeFromResource() { // Then assertNotNull(specification); - assertEquals(specification.getSpecUrl(), resource.getLocation()); + assertEquals(specification.getSpecUrl(), resource.location()); assertPingApi(specification); } @@ -199,7 +199,7 @@ public void shouldInitializeFaultyFromResource() { // Then assertNotNull(specification); - assertEquals(specification.getSpecUrl(), resource.getLocation()); + assertEquals(specification.getSpecUrl(), resource.location()); assertNotNull(specification.getOpenApiDoc(null)); } @@ -454,7 +454,7 @@ public void testResolveResourceAliasFromFile() { File fileMock = mock(); doReturn("MyApi.json").when(fileMock).getName(); Resource resourceMock = mock(); - doReturn(fileMock).when(resourceMock).getFile(); + doReturn(fileMock).when(resourceMock).file(); Optional alias = determineResourceAlias(resourceMock); assertTrue(alias.isPresent()); @@ -466,7 +466,7 @@ public void testResolveResourceAliasFromUrl() throws MalformedURLException { URL urlMock = mock(); doReturn("/C:/segment1/segment2/MyApi.json").when(urlMock).getPath(); Resource resourceMock = mock(); - doThrow(new RuntimeException("Forced Exception")).when(resourceMock).getFile(); + doThrow(new RuntimeException("Forced Exception")).when(resourceMock).file(); doReturn(urlMock).when(resourceMock).getURL(); Optional alias = determineResourceAlias(resourceMock); diff --git a/connectors/citrus-selenium/src/main/java/org/citrusframework/selenium/endpoint/SeleniumBrowser.java b/connectors/citrus-selenium/src/main/java/org/citrusframework/selenium/endpoint/SeleniumBrowser.java index 2a264e4102..8374034fc6 100644 --- a/connectors/citrus-selenium/src/main/java/org/citrusframework/selenium/endpoint/SeleniumBrowser.java +++ b/connectors/citrus-selenium/src/main/java/org/citrusframework/selenium/endpoint/SeleniumBrowser.java @@ -174,11 +174,11 @@ public String storeFile(String fileLocation) { */ public String storeFile(Resource file) { try { - File newFile = new File(temporaryStorage.toFile(), FileUtils.getFileName(file.getLocation())); + File newFile = new File(temporaryStorage.toFile(), FileUtils.getFileName(file.location())); logger.info("Store file {} to {}", file, newFile); - org.apache.commons.io.FileUtils.copyFile(file.getFile(), newFile); + org.apache.commons.io.FileUtils.copyFile(file.file(), newFile); return newFile.getCanonicalPath(); } catch (IOException e) { diff --git a/connectors/citrus-selenium/src/test/java/org/citrusframework/selenium/actions/MakeScreenshotActionTest.java b/connectors/citrus-selenium/src/test/java/org/citrusframework/selenium/actions/MakeScreenshotActionTest.java index 0fddae15e0..0665fcf977 100644 --- a/connectors/citrus-selenium/src/test/java/org/citrusframework/selenium/actions/MakeScreenshotActionTest.java +++ b/connectors/citrus-selenium/src/test/java/org/citrusframework/selenium/actions/MakeScreenshotActionTest.java @@ -50,7 +50,7 @@ public void setup() { @Test public void testExecute() { - when(webDriver.getScreenshotAs(OutputType.FILE)).thenReturn(Resources.fromClasspath("screenshot.png").getFile()); + when(webDriver.getScreenshotAs(OutputType.FILE)).thenReturn(Resources.fromClasspath("screenshot.png").file()); MakeScreenshotAction action = new MakeScreenshotAction.Builder() .browser(seleniumBrowser) @@ -64,7 +64,7 @@ public void testExecute() { @Test public void testExecuteOutputDir() { - when(webDriver.getScreenshotAs(OutputType.FILE)).thenReturn(Resources.fromClasspath("screenshot.png").getFile()); + when(webDriver.getScreenshotAs(OutputType.FILE)).thenReturn(Resources.fromClasspath("screenshot.png").file()); context.setVariable(CitrusSettings.TEST_NAME_VARIABLE, "MyTest"); diff --git a/connectors/citrus-sql/src/main/java/org/citrusframework/util/SqlUtils.java b/connectors/citrus-sql/src/main/java/org/citrusframework/util/SqlUtils.java index 206fe50189..981771c7e7 100644 --- a/connectors/citrus-sql/src/main/java/org/citrusframework/util/SqlUtils.java +++ b/connectors/citrus-sql/src/main/java/org/citrusframework/util/SqlUtils.java @@ -78,7 +78,7 @@ public static List createStatementsFromFileResource(Resource sqlResource try { if (logger.isDebugEnabled()) { - logger.debug("Create statements from SQL file: {}", sqlResource.getFile().getAbsolutePath()); + logger.debug("Create statements from SQL file: {}", sqlResource.file().getAbsolutePath()); } reader = new BufferedReader(new InputStreamReader(sqlResource.getInputStream())); diff --git a/connectors/citrus-testcontainers/src/main/java/org/citrusframework/testcontainers/actions/StartTestcontainersAction.java b/connectors/citrus-testcontainers/src/main/java/org/citrusframework/testcontainers/actions/StartTestcontainersAction.java index b8176ff170..ba81e0009e 100644 --- a/connectors/citrus-testcontainers/src/main/java/org/citrusframework/testcontainers/actions/StartTestcontainersAction.java +++ b/connectors/citrus-testcontainers/src/main/java/org/citrusframework/testcontainers/actions/StartTestcontainersAction.java @@ -360,11 +360,11 @@ public B withVolumeMount(String mountableFile, String mountPath) { @Override public B withVolumeMount(Resource mountableFile, String mountPath) { if (mountableFile instanceof Resources.ClasspathResource) { - this.volumeMounts.put(MountableFile.forClasspathResource(mountableFile.getLocation()), mountPath); + this.volumeMounts.put(MountableFile.forClasspathResource(mountableFile.location()), mountPath); } else if (mountableFile instanceof Resources.FileSystemResource) { - this.volumeMounts.put(MountableFile.forHostPath(mountableFile.getFile().getAbsolutePath()), mountPath); + this.volumeMounts.put(MountableFile.forHostPath(mountableFile.file().getAbsolutePath()), mountPath); } else { - this.volumeMounts.put(MountableFile.forHostPath(mountableFile.getLocation()), mountPath); + this.volumeMounts.put(MountableFile.forHostPath(mountableFile.location()), mountPath); } return self; } diff --git a/connectors/citrus-testcontainers/src/main/java/org/citrusframework/testcontainers/compose/ComposeUpAction.java b/connectors/citrus-testcontainers/src/main/java/org/citrusframework/testcontainers/compose/ComposeUpAction.java index e65a2de44e..093e31d56b 100644 --- a/connectors/citrus-testcontainers/src/main/java/org/citrusframework/testcontainers/compose/ComposeUpAction.java +++ b/connectors/citrus-testcontainers/src/main/java/org/citrusframework/testcontainers/compose/ComposeUpAction.java @@ -249,9 +249,9 @@ public ComposeUpAction doBuild() { String identifier = StringUtils.hasText(containerName) ? containerName.toLowerCase() : Base58.randomString(6).toLowerCase(); if (fileResource != null) { - container = new ComposeContainer(identifier, fileResource.getFile()); + container = new ComposeContainer(identifier, fileResource.file()); } else if (StringUtils.hasText(filePath)) { - container = new ComposeContainer(identifier, Resources.create(filePath).getFile()); + container = new ComposeContainer(identifier, Resources.create(filePath).file()); } else if (referenceResolver != null) { if (StringUtils.hasText(containerName) && referenceResolver.isResolvable(containerName, ComposeContainer.class)) { container = referenceResolver.resolve(containerName, ComposeContainer.class); @@ -261,7 +261,7 @@ public ComposeUpAction doBuild() { } if (container == null && Resources.create("compose.yaml").exists()) { - container = new ComposeContainer(identifier, Resources.create("compose.yaml").getFile()); + container = new ComposeContainer(identifier, Resources.create("compose.yaml").file()); } if (container == null) { diff --git a/core/citrus-api/src/main/java/org/citrusframework/agent/CitrusAgentConfiguration.java b/core/citrus-api/src/main/java/org/citrusframework/agent/CitrusAgentConfiguration.java index 399f6a5fc3..92f8bc4a94 100644 --- a/core/citrus-api/src/main/java/org/citrusframework/agent/CitrusAgentConfiguration.java +++ b/core/citrus-api/src/main/java/org/citrusframework/agent/CitrusAgentConfiguration.java @@ -111,7 +111,7 @@ public static CitrusAgentConfiguration fromEnvVars(TestSourceProvider provider) String testJarPath = CitrusAgentSettings.getTestJar(); Resource testJar = Resources.create(testJarPath); if (testJar.exists()) { - configuration.setTestJar(testJar.getFile()); + configuration.setTestJar(testJar.file()); } else { logger.debug("Ignore test jar artifact {} - not found", testJarPath); } diff --git a/core/citrus-api/src/main/java/org/citrusframework/main/TestRunConfiguration.java b/core/citrus-api/src/main/java/org/citrusframework/main/TestRunConfiguration.java index 1f5217952e..35ef2d5416 100644 --- a/core/citrus-api/src/main/java/org/citrusframework/main/TestRunConfiguration.java +++ b/core/citrus-api/src/main/java/org/citrusframework/main/TestRunConfiguration.java @@ -152,7 +152,7 @@ public void setTestJar(File testJar) { "Jar file is used to perform package scans for test cases to run.") public void setTestJar(String testJar) { if (testJar != null) { - this.testJar = Resources.create(testJar).getFile(); + this.testJar = Resources.create(testJar).file(); } } diff --git a/core/citrus-api/src/main/java/org/citrusframework/spi/PropertiesLoader.java b/core/citrus-api/src/main/java/org/citrusframework/spi/PropertiesLoader.java index 467842d7f4..2503dfedb0 100644 --- a/core/citrus-api/src/main/java/org/citrusframework/spi/PropertiesLoader.java +++ b/core/citrus-api/src/main/java/org/citrusframework/spi/PropertiesLoader.java @@ -37,9 +37,9 @@ public static Properties loadProperties(Resource resource) { Properties properties = new Properties(); try (InputStream inputStream = resource.getInputStream()) { logger.debug("Loading properties resource: {}", resource); - loadProperties(resource.getLocation(), properties, inputStream); + loadProperties(resource.location(), properties, inputStream); } catch (IOException e) { - throwPropertiesLoadingFailedException(resource.getLocation(), e); + throwPropertiesLoadingFailedException(resource.location(), e); } return properties; } diff --git a/core/citrus-api/src/main/java/org/citrusframework/spi/Resource.java b/core/citrus-api/src/main/java/org/citrusframework/spi/Resource.java index 943f19102d..53b53809dc 100644 --- a/core/citrus-api/src/main/java/org/citrusframework/spi/Resource.java +++ b/core/citrus-api/src/main/java/org/citrusframework/spi/Resource.java @@ -36,7 +36,7 @@ public interface Resource { /** * The location of the resource. */ - String getLocation(); + String location(); /** * Whether this resource exists. @@ -49,7 +49,7 @@ public interface Resource { * The default implementation creates a {@code URI} object from resource location. */ default URI getURI() { - return URI.create(getLocation()); + return URI.create(location()); } /** @@ -73,7 +73,7 @@ default URL getURL() throws MalformedURLException { * Return the file associated with this resource. * @return */ - File getFile(); + File file(); /** * Returns a {@link Reader} that reads from the underlying resource using UTF-8 as charset. diff --git a/core/citrus-api/src/main/java/org/citrusframework/spi/Resources.java b/core/citrus-api/src/main/java/org/citrusframework/spi/Resources.java index cc6f49d89b..95728ec89e 100644 --- a/core/citrus-api/src/main/java/org/citrusframework/spi/Resources.java +++ b/core/citrus-api/src/main/java/org/citrusframework/spi/Resources.java @@ -130,62 +130,55 @@ private static String getRawPath(String filePath) { } /** - * Resource loaded from classpath. - */ - public static class ClasspathResource implements Resource { - - private static final ClasspathResourceResolver resolver = new ClasspathResourceResolver(); + * Resource loaded from classpath. + */ + public record ClasspathResource(String location) implements Resource { - private final String location; + private static final ClasspathResourceResolver resolver = new ClasspathResourceResolver(); - public ClasspathResource(String location) { - String raw = getRawPath(location).replace("\\", "/"); + public ClasspathResource(String location) { + String raw = getRawPath(location).replace("\\", "/"); - if (raw.startsWith("/")) { - this.location = raw.substring(1); - } else { - this.location = raw; + if (raw.startsWith("/")) { + this.location = raw.substring(1); + } else { + this.location = raw; + } } - } - - @Override - public String getLocation() { - return location; - } - @Override - public boolean exists() { - return this.getURI() != null; - } - - @Override - public InputStream getInputStream() { - return ClassLoaderHelper.getClassLoader().getResourceAsStream(location); - } + @Override + public boolean exists() { + return this.getURI() != null; + } - @Override - public File getFile() { - if (!exists()) { - throw new CitrusRuntimeException(format("Failed to load classpath resource '%s' - does not exist", location)); + @Override + public InputStream getInputStream() { + return ClassLoaderHelper.getClassLoader().getResourceAsStream(location); } - File found = resolver.getResource(location); - if (found == null) { - throw new CitrusRuntimeException(format("Failed to load classpath resource '%s' - does not exist", location)); + @Override + public File file() { + if (!exists()) { + throw new CitrusRuntimeException(format("Failed to load classpath resource '%s' - does not exist", location)); + } + + File found = resolver.getResource(location); + if (found == null) { + throw new CitrusRuntimeException(format("Failed to load classpath resource '%s' - does not exist", location)); + } + return found; } - return found; - } - @Override - public URI getURI() { - URL url = ClassLoaderHelper.getClassLoader().getResource(location); - try { - return url != null ? url.toURI() : null; - } catch (URISyntaxException e) { - throw new CitrusRuntimeException("Failed to load classpath resource", e); + @Override + public URI getURI() { + URL url = ClassLoaderHelper.getClassLoader().getResource(location); + try { + return url != null ? url.toURI() : null; + } catch (URISyntaxException e) { + throw new CitrusRuntimeException("Failed to load classpath resource", e); + } } } - } /** * Resource with given byte array content. @@ -199,7 +192,7 @@ public ByteArrayResource(byte[] content) { } @Override - public String getLocation() { + public String location() { return ""; } @@ -214,64 +207,53 @@ public InputStream getInputStream() { } @Override - public File getFile() { + public File file() { throw new UnsupportedOperationException( "ByteArrayResource does not provide access to a file"); } } /** - * Resource on the file system. - */ - public static class FileSystemResource implements Resource { - - private final File file; + * Resource on the file system. + */ + public record FileSystemResource(File file) implements Resource { - public FileSystemResource(String path) { - this.file = new File(getRawPath(path)); - } - - public FileSystemResource(File file) { - this.file = file; - } - - @Override - public String getLocation() { - return file.getPath(); - } - - @Override - public URI getURI() { - return file.toURI(); - } - - @Override - public boolean exists() { - return file.exists(); - } + public FileSystemResource(String path) { + this(new File(getRawPath(path))); + } @Override - public InputStream getInputStream() { - if (!exists()) { - throw new CitrusRuntimeException(file + " does not exists"); + public String location() { + return file.getPath(); } - if (file.isDirectory()) { - throw new UnsupportedOperationException(file + " is a directory"); + @Override + public URI getURI() { + return file.toURI(); } - try { - return new FileInputStream(file); - } catch (FileNotFoundException e) { - throw new CitrusRuntimeException(file + " does not exists", e); + @Override + public boolean exists() { + return file.exists(); } - } - @Override - public File getFile() { - return file; + @Override + public InputStream getInputStream() { + if (!exists()) { + throw new CitrusRuntimeException(file + " does not exists"); + } + + if (file.isDirectory()) { + throw new UnsupportedOperationException(file + " is a directory"); + } + + try { + return new FileInputStream(file); + } catch (FileNotFoundException e) { + throw new CitrusRuntimeException(file + " does not exists", e); + } + } } - } public static class UrlResource implements Resource { @@ -282,7 +264,7 @@ public UrlResource(URL url) { } @Override - public String getLocation() { + public String location() { return url.toString(); } @@ -340,7 +322,7 @@ public InputStream getInputStream() { } @Override - public File getFile() { + public File file() { if (!"file".equals(url.getProtocol())) { throw new CitrusRuntimeException( format("Failed to resolve to absolute file path because it does not reside in the file system: %s", url) diff --git a/core/citrus-api/src/main/java/org/citrusframework/variable/VariableExpressionIterator.java b/core/citrus-api/src/main/java/org/citrusframework/variable/VariableExpressionIterator.java index ef7a223512..c1f0b2ba9f 100644 --- a/core/citrus-api/src/main/java/org/citrusframework/variable/VariableExpressionIterator.java +++ b/core/citrus-api/src/main/java/org/citrusframework/variable/VariableExpressionIterator.java @@ -100,7 +100,7 @@ public VariableSegment next() { // Look ahead next segment if (matcher.nextMatch()) { - nextSegment = createSegmentValue(currentSegment.getSegmentValue()); + nextSegment = createSegmentValue(currentSegment.segmentValue()); } else { nextSegment = null; } @@ -130,42 +130,15 @@ public static Object getLastExpressionValue(String variableExpression, TestConte segment = iterator.next(); } - return segment != null ? segment.getSegmentValue() : null; + return segment != null ? segment.segmentValue() : null; } - public static class VariableSegment { - - /** - * The name of the variableExpression segment - */ - private final String name; - - /** - * An optional index if the VariableSegment represents an array. A value of -1 indicates "no index". - */ - private final int index; - - /** - * The evaluated value for this segment - */ - private final Object segmentValue; - - public VariableSegment(String name, int index, Object segmentValue) { - this.name = name; - this.index = index; - this.segmentValue = segmentValue; - } - - public String getName() { - return name; - } - - public int getIndex() { - return index; - } + /** + * @param name The name of the variableExpression segment + * @param index An optional index if the VariableSegment represents an array. A value of -1 indicates "no index". + * @param segmentValue The evaluated value for this segment + */ + public record VariableSegment(String name, int index, Object segmentValue) { - public Object getSegmentValue() { - return segmentValue; - } } } diff --git a/core/citrus-api/src/test/java/org/citrusframework/log/LogMessageModifierTest.java b/core/citrus-api/src/test/java/org/citrusframework/log/LogMessageModifierTest.java index 18ba47b16a..abf9965909 100644 --- a/core/citrus-api/src/test/java/org/citrusframework/log/LogMessageModifierTest.java +++ b/core/citrus-api/src/test/java/org/citrusframework/log/LogMessageModifierTest.java @@ -54,17 +54,11 @@ public void testMaskHeaders() { Assert.assertEquals(modifier.maskHeaders(message), Collections.singletonMap("key", CitrusLogSettings.getLogMaskValue())); } - private static class MockLogModifier implements LogMessageModifier { - - private final String result; - - private MockLogModifier(String result) { - this.result = result; - } + private record MockLogModifier(String result) implements LogMessageModifier { @Override - public String mask(String statement) { - return result; + public String mask(String statement) { + return result; + } } - } } diff --git a/core/citrus-api/src/test/java/org/citrusframework/spi/ResourcesTest.java b/core/citrus-api/src/test/java/org/citrusframework/spi/ResourcesTest.java index e84a842d37..14ce11b679 100644 --- a/core/citrus-api/src/test/java/org/citrusframework/spi/ResourcesTest.java +++ b/core/citrus-api/src/test/java/org/citrusframework/spi/ResourcesTest.java @@ -56,8 +56,8 @@ public class ResourcesTest { @BeforeClass public static void beforeClass() throws URISyntaxException { Resource resource = Resources.create("/ResourcesTest"); - baseUri = resource.getFile().getParentFile().toURI(); - baseFolderUri = resource.getFile().toURI(); + baseUri = resource.file().getParentFile().toURI(); + baseFolderUri = resource.file().toURI(); fileWithContentUri = new URI(baseFolderUri + "FileWithContent.json"); fileWithoutContentUri = new URI(baseFolderUri + "FileWithoutContent.txt"); @@ -87,16 +87,16 @@ public void classpathResourceTest() { @Test public void byteArrayResourceTest() { Resource byteArrayResource = new ByteArrayResource(new byte[100]); - assertEquals(byteArrayResource.getLocation(), ""); + assertEquals(byteArrayResource.location(), ""); assertTrue(byteArrayResource.exists()); assertTrue(byteArrayResource.getInputStream() instanceof ByteArrayInputStream); - assertThrows(UnsupportedOperationException.class, byteArrayResource::getFile); + assertThrows(UnsupportedOperationException.class, byteArrayResource::file); } @Test public void defaultFileSystemResourceTest() { Resource resource = Resources.create("/ResourcesTest"); - File resourceFolder = resource.getFile(); + File resourceFolder = resource.file(); assertTrue(resourceFolder.exists()); assertTrue(resourceFolder.isDirectory()); @@ -117,7 +117,7 @@ public void defaultFileSystemResourceTest() { @Test public void fileSystemResourceTest() throws IOException { Resource resource = Resources.create("/ResourcesTest"); - File file = resource.getFile(); + File file = resource.file(); assertTrue(file.exists()); assertTrue(file.isDirectory()); @@ -126,7 +126,7 @@ public void fileSystemResourceTest() throws IOException { assertTrue(withContentResource instanceof FileSystemResource); assertTrue(withContentResource.exists()); assertEquals(fileWithContentUri, withContentResource.getURI()); - assertEquals(new File(fileWithContentUri).getPath(), withContentResource.getLocation()); + assertEquals(new File(fileWithContentUri).getPath(), withContentResource.location()); try (InputStream inputStream = withContentResource.getInputStream()) { assertNotNull(inputStream); } @@ -154,18 +154,18 @@ public void urlResourceTest() throws MalformedURLException { URL withContentUrlMock = spy(fileWithContentUri.toURL()); UrlResource withContentResource = new UrlResource(withContentUrlMock); assertTrue(withContentResource.exists()); - assertEquals(new File(fileWithContentUri), withContentResource.getFile()); - assertEquals(fileWithContentUri.toURL().toString(), withContentResource.getLocation()); + assertEquals(new File(fileWithContentUri), withContentResource.file()); + assertEquals(fileWithContentUri.toURL().toString(), withContentResource.location()); URL withoutContentUrlMock = spy(fileWithoutContentUri.toURL()); UrlResource withoutContentResource = new UrlResource(withoutContentUrlMock); assertTrue(withoutContentResource.exists()); - assertEquals(new File(fileWithoutContentUri), withoutContentResource.getFile()); + assertEquals(new File(fileWithoutContentUri), withoutContentResource.file()); URL nonExistingUrlMock = spy(nonExistingFileUri.toURL()); UrlResource nonExistingResource = new UrlResource(nonExistingUrlMock); assertFalse(nonExistingResource.exists()); - assertEquals(new File(nonExistingFileUri), nonExistingResource.getFile()); + assertEquals(new File(nonExistingFileUri), nonExistingResource.file()); } @Test diff --git a/core/citrus-base/src/main/java/org/citrusframework/actions/AntRunAction.java b/core/citrus-base/src/main/java/org/citrusframework/actions/AntRunAction.java index 3b2dff1dae..bd1a901cf6 100755 --- a/core/citrus-base/src/main/java/org/citrusframework/actions/AntRunAction.java +++ b/core/citrus-base/src/main/java/org/citrusframework/actions/AntRunAction.java @@ -91,7 +91,7 @@ public void doExecute(TestContext context) { String buildFileResource = context.replaceDynamicContentInString(buildFilePath); try { - ProjectHelper.configureProject(project, Resources.fromClasspath(buildFileResource).getFile()); + ProjectHelper.configureProject(project, Resources.fromClasspath(buildFileResource).file()); for (Entry entry : properties.entrySet()) { String propertyValue = entry.getValue() != null ? context.replaceDynamicContentInString(entry.getValue().toString()) : ""; diff --git a/core/citrus-base/src/main/java/org/citrusframework/actions/LoadPropertiesAction.java b/core/citrus-base/src/main/java/org/citrusframework/actions/LoadPropertiesAction.java index 064dc486ef..ab66bee5f9 100644 --- a/core/citrus-base/src/main/java/org/citrusframework/actions/LoadPropertiesAction.java +++ b/core/citrus-base/src/main/java/org/citrusframework/actions/LoadPropertiesAction.java @@ -55,7 +55,7 @@ public LoadPropertiesAction(Builder builder) { public void doExecute(TestContext context) { Resource resource = FileUtils.getFileResource(filePath, context); - logger.debug("Reading property file {}", FileUtils.getFileName(resource.getLocation())); + logger.debug("Reading property file {}", FileUtils.getFileName(resource.location())); Properties props = FileUtils.loadAsProperties(resource); @@ -78,7 +78,7 @@ public void doExecute(TestContext context) { context.resolveDynamicValuesInMap(unresolved).forEach(context::setVariable); - logger.info("Loaded property file {}", FileUtils.getFileName(resource.getLocation())); + logger.info("Loaded property file {}", FileUtils.getFileName(resource.location())); } /** diff --git a/core/citrus-base/src/main/java/org/citrusframework/common/JavaTestLoader.java b/core/citrus-base/src/main/java/org/citrusframework/common/JavaTestLoader.java index 95cff50c23..4c7d8b7b45 100644 --- a/core/citrus-base/src/main/java/org/citrusframework/common/JavaTestLoader.java +++ b/core/citrus-base/src/main/java/org/citrusframework/common/JavaTestLoader.java @@ -52,9 +52,9 @@ public void doLoad() { Resource javaSource = getSource().getSourceFile(); // Compile source file. JavaCompiler compiler = ToolProvider.getSystemJavaCompiler(); - int success = compiler.run(null, null, null, javaSource.getFile().getAbsolutePath()); + int success = compiler.run(null, null, null, javaSource.file().getAbsolutePath()); if (success != 0) { - throw new CitrusRuntimeException("Failed to compile Java source file: %s".formatted(javaSource.getFile().getAbsolutePath())); + throw new CitrusRuntimeException("Failed to compile Java source file: %s".formatted(javaSource.file().getAbsolutePath())); } String packageName = extractPackageName(javaSource); @@ -107,7 +107,7 @@ public String getClassName() { if (StringUtils.hasText(source.getFilePath())) { filePath = source.getFilePath(); } else { - filePath = source.getSourceFile().getLocation(); + filePath = source.getSourceFile().location(); } if (filePath.contains(":")) { diff --git a/core/citrus-base/src/main/java/org/citrusframework/condition/FileCondition.java b/core/citrus-base/src/main/java/org/citrusframework/condition/FileCondition.java index ea01aa83f1..61ee87520b 100644 --- a/core/citrus-base/src/main/java/org/citrusframework/condition/FileCondition.java +++ b/core/citrus-base/src/main/java/org/citrusframework/condition/FileCondition.java @@ -52,7 +52,7 @@ public boolean isSatisfied(TestContext context) { return file.exists() && file.isFile(); } else { try { - return FileUtils.getFileResource(context.replaceDynamicContentInString(filePath), context).getFile().isFile(); + return FileUtils.getFileResource(context.replaceDynamicContentInString(filePath), context).file().isFile(); } catch (Exception e) { logger.warn("Failed to access file resource '{}'", e.getMessage()); return false; diff --git a/core/citrus-base/src/main/java/org/citrusframework/container/Parallel.java b/core/citrus-base/src/main/java/org/citrusframework/container/Parallel.java index a6d398dcc4..ce3ae4899b 100644 --- a/core/citrus-base/src/main/java/org/citrusframework/container/Parallel.java +++ b/core/citrus-base/src/main/java/org/citrusframework/container/Parallel.java @@ -81,38 +81,29 @@ public void doExecute(TestContext context) { /** * Runnable wrapper for executing an action in separate Thread. + * + * @param action Test action to execute + * @param context Test context + * @param exceptionHandler Exception handler */ - private static class ActionRunner implements Runnable { - /** Test action to execute */ - private final TestAction action; - - /** Test context */ - private final TestContext context; - - /** Exception handler */ - private final Consumer exceptionHandler; - - public ActionRunner(TestAction action, TestContext context, Consumer exceptionHandler) { - this.action = action; - this.context = context; - this.exceptionHandler = exceptionHandler; - } + private record ActionRunner(TestAction action, TestContext context, + Consumer exceptionHandler) implements Runnable { /** - * Run the test action - */ - public void run() { - try { - action.execute(context); - } catch (CitrusRuntimeException e) { - logger.error("Parallel test action raised error", e); - exceptionHandler.accept(e); - } catch (Exception | Error e) { - logger.error("Parallel test action raised error", e); - exceptionHandler.accept(new CitrusRuntimeException(e)); + * Run the test action + */ + public void run() { + try { + action.execute(context); + } catch (CitrusRuntimeException e) { + logger.error("Parallel test action raised error", e); + exceptionHandler.accept(e); + } catch (Exception | Error e) { + logger.error("Parallel test action raised error", e); + exceptionHandler.accept(new CitrusRuntimeException(e)); + } } } - } /** * Action builder. diff --git a/core/citrus-base/src/main/java/org/citrusframework/message/ZipMessage.java b/core/citrus-base/src/main/java/org/citrusframework/message/ZipMessage.java index 9d164dfd63..6e1b092d5d 100644 --- a/core/citrus-base/src/main/java/org/citrusframework/message/ZipMessage.java +++ b/core/citrus-base/src/main/java/org/citrusframework/message/ZipMessage.java @@ -71,9 +71,9 @@ public byte[] getPayload() { */ public ZipMessage addEntry(Resource resource) { try { - addEntry(new Entry(resource.getFile())); + addEntry(new Entry(resource.file())); } catch (IOException e) { - throw new CitrusRuntimeException(String.format("Failed to read zip entry content from given resource: %s", resource.getLocation()), e); + throw new CitrusRuntimeException(String.format("Failed to read zip entry content from given resource: %s", resource.location()), e); } return this; } diff --git a/core/citrus-base/src/main/java/org/citrusframework/message/builder/FileResourcePayloadBuilder.java b/core/citrus-base/src/main/java/org/citrusframework/message/builder/FileResourcePayloadBuilder.java index 5be53c30a3..7577db4858 100644 --- a/core/citrus-base/src/main/java/org/citrusframework/message/builder/FileResourcePayloadBuilder.java +++ b/core/citrus-base/src/main/java/org/citrusframework/message/builder/FileResourcePayloadBuilder.java @@ -126,7 +126,7 @@ public String getMessageType() { public String getResourcePath() { if (resource != null) { - return resource.getLocation(); + return resource.location(); } else { return resourcePath; } diff --git a/core/citrus-base/src/main/java/org/citrusframework/util/FileUtils.java b/core/citrus-base/src/main/java/org/citrusframework/util/FileUtils.java index ea2cf48718..af3062f273 100644 --- a/core/citrus-base/src/main/java/org/citrusframework/util/FileUtils.java +++ b/core/citrus-base/src/main/java/org/citrusframework/util/FileUtils.java @@ -115,14 +115,14 @@ public static String readToString(File file) throws IOException { */ public static String readToString(Resource resource, Charset charset) throws IOException { if (simulationMode) { - resource.getLocation(); + resource.location(); } if (!resource.exists()) { - throw new CitrusRuntimeException("Failed to read resource %s - does not exist".formatted(resource.getLocation())); + throw new CitrusRuntimeException("Failed to read resource %s - does not exist".formatted(resource.location())); } - logger.debug("Reading file resource: '{}' (encoding is '{}')", resource.getLocation(), charset.displayName()); + logger.debug("Reading file resource: '{}' (encoding is '{}')", resource.location(), charset.displayName()); try (InputStream inputStream = resource.getInputStream()) { return readToString(inputStream, charset); @@ -324,7 +324,7 @@ public static String getFileExtension(String path) { public static Properties loadAsProperties(Resource resource) { Properties properties = new Properties(); try (InputStream is = resource.getInputStream()) { - String filename = getFileName(resource.getLocation()); + String filename = getFileName(resource.location()); if (filename != null && filename.endsWith(FILE_EXTENSION_XML)) { properties.loadFromXML(is); } else { @@ -407,7 +407,7 @@ public static byte[] copyToByteArray(File file) { public static byte[] copyToByteArray(Resource resource) { try (InputStream in = resource.getInputStream()) { if (in == null) { - throw new CitrusRuntimeException(String.format("Unable to access input stream of resource %s", resource.getLocation())); + throw new CitrusRuntimeException(String.format("Unable to access input stream of resource %s", resource.location())); } return in.readAllBytes(); } catch (IOException e) { diff --git a/core/citrus-base/src/main/java/org/citrusframework/variable/dictionary/AbstractDataDictionary.java b/core/citrus-base/src/main/java/org/citrusframework/variable/dictionary/AbstractDataDictionary.java index 3158114b68..d643c1f194 100644 --- a/core/citrus-base/src/main/java/org/citrusframework/variable/dictionary/AbstractDataDictionary.java +++ b/core/citrus-base/src/main/java/org/citrusframework/variable/dictionary/AbstractDataDictionary.java @@ -71,7 +71,7 @@ protected V convertIfNecessary(String value, V originalValue, TestContext co @Override public void initialize() { if (mappingFile != null) { - logger.debug("Reading data dictionary mapping: {}", mappingFile.getLocation()); + logger.debug("Reading data dictionary mapping: {}", mappingFile.location()); Properties properties = loadProperties(mappingFile); for (Map.Entry entry : properties.entrySet()) { @@ -86,7 +86,7 @@ public void initialize() { mappings.put(key, properties.getProperty(key)); } - logger.info("Loaded data dictionary mapping: {}", mappingFile.getLocation()); + logger.info("Loaded data dictionary mapping: {}", mappingFile.location()); } } diff --git a/core/citrus-base/src/main/java/org/citrusframework/xml/Jaxb2Marshaller.java b/core/citrus-base/src/main/java/org/citrusframework/xml/Jaxb2Marshaller.java index 6e0364c4ac..07e76cfb00 100644 --- a/core/citrus-base/src/main/java/org/citrusframework/xml/Jaxb2Marshaller.java +++ b/core/citrus-base/src/main/java/org/citrusframework/xml/Jaxb2Marshaller.java @@ -168,7 +168,7 @@ private Schema loadSchema(Resource... schemas) { for (Resource resource : schemas) { if (resource == null || !resource.exists()) { throw new ValidationException(String.format("Resource does not exist: %s", - Optional.ofNullable(resource).map(Resource::getLocation).orElse("null"))); + Optional.ofNullable(resource).map(Resource::location).orElse("null"))); } InputSource inputSource = new InputSource(resource.getInputStream()); diff --git a/core/citrus-base/src/test/java/org/citrusframework/actions/ReceiveMessageBuilderTest.java b/core/citrus-base/src/test/java/org/citrusframework/actions/ReceiveMessageBuilderTest.java index 480807a40c..1cdcb5385d 100644 --- a/core/citrus-base/src/test/java/org/citrusframework/actions/ReceiveMessageBuilderTest.java +++ b/core/citrus-base/src/test/java/org/citrusframework/actions/ReceiveMessageBuilderTest.java @@ -206,7 +206,7 @@ void payload_asResource() { //WHEN when(resource.exists()).thenReturn(true); - when(resource.getLocation()).thenReturn("dummy.xml"); + when(resource.location()).thenReturn("dummy.xml"); when(resource.getInputStream()).thenReturn(new ByteArrayInputStream("Hello".getBytes(StandardCharsets.UTF_8))); builder.message().body(this.resource); @@ -222,7 +222,7 @@ void payload_asResourceWithCharset() { //WHEN when(resource.exists()).thenReturn(true); - when(resource.getLocation()).thenReturn("dummy.xml"); + when(resource.location()).thenReturn("dummy.xml"); when(resource.getInputStream()).thenReturn(new ByteArrayInputStream("Hello".getBytes(StandardCharsets.UTF_8))); builder.message().body(this.resource, Charset.defaultCharset()); @@ -305,7 +305,7 @@ void header_fromResource() { //WHEN when(resource.exists()).thenReturn(true); - when(resource.getLocation()).thenReturn("dummy.xml"); + when(resource.location()).thenReturn("dummy.xml"); when(resource.getInputStream()).thenReturn(new ByteArrayInputStream("Hello".getBytes(StandardCharsets.UTF_8))); builder.message().header(resource); @@ -323,7 +323,7 @@ void header_fromResourceAndCharset() { //WHEN when(resource.exists()).thenReturn(true); - when(resource.getLocation()).thenReturn("dummy.xml"); + when(resource.location()).thenReturn("dummy.xml"); when(resource.getInputStream()).thenReturn(new ByteArrayInputStream("Hi".getBytes(StandardCharsets.UTF_8))); builder.message().header(resource, Charset.defaultCharset()); @@ -378,7 +378,7 @@ void validationScript_fromResource() { //WHEN when(resource.exists()).thenReturn(true); - when(resource.getLocation()).thenReturn("dummy.groovy"); + when(resource.location()).thenReturn("dummy.groovy"); when(resource.getInputStream()).thenReturn(new ByteArrayInputStream("assert message == 'Hello'".getBytes(StandardCharsets.UTF_8))); builder.validate(new DefaultScriptValidationContext.Builder() @@ -404,7 +404,7 @@ void validationScript_fromResourceAndCharset() { //WHEN when(resource.exists()).thenReturn(true); - when(resource.getLocation()).thenReturn("dummy.groovy"); + when(resource.location()).thenReturn("dummy.groovy"); when(resource.getInputStream()).thenReturn(new ByteArrayInputStream("assert message == 'Hello'".getBytes(StandardCharsets.UTF_8))); builder.validate(new DefaultScriptValidationContext.Builder() diff --git a/core/citrus-base/src/test/java/org/citrusframework/message/ZipMessageTest.java b/core/citrus-base/src/test/java/org/citrusframework/message/ZipMessageTest.java index 267308fe37..cb616bbdce 100644 --- a/core/citrus-base/src/test/java/org/citrusframework/message/ZipMessageTest.java +++ b/core/citrus-base/src/test/java/org/citrusframework/message/ZipMessageTest.java @@ -81,7 +81,7 @@ public void testNewDirectoryStructure() throws Exception { ZipMessage message = new ZipMessage(); message.addEntry(new ZipMessage.Entry("foos/") .addEntry(new ZipMessage.Entry("foo.txt", - Resources.fromClasspath("org/citrusframework/archive/foo.txt").getFile()))); + Resources.fromClasspath("org/citrusframework/archive/foo.txt").file()))); File archive = new File (createTempDir().toFile(), "archive.zip"); FileUtils.writeToFile(new ByteArrayInputStream(message.getPayload()), archive); @@ -104,7 +104,7 @@ public void testEmptyDirectory() throws Exception { message.addEntry(new ZipMessage.Entry("foos/")); message.addEntry(new ZipMessage.Entry("bars/") .addEntry(new ZipMessage.Entry("bar.txt", - Resources.fromClasspath("org/citrusframework/archive/bar.txt").getFile()))); + Resources.fromClasspath("org/citrusframework/archive/bar.txt").file()))); File archive = new File (createTempDir().toFile(), "archive.zip"); FileUtils.writeToFile(new ByteArrayInputStream(message.getPayload()), archive); diff --git a/core/citrus-base/src/test/java/org/citrusframework/validation/FooValueMatcher.java b/core/citrus-base/src/test/java/org/citrusframework/validation/FooValueMatcher.java index a6164a052d..daffa23cdc 100644 --- a/core/citrus-base/src/test/java/org/citrusframework/validation/FooValueMatcher.java +++ b/core/citrus-base/src/test/java/org/citrusframework/validation/FooValueMatcher.java @@ -29,11 +29,6 @@ public boolean validate(Object received, Object control, TestContext context) { return ((FooValue) received).value.equals(((FooValue) control).value); } - static class FooValue { - public final String value; - - FooValue(String value) { - this.value = value; - } + record FooValue(String value) { } } diff --git a/core/citrus-base/src/test/java/org/citrusframework/variable/dictionary/AbstractDataDictionaryTest.java b/core/citrus-base/src/test/java/org/citrusframework/variable/dictionary/AbstractDataDictionaryTest.java index 74562e1708..9405925d4a 100644 --- a/core/citrus-base/src/test/java/org/citrusframework/variable/dictionary/AbstractDataDictionaryTest.java +++ b/core/citrus-base/src/test/java/org/citrusframework/variable/dictionary/AbstractDataDictionaryTest.java @@ -62,7 +62,7 @@ public void testInitializeWithNormalPropertiesFile() { // Setup mock resource doReturn(inputStream).when(mappingFile).getInputStream(); - doReturn("test.properties").when(mappingFile).getLocation(); + doReturn("test.properties").when(mappingFile).location(); fixture.initialize(); @@ -83,7 +83,7 @@ public void testInitializeWithXMLPropertiesFile() { // Setup mock resource doReturn(inputStream).when(mappingFile).getInputStream(); - doReturn("test.properties.xml").when(mappingFile).getLocation(); // Note the .xml-suffix + doReturn("test.properties.xml").when(mappingFile).location(); // Note the .xml-suffix fixture.initialize(); @@ -97,7 +97,7 @@ public void testInitializeThrowsExceptionWithInvalidXMLPropertiesFile() { // Setup mock resource doReturn(inputStream).when(mappingFile).getInputStream(); - doReturn("test.properties.xml").when(mappingFile).getLocation(); // Note the .xml-suffix + doReturn("test.properties.xml").when(mappingFile).location(); // Note the .xml-suffix CitrusRuntimeException exception = expectThrows(CitrusRuntimeException.class, () -> fixture.initialize()); assertTrue(exception.getCause() instanceof InvalidPropertiesFormatException); diff --git a/core/citrus-spring/src/main/java/org/citrusframework/spi/CitrusResourceWrapper.java b/core/citrus-spring/src/main/java/org/citrusframework/spi/CitrusResourceWrapper.java index 3314bd2f40..1f498ea6eb 100644 --- a/core/citrus-spring/src/main/java/org/citrusframework/spi/CitrusResourceWrapper.java +++ b/core/citrus-spring/src/main/java/org/citrusframework/spi/CitrusResourceWrapper.java @@ -39,7 +39,7 @@ public static CitrusResourceWrapper from(org.springframework.core.io.Resource re } @Override - public String getLocation() { + public String location() { try { if (delegate instanceof ClassPathResource classPathResource) { return classPathResource.getURI().toString(); @@ -66,7 +66,7 @@ public InputStream getInputStream() { } @Override - public File getFile() { + public File file() { try { return delegate.getFile(); } catch (IOException e) { diff --git a/core/citrus-spring/src/main/java/org/citrusframework/spi/SpringResourceWrapper.java b/core/citrus-spring/src/main/java/org/citrusframework/spi/SpringResourceWrapper.java index fcdaaada0e..3e2d1f56f5 100644 --- a/core/citrus-spring/src/main/java/org/citrusframework/spi/SpringResourceWrapper.java +++ b/core/citrus-spring/src/main/java/org/citrusframework/spi/SpringResourceWrapper.java @@ -56,22 +56,22 @@ public URI getURI() { @Override public File getFile() { - return delegate.getFile(); + return delegate.file(); } @Override public long contentLength() throws IOException { try { - return delegate.getFile().length(); + return delegate.file().length(); } catch (Exception e) { - return Files.size(new File(delegate.getLocation()).toPath()); + return Files.size(new File(delegate.location()).toPath()); } } @Override public long lastModified() { try { - return delegate.getFile().lastModified(); + return delegate.file().lastModified(); } catch (Exception e) { return 0; } @@ -84,7 +84,7 @@ public org.springframework.core.io.Resource createRelative(String relativePath) @Override public String getFilename() { - return FileUtils.getFileName(delegate.getLocation()); + return FileUtils.getFileName(delegate.location()); } @Override diff --git a/core/citrus-spring/src/main/java/org/citrusframework/variable/GlobalVariablesPropertyLoader.java b/core/citrus-spring/src/main/java/org/citrusframework/variable/GlobalVariablesPropertyLoader.java index c8f9e294e2..0113faff5f 100644 --- a/core/citrus-spring/src/main/java/org/citrusframework/variable/GlobalVariablesPropertyLoader.java +++ b/core/citrus-spring/src/main/java/org/citrusframework/variable/GlobalVariablesPropertyLoader.java @@ -67,9 +67,9 @@ public void afterPropertiesSet() { Resource propertyFile = Resources.create(propertyFilePath.trim()); if (!propertyFile.exists()) { throw new CitrusRuntimeException(String.format("Error while loading property file %s - does not exist", - propertyFile.getLocation())); + propertyFile.location())); } - logger.debug("Reading property file {}", propertyFile.getLocation()); + logger.debug("Reading property file {}", propertyFile.location()); // Use input stream as this also allows to read from resources in a JAR file reader = new BufferedReader(new InputStreamReader(propertyFile.getInputStream())); @@ -109,7 +109,7 @@ public void afterPropertiesSet() { context.setVariable(key, globalVariables.getVariables().get(key)); } - logger.info("Loaded property file {}", propertyFile.getLocation()); + logger.info("Loaded property file {}", propertyFile.location()); } } } catch (IOException e) { diff --git a/core/citrus-spring/src/test/java/org/citrusframework/spi/CitrusResourceWrapperTest.java b/core/citrus-spring/src/test/java/org/citrusframework/spi/CitrusResourceWrapperTest.java index d2330bbf0c..408557f79f 100644 --- a/core/citrus-spring/src/test/java/org/citrusframework/spi/CitrusResourceWrapperTest.java +++ b/core/citrus-spring/src/test/java/org/citrusframework/spi/CitrusResourceWrapperTest.java @@ -39,7 +39,7 @@ public void readUriFromClasspathResource() throws IOException { CitrusResourceWrapper fixture = new CitrusResourceWrapper(classPathResource); - assertTrue(fixture.getLocation().endsWith(resource), "Fixture location should resolve URI from classpath resource!"); + assertTrue(fixture.location().endsWith(resource), "Fixture location should resolve URI from classpath resource!"); verify(classPathResource).getURI(); } @@ -51,7 +51,7 @@ public void readFileFromOtherResources() throws IOException { CitrusResourceWrapper fixture = new CitrusResourceWrapper(classPathResource); - assertTrue(fixture.getLocation().endsWith(resource), "Fixture location should resolve URI from classpath resource!"); + assertTrue(fixture.location().endsWith(resource), "Fixture location should resolve URI from classpath resource!"); verify(classPathResource).getFile(); } } diff --git a/endpoints/citrus-camel/src/main/java/org/citrusframework/camel/actions/CamelCmdSendAction.java b/endpoints/citrus-camel/src/main/java/org/citrusframework/camel/actions/CamelCmdSendAction.java index 8cbffc6d40..4094fafaaa 100644 --- a/endpoints/citrus-camel/src/main/java/org/citrusframework/camel/actions/CamelCmdSendAction.java +++ b/endpoints/citrus-camel/src/main/java/org/citrusframework/camel/actions/CamelCmdSendAction.java @@ -108,7 +108,7 @@ public void doExecute(TestContext context) { commandArgs.add(StringUtils.quote(context.replaceDynamicContentInString(body), true)); } else if (bodyResource != null) { commandArgs.add("--body"); - commandArgs.add("file:" + bodyResource.getLocation()); + commandArgs.add("file:" + bodyResource.location()); } if (StringUtils.hasText(infra)) { diff --git a/endpoints/citrus-camel/src/main/java/org/citrusframework/camel/actions/CamelCustomizedRunIntegrationAction.java b/endpoints/citrus-camel/src/main/java/org/citrusframework/camel/actions/CamelCustomizedRunIntegrationAction.java index 3d238559ff..950faa0388 100644 --- a/endpoints/citrus-camel/src/main/java/org/citrusframework/camel/actions/CamelCustomizedRunIntegrationAction.java +++ b/endpoints/citrus-camel/src/main/java/org/citrusframework/camel/actions/CamelCustomizedRunIntegrationAction.java @@ -196,7 +196,7 @@ public Builder processName(String processNane) { @Override public Builder addResource(Resource resource) { - this.resourceFiles.add(resource.getFile().getAbsolutePath()); + this.resourceFiles.add(resource.file().getAbsolutePath()); return this; } diff --git a/endpoints/citrus-camel/src/main/java/org/citrusframework/camel/actions/CamelKubernetesDeleteIntegrationAction.java b/endpoints/citrus-camel/src/main/java/org/citrusframework/camel/actions/CamelKubernetesDeleteIntegrationAction.java index fa24de3850..8642161629 100644 --- a/endpoints/citrus-camel/src/main/java/org/citrusframework/camel/actions/CamelKubernetesDeleteIntegrationAction.java +++ b/endpoints/citrus-camel/src/main/java/org/citrusframework/camel/actions/CamelKubernetesDeleteIntegrationAction.java @@ -85,7 +85,7 @@ public void doExecute(TestContext context) { if (StringUtils.hasText(integrationName)) { name = context.replaceDynamicContentInString(integrationName); } else if (integrationResource != null) { - name = FileUtils.getBaseName(integrationResource.getFile().getName()); + name = FileUtils.getBaseName(integrationResource.file().getName()); } else { name = "route"; } @@ -106,7 +106,7 @@ public void doExecute(TestContext context) { } if (integrationResource != null) { - camelJBang().workingDir(integrationResource.getFile().toPath().toAbsolutePath().getParent()); + camelJBang().workingDir(integrationResource.file().toPath().toAbsolutePath().getParent()); } ProcessAndOutput pao = camelJBang().kubernetes().delete(name, commandArgs.toArray(String[]::new)); diff --git a/endpoints/citrus-camel/src/main/java/org/citrusframework/camel/actions/CamelKubernetesRunIntegrationAction.java b/endpoints/citrus-camel/src/main/java/org/citrusframework/camel/actions/CamelKubernetesRunIntegrationAction.java index a61a77d63d..844d28b798 100644 --- a/endpoints/citrus-camel/src/main/java/org/citrusframework/camel/actions/CamelKubernetesRunIntegrationAction.java +++ b/endpoints/citrus-camel/src/main/java/org/citrusframework/camel/actions/CamelKubernetesRunIntegrationAction.java @@ -137,7 +137,7 @@ public void doExecute(TestContext context) { if (StringUtils.hasText(integrationName)) { name = context.replaceDynamicContentInString(integrationName); } else if (integrationResource != null) { - name = FileUtils.getBaseName(integrationResource.getFile().getName()); + name = FileUtils.getBaseName(integrationResource.file().getName()); } else { name = "route"; } @@ -152,7 +152,7 @@ public void doExecute(TestContext context) { StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING); } else if (integrationResource != null) { - integrationToRun = integrationResource.getFile().toPath(); + integrationToRun = integrationResource.file().toPath(); } else { throw new CitrusRuntimeException("Missing Camel integration source code or file"); } @@ -320,7 +320,7 @@ public Builder integration(String sourceCode) { public Builder integration(Resource resource) { this.integrationResource = resource; if (integrationName == null) { - this.integrationName = FileUtils.getBaseName(FileUtils.getFileName(resource.getLocation())); + this.integrationName = FileUtils.getBaseName(FileUtils.getFileName(resource.location())); } return this; } diff --git a/endpoints/citrus-camel/src/main/java/org/citrusframework/camel/actions/CamelKubernetesVerifyIntegrationAction.java b/endpoints/citrus-camel/src/main/java/org/citrusframework/camel/actions/CamelKubernetesVerifyIntegrationAction.java index 9329cae109..49438e5d51 100644 --- a/endpoints/citrus-camel/src/main/java/org/citrusframework/camel/actions/CamelKubernetesVerifyIntegrationAction.java +++ b/endpoints/citrus-camel/src/main/java/org/citrusframework/camel/actions/CamelKubernetesVerifyIntegrationAction.java @@ -149,7 +149,7 @@ public static final class Builder extends AbstractCamelJBangAction.Builder features, List testSources) if (sourceDir instanceof Resources.ClasspathResource) { try { addToFeatures(features, new ClasspathResourceResolver() - .getResources(sourceDir.getLocation()) + .getResources(sourceDir.location()) .stream() .map(Path::toString) .map(TestSourceHelper::create) .collect(Collectors.toList())); } catch (IOException e) { - throw new CitrusRuntimeException("Failed to resolve files from resource directory '%s'".formatted(sourceDir.getLocation()), e); + throw new CitrusRuntimeException("Failed to resolve files from resource directory '%s'".formatted(sourceDir.location()), e); } } else { - addToFeatures(features, Optional.ofNullable(sourceDir.getFile().list()) + addToFeatures(features, Optional.ofNullable(sourceDir.file().list()) .stream() .flatMap(Arrays::stream) .map(file -> directory.getFilePath() + File.separator + file) @@ -174,14 +173,16 @@ private void addToFeatures(List features, List testSources) /** * Cucumber options reading values from annotation in a generic way using method invocation via reflection. */ - private static class GenericCucumberOptions implements CucumberOptionsAnnotationParser.CucumberOptions { - private final Annotation options; - - public GenericCucumberOptions(Class clazz) { - options = Arrays.stream(clazz.getAnnotations()) - .filter(annotation -> annotation.annotationType().getSimpleName().equals("CucumberOptions")) - .findFirst() - .orElseThrow(() -> new CitrusRuntimeException("Missing CucumberOptions annotation on test class: " + clazz.getName())); + private record GenericCucumberOptions( + Annotation options) implements CucumberOptionsAnnotationParser.CucumberOptions { + + private GenericCucumberOptions(Class options) { + this( + Arrays.stream(options.getAnnotations()) + .filter(annotation -> annotation.annotationType().getSimpleName().equals("CucumberOptions")) + .findFirst() + .orElseThrow(() -> new CitrusRuntimeException("Missing CucumberOptions annotation on test class: " + options.getName())) + ); } T getOptionValue(String optionName) { diff --git a/runtime/citrus-cucumber/src/main/java/org/citrusframework/cucumber/backend/spring/CitrusSpringBackend.java b/runtime/citrus-cucumber/src/main/java/org/citrusframework/cucumber/backend/spring/CitrusSpringBackend.java index 8d290c2aef..1ce3ea3e66 100644 --- a/runtime/citrus-cucumber/src/main/java/org/citrusframework/cucumber/backend/spring/CitrusSpringBackend.java +++ b/runtime/citrus-cucumber/src/main/java/org/citrusframework/cucumber/backend/spring/CitrusSpringBackend.java @@ -38,16 +38,10 @@ public class CitrusSpringBackend extends CitrusBackend { - /** - * Logger - */ private static final Logger logger = LoggerFactory.getLogger(CitrusSpringBackend.class); /** * Constructor using resource loader. - * - * @param lookup - * @param container */ public CitrusSpringBackend(Lookup lookup, Container container) { super(lookup, container); @@ -68,23 +62,13 @@ public void loadGlue(Glue glue, List gluePaths) { * Initialization hook performs before suite actions and XML step initialization. Called as soon as citrus instance is requested * from outside for the first time. Performs only once. */ - private static class XmlStepInstanceProcessor implements CitrusInstanceProcessor { - - private final Glue glue; - private final List gluePaths; - private final Lookup lookup; - - XmlStepInstanceProcessor(Glue glue, List gluePaths, Lookup lookup) { - this.glue = glue; - this.gluePaths = gluePaths; - this.lookup = lookup; - } + private record XmlStepInstanceProcessor(Glue glue, List gluePaths, + Lookup lookup) implements CitrusInstanceProcessor { @Override public void process(Citrus instance) { for (URI gluePath : gluePaths) { String xmlStepConfigLocation = "classpath*:" + ClasspathSupport.resourceNameOfPackageName(ClasspathSupport.packageName(gluePath)) + "/**/*Steps.xml"; - logger.info("Loading XML step definitions {}", xmlStepConfigLocation); ApplicationContext ctx; @@ -98,7 +82,7 @@ public void process(Citrus instance) { for (StepTemplate stepTemplate : xmlSteps.values()) { if (logger.isDebugEnabled()) { - logger.debug("Found XML step definition: {} {}", stepTemplate.getName(), stepTemplate.getPattern().pattern()); + logger.info("Loading XML step definitions {}", xmlStepConfigLocation); } glue.addStepDefinition(new XmlStepDefinition(stepTemplate, lookup)); } diff --git a/runtime/citrus-groovy/src/main/java/org/citrusframework/groovy/GroovyTestLoader.java b/runtime/citrus-groovy/src/main/java/org/citrusframework/groovy/GroovyTestLoader.java index 7b0319afe3..9274f79355 100644 --- a/runtime/citrus-groovy/src/main/java/org/citrusframework/groovy/GroovyTestLoader.java +++ b/runtime/citrus-groovy/src/main/java/org/citrusframework/groovy/GroovyTestLoader.java @@ -40,9 +40,9 @@ protected void doLoad() { String basePath; if (scriptSource instanceof Resources.ClasspathResource) { - basePath = FileUtils.getBasePath(scriptSource.getLocation()); + basePath = FileUtils.getBasePath(scriptSource.location()); } else { - basePath = scriptSource.getFile().getParent(); + basePath = scriptSource.file().getParent(); } String source = FileUtils.readToString(scriptSource); diff --git a/runtime/citrus-junit-jupiter/src/main/java/org/citrusframework/junit/jupiter/CitrusExtension.java b/runtime/citrus-junit-jupiter/src/main/java/org/citrusframework/junit/jupiter/CitrusExtension.java index 23965f4de0..fe55dcc2d5 100644 --- a/runtime/citrus-junit-jupiter/src/main/java/org/citrusframework/junit/jupiter/CitrusExtension.java +++ b/runtime/citrus-junit-jupiter/src/main/java/org/citrusframework/junit/jupiter/CitrusExtension.java @@ -274,23 +274,14 @@ default void after(CitrusContext context) { } } - private static class AfterSuiteCallback implements ExtensionContext.Store.CloseableResource, AutoCloseable { - - private final ExtensionContext extensionContext; - private final String suiteName; - private final String[] tags; - - public AfterSuiteCallback(ExtensionContext extensionContext, String suiteName, String... tags) { - this.extensionContext = extensionContext; - this.suiteName = suiteName; - this.tags = tags; - } + private record AfterSuiteCallback(ExtensionContext extensionContext, String suiteName, + String... tags) implements ExtensionContext.Store.CloseableResource, AutoCloseable { @Override - public void close() { - if (afterSuite.getAndSet(false)) { - getCitrus(extensionContext).afterSuite(suiteName, tags); + public void close() { + if (afterSuite.getAndSet(false)) { + getCitrus(extensionContext).afterSuite(suiteName, tags); + } } } - } } diff --git a/runtime/citrus-junit-jupiter/src/main/java/org/citrusframework/junit/jupiter/CitrusExtensionHelper.java b/runtime/citrus-junit-jupiter/src/main/java/org/citrusframework/junit/jupiter/CitrusExtensionHelper.java index b0d7c2caa0..3a2b118379 100644 --- a/runtime/citrus-junit-jupiter/src/main/java/org/citrusframework/junit/jupiter/CitrusExtensionHelper.java +++ b/runtime/citrus-junit-jupiter/src/main/java/org/citrusframework/junit/jupiter/CitrusExtensionHelper.java @@ -271,7 +271,7 @@ private static void configure(TestLoader testLoader, ExtensionContext extensionC source = sources[0]; Resource file = FileUtils.getFileResource(source); - testName = FileUtils.getBaseName(FileUtils.getFileName(file.getLocation())); + testName = FileUtils.getBaseName(FileUtils.getFileName(file.location())); packageName = source; if (packageName.startsWith(Resources.CLASSPATH_RESOURCE_PREFIX)) { diff --git a/runtime/citrus-junit-jupiter/src/main/java/org/citrusframework/junit/jupiter/JUnitJupiterEngine.java b/runtime/citrus-junit-jupiter/src/main/java/org/citrusframework/junit/jupiter/JUnitJupiterEngine.java index 79d3005feb..c6fd5da2f6 100644 --- a/runtime/citrus-junit-jupiter/src/main/java/org/citrusframework/junit/jupiter/JUnitJupiterEngine.java +++ b/runtime/citrus-junit-jupiter/src/main/java/org/citrusframework/junit/jupiter/JUnitJupiterEngine.java @@ -144,16 +144,16 @@ private void addTestSources(LauncherDiscoveryRequestBuilder requestBuilder, List if (sourceDir instanceof Resources.ClasspathResource) { try { addTestSources(requestBuilder, new ClasspathResourceResolver() - .getResources(sourceDir.getLocation()) + .getResources(sourceDir.location()) .stream() .map(Path::toString) .map(TestSourceHelper::create) .collect(Collectors.toList())); } catch (IOException e) { - throw new CitrusRuntimeException("Failed to resolve files from resource directory '%s'".formatted(sourceDir.getLocation()), e); + throw new CitrusRuntimeException("Failed to resolve files from resource directory '%s'".formatted(sourceDir.location()), e); } } else { - addTestSources(requestBuilder, Optional.ofNullable(sourceDir.getFile().list()) + addTestSources(requestBuilder, Optional.ofNullable(sourceDir.file().list()) .stream() .flatMap(Arrays::stream) .map(file -> directory.getFilePath() + File.separator + file) diff --git a/runtime/citrus-junit-jupiter/src/test/java/org/citrusframework/junit/jupiter/integration/ApplyTestBehaviorIT.java b/runtime/citrus-junit-jupiter/src/test/java/org/citrusframework/junit/jupiter/integration/ApplyTestBehaviorIT.java index 504df13086..17a8da68cd 100644 --- a/runtime/citrus-junit-jupiter/src/test/java/org/citrusframework/junit/jupiter/integration/ApplyTestBehaviorIT.java +++ b/runtime/citrus-junit-jupiter/src/test/java/org/citrusframework/junit/jupiter/integration/ApplyTestBehaviorIT.java @@ -48,21 +48,15 @@ public void shouldApplyInContainer(@CitrusResource TestActionRunner runner) { )); } - private static class SayHelloBehavior implements TestBehavior, TestActionSupport { - private final String greeting; - - public SayHelloBehavior() { - this("Hello"); - } - - public SayHelloBehavior(String greeting) { - this.greeting = greeting; - } + private record SayHelloBehavior(String greeting) implements TestBehavior, TestActionSupport { + public SayHelloBehavior() { + this("Hello"); + } @Override - public void apply(TestActionRunner runner) { - runner.run(echo(String.format("%s Citrus!", greeting))); + public void apply(TestActionRunner runner) { + runner.run(echo(String.format("%s Citrus!", greeting))); + } } - } } diff --git a/runtime/citrus-junit/src/main/java/org/citrusframework/junit/JUnit4Helper.java b/runtime/citrus-junit/src/main/java/org/citrusframework/junit/JUnit4Helper.java index 734eca4fe0..d5d9479960 100644 --- a/runtime/citrus-junit/src/main/java/org/citrusframework/junit/JUnit4Helper.java +++ b/runtime/citrus-junit/src/main/java/org/citrusframework/junit/JUnit4Helper.java @@ -114,8 +114,8 @@ public static List findInterceptedMethods(FrameworkMethod metho sourceFilePackageName = sourceFilePackageName.substring(0, sourceFilePackageName.lastIndexOf("/")); } - String testName = FileUtils.getBaseName(FileUtils.getFileName(file.getLocation())); - String ext = FileUtils.getFileExtension(file.getLocation()); + String testName = FileUtils.getBaseName(FileUtils.getFileName(file.location())); + String ext = FileUtils.getFileExtension(file.location()); CitrusFrameworkMethod frameworkMethod = new CitrusFrameworkMethod(method.getMethod(), type, testName, sourceFilePackageName.replace("/",".")); frameworkMethod.setSource(new TestSource(ext, testName, source)); diff --git a/runtime/citrus-junit/src/main/java/org/citrusframework/junit/spring/TestSuiteExecutionListener.java b/runtime/citrus-junit/src/main/java/org/citrusframework/junit/spring/TestSuiteExecutionListener.java index d65bcc882d..faf6773513 100644 --- a/runtime/citrus-junit/src/main/java/org/citrusframework/junit/spring/TestSuiteExecutionListener.java +++ b/runtime/citrus-junit/src/main/java/org/citrusframework/junit/spring/TestSuiteExecutionListener.java @@ -50,21 +50,19 @@ public void prepareTestInstance(TestContext testContext) { * Shutdown hook runnable gets executed during JVM shutdown. * This is our only chance to provide after suite logic when using JUnit. After * all tests are executed this after suite logic get executed before processing ends. + * + * @param citrus Citrus instance */ - private static class AfterSuiteShutdownHook implements Runnable { - /** Citrus instance */ - private final Citrus citrus; - + private record AfterSuiteShutdownHook(Citrus citrus) implements Runnable { /** * Default constructor using citrus instance. */ - public AfterSuiteShutdownHook(Citrus citrus) { - this.citrus = citrus; + private AfterSuiteShutdownHook { } - @Override - public void run() { - citrus.afterSuite(SUITE_NAME); + @Override + public void run() { + citrus.afterSuite(SUITE_NAME); + } } - } } diff --git a/runtime/citrus-junit/src/test/java/org/citrusframework/junit/integration/ApplyTestBehaviorIT.java b/runtime/citrus-junit/src/test/java/org/citrusframework/junit/integration/ApplyTestBehaviorIT.java index c9ea9eab63..41786e0f6c 100644 --- a/runtime/citrus-junit/src/test/java/org/citrusframework/junit/integration/ApplyTestBehaviorIT.java +++ b/runtime/citrus-junit/src/test/java/org/citrusframework/junit/integration/ApplyTestBehaviorIT.java @@ -45,21 +45,15 @@ public void shouldApplyInContainer() { )); } - private static class SayHelloBehavior implements TestBehavior, TestActionSupport { - private final String greeting; - - public SayHelloBehavior() { - this("Hello"); - } - - public SayHelloBehavior(String greeting) { - this.greeting = greeting; - } + private record SayHelloBehavior(String greeting) implements TestBehavior, TestActionSupport { + public SayHelloBehavior() { + this("Hello"); + } @Override - public void apply(TestActionRunner runner) { - runner.run(echo(String.format("%s Citrus!", greeting))); + public void apply(TestActionRunner runner) { + runner.run(echo(String.format("%s Citrus!", greeting))); + } } - } } diff --git a/runtime/citrus-testng/src/main/java/org/citrusframework/testng/TestNGEngine.java b/runtime/citrus-testng/src/main/java/org/citrusframework/testng/TestNGEngine.java index 71bc22a9c9..6d65c57e96 100644 --- a/runtime/citrus-testng/src/main/java/org/citrusframework/testng/TestNGEngine.java +++ b/runtime/citrus-testng/src/main/java/org/citrusframework/testng/TestNGEngine.java @@ -118,16 +118,16 @@ private void addTestSources(XmlSuite suite, List testSources) { if (sourceDir instanceof Resources.ClasspathResource) { try { addTestSources(suite, new ClasspathResourceResolver() - .getResources(sourceDir.getLocation()) + .getResources(sourceDir.location()) .stream() .map(Path::toString) .map(TestSourceHelper::create) .collect(Collectors.toList())); } catch (IOException e) { - throw new CitrusRuntimeException("Failed to resolve files from resource directory '%s'".formatted(sourceDir.getLocation()), e); + throw new CitrusRuntimeException("Failed to resolve files from resource directory '%s'".formatted(sourceDir.location()), e); } } else { - addTestSources(suite, Optional.ofNullable(sourceDir.getFile().list()) + addTestSources(suite, Optional.ofNullable(sourceDir.file().list()) .stream() .flatMap(Arrays::stream) .map(file -> directory.getFilePath() + File.separator + file) @@ -152,7 +152,7 @@ private void addTestSources(XmlSuite suite, List testSources) { if (StringUtils.hasText(source.getFilePath())) { parameters.put(TestNGCitrusTest.TEST_SOURCE_FILE_PARAM, source.getFilePath()); } else if (source.getSourceFile() != null) { - parameters.put(TestNGCitrusTest.TEST_SOURCE_FILE_PARAM, source.getSourceFile().getLocation()); + parameters.put(TestNGCitrusTest.TEST_SOURCE_FILE_PARAM, source.getSourceFile().location()); } else { parameters.put(TestNGCitrusTest.TEST_SOURCE_FILE_PARAM, ""); } diff --git a/runtime/citrus-testng/src/main/java/org/citrusframework/testng/TestNGHelper.java b/runtime/citrus-testng/src/main/java/org/citrusframework/testng/TestNGHelper.java index f2abf9a165..1ca99cf6b7 100644 --- a/runtime/citrus-testng/src/main/java/org/citrusframework/testng/TestNGHelper.java +++ b/runtime/citrus-testng/src/main/java/org/citrusframework/testng/TestNGHelper.java @@ -200,7 +200,7 @@ private static List createMethodTestLoaders(Method method, sourceFilePackageName = sourceFilePackageName.substring(0, sourceFilePackageName.lastIndexOf("/")); } - TestLoader testLoader = provider.createTestLoader(FileUtils.getBaseName(FileUtils.getFileName(file.getLocation())), + TestLoader testLoader = provider.createTestLoader(FileUtils.getBaseName(FileUtils.getFileName(file.location())), sourceFilePackageName.replace("/","."), type); if (testLoader instanceof TestSourceAware) { diff --git a/runtime/citrus-testng/src/test/java/org/citrusframework/integration/actions/ApplyTestBehaviorIT.java b/runtime/citrus-testng/src/test/java/org/citrusframework/integration/actions/ApplyTestBehaviorIT.java index 306e257c3c..058ffcb5ba 100644 --- a/runtime/citrus-testng/src/test/java/org/citrusframework/integration/actions/ApplyTestBehaviorIT.java +++ b/runtime/citrus-testng/src/test/java/org/citrusframework/integration/actions/ApplyTestBehaviorIT.java @@ -144,44 +144,32 @@ public void shouldApplyRecursive() { )); } - private static class SayHelloBehavior implements TestBehavior, TestActionSupport { - private final String greeting; - - public SayHelloBehavior() { - this("Hello"); - } - - public SayHelloBehavior(String greeting) { - this.greeting = greeting; - } + private record SayHelloBehavior(String greeting) implements TestBehavior, TestActionSupport { + public SayHelloBehavior() { + this("Hello"); + } @Override - public void apply(TestActionRunner runner) { - runner.run(echo(String.format("%s Citrus!", greeting))); - } - } - - private static class InceptionBehavior implements TestBehavior, TestActionSupport { - private final String greeting; - - public InceptionBehavior() { - this("Hello"); + public void apply(TestActionRunner runner) { + runner.run(echo(String.format("%s Citrus!", greeting))); + } } - public InceptionBehavior(String greeting) { - this.greeting = greeting; - } + private record InceptionBehavior(String greeting) implements TestBehavior, TestActionSupport { + public InceptionBehavior() { + this("Hello"); + } @Override - public void apply(TestActionRunner runner) { - runner.applyBehavior(new SayHelloBehavior(greeting)); - - runner.run(sequential() - .actions( - echo("Now try inception:"), - runner.applyBehavior(new SayHelloBehavior(greeting)) - )); + public void apply(TestActionRunner runner) { + runner.applyBehavior(new SayHelloBehavior(greeting)); + + runner.run(sequential() + .actions( + echo("Now try inception:"), + runner.applyBehavior(new SayHelloBehavior(greeting)) + )); + } } - } } diff --git a/runtime/citrus-testng/src/test/java/org/citrusframework/integration/container/WaitJavaIT.java b/runtime/citrus-testng/src/test/java/org/citrusframework/integration/container/WaitJavaIT.java index feb9567ab8..5ca375dd50 100644 --- a/runtime/citrus-testng/src/test/java/org/citrusframework/integration/container/WaitJavaIT.java +++ b/runtime/citrus-testng/src/test/java/org/citrusframework/integration/container/WaitJavaIT.java @@ -90,7 +90,7 @@ public void waitMessage() { public void waitFile() { run(waitFor() .file() - .resource(Resources.fromClasspath("citrus.properties").getFile())); + .resource(Resources.fromClasspath("citrus.properties").file())); } @CitrusTest diff --git a/test-api-generator/citrus-test-api-core/src/main/java/org/citrusframework/openapi/testapi/OpenApiParameterFormatter.java b/test-api-generator/citrus-test-api-core/src/main/java/org/citrusframework/openapi/testapi/OpenApiParameterFormatter.java index 0e4245ac6e..b3a6742446 100644 --- a/test-api-generator/citrus-test-api-core/src/main/java/org/citrusframework/openapi/testapi/OpenApiParameterFormatter.java +++ b/test-api-generator/citrus-test-api-core/src/main/java/org/citrusframework/openapi/testapi/OpenApiParameterFormatter.java @@ -275,31 +275,25 @@ private static FormatParameters labelFormatParameters(boolean explode) { } } - private static class SimpleEncoder implements StyleEncoder { - - private final FormatParameters formatParameters; - - private SimpleEncoder(FormatParameters formatParameters) { - this.formatParameters = formatParameters; - } + private record SimpleEncoder(FormatParameters formatParameters) implements StyleEncoder { @Override - public String encodeAccordingToSpec(String parameterName, Object parameterValue, - boolean explode, boolean isObject) { - List values = toList(parameterValue, isObject); - String prefix = formatParameters.prefix.replace(PARAMETER_NAME_TOKEN, parameterName); + public String encodeAccordingToSpec(String parameterName, Object parameterValue, + boolean explode, boolean isObject) { + List values = toList(parameterValue, isObject); + String prefix = formatParameters.prefix.replace(PARAMETER_NAME_TOKEN, parameterName); + + String encoded; + if (isObject && explode) { + encoded = prefix + formatExploded(values, formatParameters.separator); + } else { + encoded = prefix + values.stream() + .collect(joining(formatParameters.separator)); + } - String encoded; - if (isObject && explode) { - encoded = prefix + formatExploded(values, formatParameters.separator); - } else { - encoded = prefix + values.stream() - .collect(joining(formatParameters.separator)); + return encoded; } - - return encoded; } - } private static class FormEncoder implements StyleEncoder { diff --git a/test-api-generator/citrus-test-api-core/src/main/java/org/citrusframework/openapi/testapi/RestApiSendMessageActionBuilder.java b/test-api-generator/citrus-test-api-core/src/main/java/org/citrusframework/openapi/testapi/RestApiSendMessageActionBuilder.java index 46fe9bb657..aaa7467943 100644 --- a/test-api-generator/citrus-test-api-core/src/main/java/org/citrusframework/openapi/testapi/RestApiSendMessageActionBuilder.java +++ b/test-api-generator/citrus-test-api-core/src/main/java/org/citrusframework/openapi/testapi/RestApiSendMessageActionBuilder.java @@ -226,7 +226,7 @@ protected Object toBinary(Object object) { if (object instanceof byte[] bytes) { return bytes; } else if (object instanceof Resource resource) { - return new ClasspathResource(resource.getLocation()); + return new ClasspathResource(resource.location()); } else if (object instanceof org.springframework.core.io.Resource resource) { return resource; } else if (object instanceof String location) { diff --git a/tools/cucumber-steps/citrus-cucumber-camel/src/main/java/org/citrusframework/cucumber/steps/camel/CamelSteps.java b/tools/cucumber-steps/citrus-cucumber-camel/src/main/java/org/citrusframework/cucumber/steps/camel/CamelSteps.java index 4078d2f809..9707da2034 100644 --- a/tools/cucumber-steps/citrus-cucumber-camel/src/main/java/org/citrusframework/cucumber/steps/camel/CamelSteps.java +++ b/tools/cucumber-steps/citrus-cucumber-camel/src/main/java/org/citrusframework/cucumber/steps/camel/CamelSteps.java @@ -172,7 +172,7 @@ public void bindComponent(String name, String configurationScript) { public void loadComponent(String filePath) throws IOException { Resource scriptFile = ResourceUtils.resolve(filePath + ".groovy", context); String script = FileUtils.readToString(scriptFile); - final String fileName = FileUtils.getFileName(scriptFile.getLocation()); + final String fileName = FileUtils.getFileName(scriptFile.location()); final String baseName = Optional.ofNullable(fileName) .map(f -> f.lastIndexOf(".")) .filter(index -> index >= 0) diff --git a/tools/cucumber-steps/citrus-cucumber-groovy/src/main/java/org/citrusframework/cucumber/steps/groovy/GroovyScriptSteps.java b/tools/cucumber-steps/citrus-cucumber-groovy/src/main/java/org/citrusframework/cucumber/steps/groovy/GroovyScriptSteps.java index 24e3149d2a..3b06432415 100644 --- a/tools/cucumber-steps/citrus-cucumber-groovy/src/main/java/org/citrusframework/cucumber/steps/groovy/GroovyScriptSteps.java +++ b/tools/cucumber-steps/citrus-cucumber-groovy/src/main/java/org/citrusframework/cucumber/steps/groovy/GroovyScriptSteps.java @@ -88,7 +88,7 @@ protected void onCreate(Endpoint endpoint) { public void loadEndpoint(String filePath) throws IOException { Resource scriptFile = ResourceUtils.resolve(filePath + ".groovy", context); String script = FileUtils.readToString(scriptFile); - final String fileName = FileUtils.getFileName(scriptFile.getLocation()); + final String fileName = FileUtils.getFileName(scriptFile.location()); final String baseName = Optional.of(fileName) .map(f -> f.lastIndexOf(".")) .filter(index -> index >= 0) @@ -113,7 +113,7 @@ public void createComponent(String name, String configurationScript) { public void loadComponent(String filePath) throws IOException { Resource scriptFile = ResourceUtils.resolve(filePath + ".groovy", context); String script = FileUtils.readToString(scriptFile); - final String fileName = FileUtils.getFileName(scriptFile.getLocation()); + final String fileName = FileUtils.getFileName(scriptFile.location()); final String baseName = Optional.ofNullable(fileName) .map(f -> f.lastIndexOf(".")) .filter(index -> index >= 0) @@ -131,7 +131,7 @@ public void createActionScript(String scriptName, String code) { public void loadActionScript(String filePath) throws IOException { Resource scriptFile = ResourceUtils.resolve(filePath + ".groovy", context); String script = FileUtils.readToString(scriptFile); - final String fileName = FileUtils.getFileName(scriptFile.getLocation()); + final String fileName = FileUtils.getFileName(scriptFile.location()); final String baseName = Optional.ofNullable(fileName) .map(f -> f.lastIndexOf(".")) .filter(index -> index >= 0) diff --git a/tools/cucumber-steps/citrus-cucumber-http/src/main/java/org/citrusframework/cucumber/steps/http/HttpServerSteps.java b/tools/cucumber-steps/citrus-cucumber-http/src/main/java/org/citrusframework/cucumber/steps/http/HttpServerSteps.java index 57476c24ec..76b331a2db 100644 --- a/tools/cucumber-steps/citrus-cucumber-http/src/main/java/org/citrusframework/cucumber/steps/http/HttpServerSteps.java +++ b/tools/cucumber-steps/citrus-cucumber-http/src/main/java/org/citrusframework/cucumber/steps/http/HttpServerSteps.java @@ -582,7 +582,7 @@ private String getKeyStorePathPath() throws IOException { return tmpKeyStore.getPath(); } } else { - return ResourceUtils.resolve(sslKeyStorePath, context).getLocation(); + return ResourceUtils.resolve(sslKeyStorePath, context).location(); } } diff --git a/tools/jbang/src/main/java/org/citrusframework/jbang/commands/AgentRun.java b/tools/jbang/src/main/java/org/citrusframework/jbang/commands/AgentRun.java index 833e812921..67ce548525 100644 --- a/tools/jbang/src/main/java/org/citrusframework/jbang/commands/AgentRun.java +++ b/tools/jbang/src/main/java/org/citrusframework/jbang/commands/AgentRun.java @@ -390,7 +390,7 @@ private TestRunConfiguration fromCliOptions(TestRunConfiguration configuration) } if (StringUtils.hasText(testJar)) { - configuration.setTestJar(Resources.create(testJar).getFile()); + configuration.setTestJar(Resources.create(testJar).file()); } if (includes != null) { diff --git a/tools/jbang/src/main/java/org/citrusframework/jbang/commands/AgentStart.java b/tools/jbang/src/main/java/org/citrusframework/jbang/commands/AgentStart.java index af070ce1ca..fa55b8360d 100644 --- a/tools/jbang/src/main/java/org/citrusframework/jbang/commands/AgentStart.java +++ b/tools/jbang/src/main/java/org/citrusframework/jbang/commands/AgentStart.java @@ -154,7 +154,7 @@ private CitrusAgentConfiguration fromCliOptions(CitrusAgentConfiguration configu } if (StringUtils.hasText(testJar)) { - configuration.setTestJar(Resources.create(testJar).getFile()); + configuration.setTestJar(Resources.create(testJar).file()); } if (StringUtils.hasText(configClass)) { diff --git a/tools/jbang/src/main/java/org/citrusframework/jbang/commands/Run.java b/tools/jbang/src/main/java/org/citrusframework/jbang/commands/Run.java index d6cbfb824d..4f827670b5 100644 --- a/tools/jbang/src/main/java/org/citrusframework/jbang/commands/Run.java +++ b/tools/jbang/src/main/java/org/citrusframework/jbang/commands/Run.java @@ -310,7 +310,7 @@ private void resolveTests(String[] files, List tests) throws Exception { continue; } - File inputFile = FileUtils.getFileResource(file).getFile(); + File inputFile = FileUtils.getFileResource(file).file(); if (!inputFile.isFile()) { continue; } diff --git a/tools/jbang/src/main/java/org/citrusframework/jbang/util/CodeAnalyzer.java b/tools/jbang/src/main/java/org/citrusframework/jbang/util/CodeAnalyzer.java index 4788a405cb..a5dc47eb41 100644 --- a/tools/jbang/src/main/java/org/citrusframework/jbang/util/CodeAnalyzer.java +++ b/tools/jbang/src/main/java/org/citrusframework/jbang/util/CodeAnalyzer.java @@ -39,7 +39,7 @@ public interface CodeAnalyzer { * Inspects the given source code and provides detailed information about it as a result. */ default ScanResult scan(Resource sourceFile) throws IOException { - return scan(FileUtils.getFileName(sourceFile.getLocation()), FileUtils.readToString(sourceFile)); + return scan(FileUtils.getFileName(sourceFile.location()), FileUtils.readToString(sourceFile)); } /** diff --git a/tools/restdocs/src/main/java/org/citrusframework/restdocs/http/RestDocClientInterceptor.java b/tools/restdocs/src/main/java/org/citrusframework/restdocs/http/RestDocClientInterceptor.java index 2a1d741de0..dde91389b0 100644 --- a/tools/restdocs/src/main/java/org/citrusframework/restdocs/http/RestDocClientInterceptor.java +++ b/tools/restdocs/src/main/java/org/citrusframework/restdocs/http/RestDocClientInterceptor.java @@ -33,16 +33,15 @@ * * @since 2.6 */ -public class RestDocClientInterceptor implements ClientHttpRequestInterceptor { - - private final RestDocumentationGenerator documentationGenerator; +public record RestDocClientInterceptor( + RestDocumentationGenerator documentationGenerator) implements ClientHttpRequestInterceptor { /** * Default constructor with documentation generator. + * * @param documentationGenerator */ - public RestDocClientInterceptor(RestDocumentationGenerator documentationGenerator) { - this.documentationGenerator = documentationGenerator; + public RestDocClientInterceptor { } @Override @@ -79,7 +78,8 @@ public RestDocClientInterceptor snippets(Snippet... snippets) { * * @return the documentationGenerator */ - public RestDocumentationGenerator getDocumentationGenerator() { + @Override + public RestDocumentationGenerator documentationGenerator() { return documentationGenerator; } } diff --git a/tools/restdocs/src/main/java/org/citrusframework/restdocs/soap/RestDocSoapClientInterceptor.java b/tools/restdocs/src/main/java/org/citrusframework/restdocs/soap/RestDocSoapClientInterceptor.java index 0d680d1eb8..cb3e2f10a8 100644 --- a/tools/restdocs/src/main/java/org/citrusframework/restdocs/soap/RestDocSoapClientInterceptor.java +++ b/tools/restdocs/src/main/java/org/citrusframework/restdocs/soap/RestDocSoapClientInterceptor.java @@ -30,13 +30,8 @@ /** * @since 2.6 */ -public class RestDocSoapClientInterceptor implements ClientInterceptor { - - private final RestDocumentationGenerator documentationGenerator; - - public RestDocSoapClientInterceptor(RestDocumentationGenerator documentationGenerator) { - this.documentationGenerator = documentationGenerator; - } +public record RestDocSoapClientInterceptor( + RestDocumentationGenerator documentationGenerator) implements ClientInterceptor { @Override public boolean handleRequest(MessageContext messageContext) throws WebServiceClientException { @@ -87,7 +82,8 @@ public RestDocSoapClientInterceptor snippets(Snippet... snippets) { * * @return the documentationGenerator */ - public RestDocumentationGenerator getDocumentationGenerator() { + @Override + public RestDocumentationGenerator documentationGenerator() { return documentationGenerator; } } diff --git a/tools/restdocs/src/test/java/org/citrusframework/restdocs/config/xml/RestDocClientInterceptorParserTest.java b/tools/restdocs/src/test/java/org/citrusframework/restdocs/config/xml/RestDocClientInterceptorParserTest.java index 12f7e7e435..66125a121c 100644 --- a/tools/restdocs/src/test/java/org/citrusframework/restdocs/config/xml/RestDocClientInterceptorParserTest.java +++ b/tools/restdocs/src/test/java/org/citrusframework/restdocs/config/xml/RestDocClientInterceptorParserTest.java @@ -36,13 +36,13 @@ public void testClientInterceptorParser() { // 1st interceptor RestDocClientInterceptor interceptor = interceptors.get("interceptor1"); - Assert.assertNotNull(interceptor.getDocumentationGenerator()); + Assert.assertNotNull(interceptor.documentationGenerator()); Map soapInterceptors = beanDefinitionContext.getBeansOfType(RestDocSoapClientInterceptor.class); Assert.assertEquals(soapInterceptors.size(), 1); // 2nd interceptor RestDocSoapClientInterceptor soapInterceptor = soapInterceptors.get("interceptor2"); - Assert.assertNotNull(soapInterceptor.getDocumentationGenerator()); + Assert.assertNotNull(soapInterceptor.documentationGenerator()); } } diff --git a/tools/restdocs/src/test/java/org/citrusframework/restdocs/config/xml/RestDocDocumentationParserTest.java b/tools/restdocs/src/test/java/org/citrusframework/restdocs/config/xml/RestDocDocumentationParserTest.java index dbded4ddee..2ddfb6808a 100644 --- a/tools/restdocs/src/test/java/org/citrusframework/restdocs/config/xml/RestDocDocumentationParserTest.java +++ b/tools/restdocs/src/test/java/org/citrusframework/restdocs/config/xml/RestDocDocumentationParserTest.java @@ -46,7 +46,7 @@ public void testConfigurerParser() { Assert.assertNotNull(configurer.getContextProvider()); // 1st interceptor RestDocClientInterceptor interceptor = interceptors.get("documentation1Interceptor"); - Assert.assertNotNull(interceptor.getDocumentationGenerator()); + Assert.assertNotNull(interceptor.documentationGenerator()); Map soapConfigurers = beanDefinitionContext.getBeansOfType(CitrusRestDocSoapConfigurer.class); Assert.assertEquals(soapConfigurers.size(), 1); @@ -58,7 +58,7 @@ public void testConfigurerParser() { Assert.assertNotNull(soapConfigurer.getContextProvider()); // 2nd interceptor RestDocSoapClientInterceptor soapInterceptor = soapInterceptors.get("documentation2Interceptor"); - Assert.assertNotNull(soapInterceptor.getDocumentationGenerator()); + Assert.assertNotNull(soapInterceptor.documentationGenerator()); List documentation1 = beanDefinitionContext.getBean("documentation1", List.class); Assert.assertEquals(documentation1.size(), 2L); diff --git a/tools/test-generator/src/main/java/org/citrusframework/generate/javadsl/WsdlJavaTestGenerator.java b/tools/test-generator/src/main/java/org/citrusframework/generate/javadsl/WsdlJavaTestGenerator.java index 598d5f75eb..aae8370222 100644 --- a/tools/test-generator/src/main/java/org/citrusframework/generate/javadsl/WsdlJavaTestGenerator.java +++ b/tools/test-generator/src/main/java/org/citrusframework/generate/javadsl/WsdlJavaTestGenerator.java @@ -169,11 +169,11 @@ protected Message generateOutboundMessage(Message message) { private XmlObject compileWsdl(String wsdl) { Resource wsdlFile = Resources.create(wsdl); if (!wsdlFile.exists()) { - throw new CitrusRuntimeException("Unable to read WSDL - does not exist in " + wsdlFile.getLocation()); + throw new CitrusRuntimeException("Unable to read WSDL - does not exist in " + wsdlFile.location()); } try { - return XmlObject.Factory.parse(wsdlFile.getFile(), (new XmlOptions()).setLoadLineNumbers().setLoadMessageDigest().setCompileDownloadUrls()); + return XmlObject.Factory.parse(wsdlFile.file(), (new XmlOptions()).setLoadLineNumbers().setLoadMessageDigest().setCompileDownloadUrls()); } catch (XmlException e) { for (Object error : e.getErrors()) { logger.error("{}{}", ((XmlError) error).getLine(), error.toString()); diff --git a/tools/test-generator/src/main/java/org/citrusframework/generate/javadsl/XsdJavaTestGenerator.java b/tools/test-generator/src/main/java/org/citrusframework/generate/javadsl/XsdJavaTestGenerator.java index 1956c709ba..db8c8d38ea 100644 --- a/tools/test-generator/src/main/java/org/citrusframework/generate/javadsl/XsdJavaTestGenerator.java +++ b/tools/test-generator/src/main/java/org/citrusframework/generate/javadsl/XsdJavaTestGenerator.java @@ -162,12 +162,12 @@ public String getTestNameSuggestion() { private SchemaTypeSystem compileXsd(String xsd) { Resource xsdFile = Resources.create(xsd); if (!xsdFile.exists()) { - throw new CitrusRuntimeException("Unable to read XSD - does not exist in " + xsdFile.getLocation()); + throw new CitrusRuntimeException("Unable to read XSD - does not exist in " + xsdFile.location()); } XmlObject xsdObject; try { - xsdObject = XmlObject.Factory.parse(xsdFile.getFile(), (new XmlOptions()).setLoadLineNumbers().setLoadMessageDigest().setCompileDownloadUrls()); + xsdObject = XmlObject.Factory.parse(xsdFile.file(), (new XmlOptions()).setLoadLineNumbers().setLoadMessageDigest().setCompileDownloadUrls()); } catch (Exception e) { throw new CitrusRuntimeException("Failed to parse XSD schema", e); } diff --git a/tools/test-generator/src/main/java/org/citrusframework/generate/xml/WsdlXmlTestGenerator.java b/tools/test-generator/src/main/java/org/citrusframework/generate/xml/WsdlXmlTestGenerator.java index c76c3b342d..ebc276f79b 100644 --- a/tools/test-generator/src/main/java/org/citrusframework/generate/xml/WsdlXmlTestGenerator.java +++ b/tools/test-generator/src/main/java/org/citrusframework/generate/xml/WsdlXmlTestGenerator.java @@ -185,7 +185,7 @@ protected Message generateOutboundMessage(Message message) { private XmlObject compileWsdl(String wsdl) { File wsdlFile; try { - wsdlFile = Resources.create(wsdl).getFile(); + wsdlFile = Resources.create(wsdl).file(); } catch (Exception e) { wsdlFile = new File(wsdl); } diff --git a/tools/test-generator/src/main/java/org/citrusframework/generate/xml/XmlTestMarshaller.java b/tools/test-generator/src/main/java/org/citrusframework/generate/xml/XmlTestMarshaller.java index f847bfc3d5..28abac84aa 100644 --- a/tools/test-generator/src/main/java/org/citrusframework/generate/xml/XmlTestMarshaller.java +++ b/tools/test-generator/src/main/java/org/citrusframework/generate/xml/XmlTestMarshaller.java @@ -118,7 +118,7 @@ private JAXBContext getOrCreateContext() throws JAXBException { private Schema loadSchema(Resource resource) { if (logger.isDebugEnabled()) { - logger.debug("Using marshaller validation schema '{}'", resource.getLocation()); + logger.debug("Using marshaller validation schema '{}'", resource.location()); } try { diff --git a/tools/test-generator/src/main/java/org/citrusframework/generate/xml/XsdXmlTestGenerator.java b/tools/test-generator/src/main/java/org/citrusframework/generate/xml/XsdXmlTestGenerator.java index c026aa6d4f..c47eb19fea 100644 --- a/tools/test-generator/src/main/java/org/citrusframework/generate/xml/XsdXmlTestGenerator.java +++ b/tools/test-generator/src/main/java/org/citrusframework/generate/xml/XsdXmlTestGenerator.java @@ -162,12 +162,12 @@ public String getTestNameSuggestion() { private SchemaTypeSystem compileXsd(String xsd) { Resource xsdFile = Resources.create(xsd); if (!xsdFile.exists()) { - throw new CitrusRuntimeException("Unable to read XSD - does not exist in " + xsdFile.getLocation()); + throw new CitrusRuntimeException("Unable to read XSD - does not exist in " + xsdFile.location()); } XmlObject xsdObject; try { - xsdObject = XmlObject.Factory.parse(xsdFile.getFile(), (new XmlOptions()).setLoadLineNumbers().setLoadMessageDigest().setCompileDownloadUrls()); + xsdObject = XmlObject.Factory.parse(xsdFile.file(), (new XmlOptions()).setLoadLineNumbers().setLoadMessageDigest().setCompileDownloadUrls()); } catch (Exception e) { throw new CitrusRuntimeException("Failed to parse XSD schema", e); } diff --git a/validation/citrus-validation-json/src/main/java/org/citrusframework/json/JsonSchemaRepository.java b/validation/citrus-validation-json/src/main/java/org/citrusframework/json/JsonSchemaRepository.java index b247f96440..613d3a916b 100644 --- a/validation/citrus-validation-json/src/main/java/org/citrusframework/json/JsonSchemaRepository.java +++ b/validation/citrus-validation-json/src/main/java/org/citrusframework/json/JsonSchemaRepository.java @@ -45,16 +45,16 @@ public JsonSchemaRepository() { @Override protected void addRepository(Resource resource) { - if (resource.getLocation().endsWith(".json")) { + if (resource.location().endsWith(".json")) { if (logger.isDebugEnabled()) { - logger.debug("Loading json schema resource '{}'", resource.getLocation()); + logger.debug("Loading json schema resource '{}'", resource.location()); } SimpleJsonSchema simpleJsonSchema = new SimpleJsonSchema(resource); simpleJsonSchema.initialize(); schemas.add(simpleJsonSchema); } else { - logger.warn("Skipped resource other than json schema for repository '{}'", resource.getLocation()); + logger.warn("Skipped resource other than json schema for repository '{}'", resource.location()); } } diff --git a/validation/citrus-validation-json/src/test/java/org/citrusframework/json/schema/SimpleJsonSchemaTest.java b/validation/citrus-validation-json/src/test/java/org/citrusframework/json/schema/SimpleJsonSchemaTest.java index e25b173960..a37d255f41 100644 --- a/validation/citrus-validation-json/src/test/java/org/citrusframework/json/schema/SimpleJsonSchemaTest.java +++ b/validation/citrus-validation-json/src/test/java/org/citrusframework/json/schema/SimpleJsonSchemaTest.java @@ -63,7 +63,7 @@ public void initialize_withByteArrayResource_parsesSchema() { @Test public void initialize_withUrlResource_parsesSchema() throws Exception { ClasspathResource resource = new ClasspathResource("classpath:org/citrusframework/json/schema/jsonSchema.json"); - URL url = resource.getFile().toURI().toURL(); + URL url = resource.file().toURI().toURL(); SimpleJsonSchema simpleJsonSchema = new SimpleJsonSchema(new UrlResource(url)); simpleJsonSchema.initialize(); @@ -84,7 +84,7 @@ public void initialize_withClasspathResource_parsesSchema() { @Test public void initialize_withFileSystemResource_parsesSchema() { ClasspathResource resource = new ClasspathResource("classpath:org/citrusframework/json/schema/jsonSchema.json"); - FileSystemResource fileSystemResource = new FileSystemResource(resource.getFile()); + FileSystemResource fileSystemResource = new FileSystemResource(resource.file()); SimpleJsonSchema simpleJsonSchema = new SimpleJsonSchema(fileSystemResource); simpleJsonSchema.initialize(); @@ -96,7 +96,7 @@ public void initialize_withFileSystemResource_parsesSchema() { public void initialize_withJarUrlResource_parsesSchema() throws Exception { ClasspathResource resource = new ClasspathResource("classpath:org/citrusframework/json/schema/test-schema.jar"); - URL url = resource.getFile().toURI().toURL(); + URL url = resource.file().toURI().toURL(); URL jarUrl = new URL("jar:"+url+"!/jsonschema.json"); SimpleJsonSchema simpleJsonSchema = new SimpleJsonSchema(new UrlResource(jarUrl)); diff --git a/validation/citrus-validation-xml/src/main/java/org/citrusframework/validation/xhtml/XhtmlMessageConverter.java b/validation/citrus-validation-xml/src/main/java/org/citrusframework/validation/xhtml/XhtmlMessageConverter.java index 7d5df7c8a1..09743d8e91 100644 --- a/validation/citrus-validation-xml/src/main/java/org/citrusframework/validation/xhtml/XhtmlMessageConverter.java +++ b/validation/citrus-validation-xml/src/main/java/org/citrusframework/validation/xhtml/XhtmlMessageConverter.java @@ -73,7 +73,7 @@ public void initialize() { tidyInstance.setTidyMark(false); if (tidyConfiguration != null) { - tidyInstance.setConfigurationFromFile(tidyConfiguration.getFile().getAbsolutePath()); + tidyInstance.setConfigurationFromFile(tidyConfiguration.file().getAbsolutePath()); } } } diff --git a/validation/citrus-validation-xml/src/main/java/org/citrusframework/xml/XsdSchemaRepository.java b/validation/citrus-validation-xml/src/main/java/org/citrusframework/xml/XsdSchemaRepository.java index dbf79106f4..28a26f9dfc 100644 --- a/validation/citrus-validation-xml/src/main/java/org/citrusframework/xml/XsdSchemaRepository.java +++ b/validation/citrus-validation-xml/src/main/java/org/citrusframework/xml/XsdSchemaRepository.java @@ -98,18 +98,18 @@ protected void addCitrusSchema(String schemaName) throws SAXException, ParserCon @Override protected void addRepository(Resource resource) { - if (resource.getLocation().endsWith(".xsd")) { + if (resource.location().endsWith(".xsd")) { addXsdSchema(resource); - } else if (resource.getLocation().endsWith(".wsdl")) { + } else if (resource.location().endsWith(".wsdl")) { addWsdlSchema(resource); } else { - logger.warn("Skipped resource other than XSD schema for repository '{}'", resource.getLocation()); + logger.warn("Skipped resource other than XSD schema for repository '{}'", resource.location()); } } private void addWsdlSchema(Resource resource) { if (logger.isDebugEnabled()) { - logger.debug("Loading WSDL schema resource '{}'", resource.getLocation()); + logger.debug("Loading WSDL schema resource '{}'", resource.location()); } WsdlXsdSchema wsdl = new WsdlXsdSchema(resource); @@ -119,7 +119,7 @@ private void addWsdlSchema(Resource resource) { private void addXsdSchema(Resource resource) { if (logger.isDebugEnabled()) { - logger.debug("Loading XSD schema resource '{}'", resource.getLocation()); + logger.debug("Loading XSD schema resource '{}'", resource.location()); } SimpleXsdSchema schema = new SimpleXsdSchema(new ByteArrayResource(FileUtils.copyToByteArray(resource))); diff --git a/validation/citrus-validation-xml/src/main/java/org/citrusframework/xml/schema/AbstractSchemaCollection.java b/validation/citrus-validation-xml/src/main/java/org/citrusframework/xml/schema/AbstractSchemaCollection.java index ee6d671c88..2ae5b445e1 100644 --- a/validation/citrus-validation-xml/src/main/java/org/citrusframework/xml/schema/AbstractSchemaCollection.java +++ b/validation/citrus-validation-xml/src/main/java/org/citrusframework/xml/schema/AbstractSchemaCollection.java @@ -22,7 +22,6 @@ import java.util.ArrayList; import java.util.List; import java.util.Vector; -import javax.wsdl.WSDLException; import javax.wsdl.extensions.schema.Schema; import javax.wsdl.extensions.schema.SchemaImport; import javax.wsdl.extensions.schema.SchemaReference; @@ -78,9 +77,9 @@ public XmlValidator createValidator() { public static org.springframework.core.io.Resource toSpringResource(Resource resource) { if (resource instanceof Resources.ClasspathResource) { - return new ClassPathResource(resource.getLocation()); + return new ClassPathResource(resource.location()); } else if (resource instanceof Resources.FileSystemResource) { - return new FileSystemResource(resource.getLocation()); + return new FileSystemResource(resource.location()); } return new ByteArrayResource(FileUtils.copyToByteArray(resource)); From 517f7974d6938343cebfff7f662a63d059fcabec Mon Sep 17 00:00:00 2001 From: Timon Borter Date: Tue, 24 Mar 2026 16:06:02 +0100 Subject: [PATCH 9/9] chore: resolve simple performance impacting issues --- .../docker/command/ContainerCreate.java | 2 +- .../matcher/core/IsNumberValidationMatcher.java | 10 ++++++---- .../citrusframework/docs/ExcelTestDocsGenerator.java | 2 +- .../functions/core/JsonPatchFunction.java | 6 +++--- .../functions/core/JsonPatchFunctionTest.java | 2 +- 5 files changed, 12 insertions(+), 10 deletions(-) diff --git a/connectors/citrus-docker/src/main/java/org/citrusframework/docker/command/ContainerCreate.java b/connectors/citrus-docker/src/main/java/org/citrusframework/docker/command/ContainerCreate.java index 6cfd3d180c..1b1b79dc78 100644 --- a/connectors/citrus-docker/src/main/java/org/citrusframework/docker/command/ContainerCreate.java +++ b/connectors/citrus-docker/src/main/java/org/citrusframework/docker/command/ContainerCreate.java @@ -236,7 +236,7 @@ private Ports getPortBindings(String portSpecs, ExposedPort[] exposedPorts, Test for (String portSpec : ports) { String[] binding = context.replaceDynamicContentInString(portSpec).split(":"); if (binding.length == 2) { - Integer hostPort = Integer.valueOf(binding[0]); + int hostPort = Integer.parseInt(binding[0]); Integer port = Integer.valueOf(binding[1]); portsBindings.bind(Stream.of(exposedPorts).filter(exposed -> port.equals(exposed.getPort())).findAny().orElseGet(() -> tcp(port)), Ports.Binding.bindPort(hostPort)); diff --git a/core/citrus-base/src/main/java/org/citrusframework/validation/matcher/core/IsNumberValidationMatcher.java b/core/citrus-base/src/main/java/org/citrusframework/validation/matcher/core/IsNumberValidationMatcher.java index 5f9fec94d2..9e1311c7c7 100644 --- a/core/citrus-base/src/main/java/org/citrusframework/validation/matcher/core/IsNumberValidationMatcher.java +++ b/core/citrus-base/src/main/java/org/citrusframework/validation/matcher/core/IsNumberValidationMatcher.java @@ -16,12 +16,14 @@ package org.citrusframework.validation.matcher.core; -import java.util.List; - import org.citrusframework.context.TestContext; import org.citrusframework.exceptions.ValidationException; import org.citrusframework.validation.matcher.ValidationMatcher; +import java.util.List; + +import static java.lang.Double.parseDouble; + /** * ValidationMatcher based on Double > Double. */ @@ -30,7 +32,7 @@ public class IsNumberValidationMatcher implements ValidationMatcher { public void validate(String fieldName, String value, List controlParameters, TestContext context) throws ValidationException { Double dValue; try { - dValue = Double.parseDouble(value); + dValue = parseDouble(value); } catch (Exception e) { throw new ValidationException(this.getClass().getSimpleName() + " failed for field '" + fieldName @@ -38,7 +40,7 @@ public void validate(String fieldName, String value, List controlParamet + "' and is not a number", e); } - if (dValue.isNaN() || dValue.isInfinite()) { + if (Double.isNaN(dValue) || dValue.isInfinite()) { throw new ValidationException(this.getClass().getSimpleName() + " failed for field '" + fieldName + "'. Received value is '" + value diff --git a/tools/docs-generator/src/main/java/org/citrusframework/docs/ExcelTestDocsGenerator.java b/tools/docs-generator/src/main/java/org/citrusframework/docs/ExcelTestDocsGenerator.java index 93569f71a3..0deb3cf908 100644 --- a/tools/docs-generator/src/main/java/org/citrusframework/docs/ExcelTestDocsGenerator.java +++ b/tools/docs-generator/src/main/java/org/citrusframework/docs/ExcelTestDocsGenerator.java @@ -112,7 +112,7 @@ private String buildHeaderXml() { StringTokenizer tok = new StringTokenizer(customHeaders, ";"); while (tok.hasMoreElements()) { - buf.append("
" + tok.nextToken() + "
"); + buf.append("
").append(tok.nextToken()).append("
"); } buf.append(""); diff --git a/validation/citrus-validation-json/src/main/java/org/citrusframework/functions/core/JsonPatchFunction.java b/validation/citrus-validation-json/src/main/java/org/citrusframework/functions/core/JsonPatchFunction.java index 5f685ad1d6..d92e75677a 100644 --- a/validation/citrus-validation-json/src/main/java/org/citrusframework/functions/core/JsonPatchFunction.java +++ b/validation/citrus-validation-json/src/main/java/org/citrusframework/functions/core/JsonPatchFunction.java @@ -79,7 +79,7 @@ private JsonNode applyOperation(JsonNode root, PatchOperation op) { } private JsonNode add(JsonNode root, String path, String value) { - if (path.equals("") || path.equals("/")) { + if (path.isEmpty() || path.equals("/")) { return parseValue(value); } @@ -109,7 +109,7 @@ private JsonNode add(JsonNode root, String path, String value) { } private JsonNode remove(JsonNode root, String path) { - if (path.equals("") || path.equals("/")) { + if (path.isEmpty() || path.equals("/")) { throw new CitrusRuntimeException("Cannot remove root"); } @@ -155,7 +155,7 @@ private JsonNode copy(JsonNode root, String toPath, String fromPath) { } private JsonNode getNodeAtPath(JsonNode root, String path) { - if (path.equals("") || path.equals("/")) { + if (path.isEmpty() || path.equals("/")) { return root; } diff --git a/validation/citrus-validation-json/src/test/java/org/citrusframework/functions/core/JsonPatchFunctionTest.java b/validation/citrus-validation-json/src/test/java/org/citrusframework/functions/core/JsonPatchFunctionTest.java index 0121c70410..7708c624a7 100644 --- a/validation/citrus-validation-json/src/test/java/org/citrusframework/functions/core/JsonPatchFunctionTest.java +++ b/validation/citrus-validation-json/src/test/java/org/citrusframework/functions/core/JsonPatchFunctionTest.java @@ -475,7 +475,7 @@ public void shouldThrowExceptionWhenInvalidParameterCount() { @Test public void shouldThrowExceptionWhenTooFewParameters() { // Given - List params = asList("${jsonSource}"); + List params = List.of("${jsonSource}"); // When / Then assertThatThrownBy(() -> execute(params))