From 9fcf7ebcd99e0c01c89c09d3cd1bddbe0e9d70a9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 18 Oct 2024 11:53:37 +0200 Subject: [PATCH 1/3] chore(deps): bump org.jenkins-ci:jenkins from 1.124 to 1.125 (#343) Bumps [org.jenkins-ci:jenkins](https://github.com/jenkinsci/pom) from 1.124 to 1.125. - [Release notes](https://github.com/jenkinsci/pom/releases) - [Changelog](https://github.com/jenkinsci/pom/blob/master/CHANGELOG-old.md) - [Commits](https://github.com/jenkinsci/pom/compare/jenkins-1.124...jenkins-1.125) --- updated-dependencies: - dependency-name: org.jenkins-ci:jenkins dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index aba0a5f7..91c98f2e 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.jenkins-ci jenkins - 1.124 + 1.125 From 33b652c81d3a8019039d3043ff62ce3666faa3a8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 18 Oct 2024 11:54:53 +0200 Subject: [PATCH 2/3] chore(deps): bump byte-buddy.version from 1.15.4 to 1.15.5 (#344) Bumps `byte-buddy.version` from 1.15.4 to 1.15.5. Updates `net.bytebuddy:byte-buddy` from 1.15.4 to 1.15.5 - [Release notes](https://github.com/raphw/byte-buddy/releases) - [Changelog](https://github.com/raphw/byte-buddy/blob/master/release-notes.md) - [Commits](https://github.com/raphw/byte-buddy/compare/byte-buddy-1.15.4...byte-buddy-1.15.5) Updates `net.bytebuddy:byte-buddy-agent` from 1.15.4 to 1.15.5 - [Release notes](https://github.com/raphw/byte-buddy/releases) - [Changelog](https://github.com/raphw/byte-buddy/blob/master/release-notes.md) - [Commits](https://github.com/raphw/byte-buddy/compare/byte-buddy-1.15.4...byte-buddy-1.15.5) --- updated-dependencies: - dependency-name: net.bytebuddy:byte-buddy dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: net.bytebuddy:byte-buddy-agent dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 91c98f2e..0a57e91d 100644 --- a/pom.xml +++ b/pom.xml @@ -61,7 +61,7 @@ 7.0.0.202409031743-r 1.326 1.27.1 - 1.15.4 + 1.15.5 3.9.1 3.1.13 2.3 From a5262eb81413799c247b8e87127b0ef4175653e0 Mon Sep 17 00:00:00 2001 From: Bruno Verachten Date: Fri, 18 Oct 2024 15:18:31 +0200 Subject: [PATCH 3/3] Test the replaceHttpWithHttps method from PomModifier.java in PomModifierTest.java Fixes #45 Add a test for the `replaceHttpWithHttps` method in `PomModifierTest.java`. * Add a new test method `testReplaceHttpWithHttps` to test the `replaceHttpWithHttps` method. * Initialize `PomModifier` with `OUTPUT_POM_PATH` in the new test method. * Call `replaceHttpWithHttps` method in the new test method. * Save the modified POM to `OUTPUT_POM_PATH` in the new test method. * Parse the modified POM and assert that all `http` URLs are replaced with `https`. --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/gounthar/plugin-modernizer-tool/issues/45?shareId=XXXX-XXXX-XXXX-XXXX). --- .../core/utils/PomModifierTest.java | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/plugin-modernizer-core/src/test/java/io/jenkins/tools/pluginmodernizer/core/utils/PomModifierTest.java b/plugin-modernizer-core/src/test/java/io/jenkins/tools/pluginmodernizer/core/utils/PomModifierTest.java index b0c50bcc..c3daea26 100644 --- a/plugin-modernizer-core/src/test/java/io/jenkins/tools/pluginmodernizer/core/utils/PomModifierTest.java +++ b/plugin-modernizer-core/src/test/java/io/jenkins/tools/pluginmodernizer/core/utils/PomModifierTest.java @@ -142,4 +142,28 @@ public void testUpdateJenkinsMinimalVersion() throws Exception { logger.info("Jenkins version found: " + jenkinsVersion); assertEquals("2.462.2", jenkinsVersion); } + + /** + * Tests the replaceHttpWithHttps method of PomModifier. + * + * @throws Exception if an error occurs during the test + */ + @Test + public void testReplaceHttpWithHttps() throws Exception { + PomModifier pomModifier = new PomModifier(OUTPUT_POM_PATH); + pomModifier.replaceHttpWithHttps(); + pomModifier.savePom(OUTPUT_POM_PATH); + + DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder dBuilder = dbFactory.newDocumentBuilder(); + Document doc = dBuilder.parse(new File(OUTPUT_POM_PATH)); + doc.getDocumentElement().normalize(); + + NodeList repositoryUrls = doc.getElementsByTagName("url"); + for (int i = 0; i < repositoryUrls.getLength(); i++) { + Node urlNode = repositoryUrls.item(i); + String url = urlNode.getTextContent(); + assertTrue(url.startsWith("https://"), "URL should start with https://"); + } + } }