From 6826c5f8a2a7c4cfc8048b32a2660b44097451d8 Mon Sep 17 00:00:00 2001 From: Stefan Tolksdorf Date: Wed, 27 Sep 2023 17:12:42 +0200 Subject: [PATCH 01/41] Update java version command with config file --- pontos/version/commands/_java.py | 274 +++++++++++++------------------ 1 file changed, 114 insertions(+), 160 deletions(-) diff --git a/pontos/version/commands/_java.py b/pontos/version/commands/_java.py index 926e0594c..3812c5180 100644 --- a/pontos/version/commands/_java.py +++ b/pontos/version/commands/_java.py @@ -15,199 +15,153 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -import logging +import json import re from pathlib import Path -from typing import Literal, Optional, Union - -from lxml import etree +from typing import Literal, Union, Dict, List +from ._command import VersionCommand from ..errors import VersionError -from ..schemes import PEP440VersioningScheme from ..version import Version, VersionUpdate -from ._command import VersionCommand - -TEMPLATE = """# pylint: disable=invalid-name - -# THIS IS AN AUTOGENERATED FILE. DO NOT TOUCH! - -__version__ = "{}"\n""" VERSION_PATTERN = ( - r"([0-9]+\.[0-9]+\.[0-9]+(-?([ab]|rc|alpha|beta)[0-9]+(.dev[0-9]+)?)?)" + r"^(?P
.*[^\d])(?P\d+\.\d+\.\d+(-?([ab]|rc|alpha|beta)\d+(.dev\d+)?)?)(?P.*$)"
 )
 
-
-def find_file(
-    filename: Path, search_path: str, search_glob: str
-) -> Optional[Path]:
-    """Find a file somewhere within an directory tree
-
-    Arg:
-        filename: The file to look up
-        search_path: The path to look for the file
-        search_glob: The glob search pattern
-
-    Returns:
-        The file as Path object, if existing
-    """
-    search_path = Path(search_path).resolve()
-    for file_path in search_path.glob(search_glob):
-        if file_path.is_file() and file_path.name == filename.name:
-            return file_path
-    logging.warning("File %s not found in %s.", filename.name, search_path)
-    return None
-
-
-def replace_string_in_file(
-    file_path: Path, pattern: str, replacement: str
-) -> None:
-    # Read the content of the file
-    content = file_path.read_text(encoding="utf-8")
-
-    # Search for the pattern in the content
-    match = re.search(pattern, content)
-
-    # Replace the matched group (Group 1) with the replacement
-    if match:
-        # Write the updated content back to the file
-        file_path.write_text(
-            content.replace(match.group(1), replacement), encoding="utf-8"
-        )
-    else:
-        logging.warning(
-            "Couldn't match the pattern %s in the content of %s.",
-            pattern,
-            file_path,
-        )
-        logging.warning("Content: %s", content)
-
-
 # This class is used for Java Version command(s)
 class JavaVersionCommand(VersionCommand):
-    project_file_name = "pom.xml"
-    _properties_file_path = Path("src/main/resources/application.properties")
-    _pom_xml: Optional[etree.Element] = None
-
-    def _get_version_from_pom_xml(self) -> Version:
-        """
-        Return the version information from the  tag of the
-        pom.xml file. The version may be in non standardized form.
-        """
-
-        pom_xml: etree.Element = self.pom_xml
-
-        version_element = pom_xml.find("{*}version")
-        if version_element is None:
-            raise VersionError("Version tag missing in pom.xml")
 
-        return PEP440VersioningScheme.parse_version(version_element.text)
+    project_file_name = "upgradeVersion.json"
 
-    def _update_pom_version(
-        self,
-        new_version: Version,
-    ) -> None:
-        """
-        Update the version in the pom.xml file
-        """
-        pom_xml: etree.Element = self.pom_xml
-
-        version_element = pom_xml.find("{*}version")
-        if version_element is None:
-            raise VersionError("Version tag missing in pom.xml")
-        version_element.text = str(new_version)
-
-        etree.ElementTree(pom_xml).write(
-            self.project_file_path, pretty_print=True, encoding="utf-8"
-        )
-
-    def _update_properties_file(
-        self,
-        new_version: Version,
-    ) -> None:
-        # update the java properties file version
-        if not self._properties_file_path.exists():
-            # skip if not existing
-            return
-        pattern = rf"sentry\.release={VERSION_PATTERN}"
-        replace_string_in_file(
-            self._properties_file_path,
-            pattern=pattern,
-            replacement=str(new_version),
-        )
-
-    def _update_swagger_config(
-        self,
-        new_version: Version,
-    ) -> None:
-        # update swagger config file version
-        swagger_config_file = find_file(
-            filename=Path("SwaggerConfig.java"),
-            search_path="src",
-            search_glob="**/config/swagger/*",
-        )
-        if not swagger_config_file:
-            # skip if not existing
-            return
-        pattern = rf'\.version\("{VERSION_PATTERN}"\)'
-        replace_string_in_file(
-            swagger_config_file, pattern=pattern, replacement=str(new_version)
-        )
-
-    @property
-    def pom_xml(self) -> etree.Element:
-        if self._pom_xml is not None:
-            return self._pom_xml
-
-        if not self.project_file_path.exists():
-            raise VersionError("pom.xml file not found.")
-
-        try:
-            pom_xml: etree.ElementTree = etree.parse(self.project_file_path)
-        except etree.XMLSyntaxError as e:
-            raise VersionError(e) from e
+    def get_current_version(self) -> Version:
+        file_versions = self._read_versions_from_files()
 
-        self._pom_xml = pom_xml.getroot()
+        last_version = self._verify_version(file_versions)
 
-        return self._pom_xml
+        if last_version == "":
+            raise VersionError("no version found")
 
-    def get_current_version(self) -> Version:
-        """Get the current version of this project
-        In go the version is only defined within the repository
-        tags, thus we need to check git, what tag is the latest"""
-        return self._get_version_from_pom_xml()
+        return self.versioning_scheme.parse_version(last_version)
 
     def verify_version(
-        self, version: Union[Literal["current"], Version, None]
+            self, version: Union[Literal["current"], Version, None]
     ) -> None:
-        """Verify the current version of this project"""
-        current_version = self.get_current_version()
+        file_versions = self._read_versions_from_files()
 
-        if current_version != version:
+        last_version = self._verify_version(file_versions)
+
+        if last_version != str(version):
             raise VersionError(
                 f"Provided version {version} does not match the "
-                f"current version {current_version} in "
+                f"current version {last_version} in "
                 f"{self.project_file_path}."
             )
 
     def update_version(
-        self, new_version: Version, *, force: bool = False
+            self, new_version: Version, *, force: bool = False
     ) -> VersionUpdate:
         try:
-            package_version = self.get_current_version()
-            if not force and new_version == package_version:
-                return VersionUpdate(previous=package_version, new=new_version)
+            current_version = self.get_current_version()
+            if not force and new_version == current_version:
+                return VersionUpdate(previous=current_version, new=new_version)
         except VersionError:
             # just ignore current version and override it
-            package_version = None
+            current_version = None
 
-        changed_files = [self.project_file_path]
-        self._update_pom_version(new_version=new_version)
-        self._update_properties_file(new_version=new_version)
-        self._update_swagger_config(new_version=new_version)
+        changed_files = self._update_version_files(new_version)
 
         return VersionUpdate(
-            previous=package_version,
+            previous=current_version,
             new=new_version,
             changed_files=changed_files,
         )
+
+    def _update_version_files(self, new_version) -> List[Path]:
+        config = self._load_config()
+
+        changed_files: List[Path] = []
+        for file_config in config["files"]:
+            file_path = file_config["path"]
+            with open(Path.cwd() / file_path, "r") as input_file_handle:
+                lines = input_file_handle.readlines()
+                line_number = file_config["line"]
+                version_line = lines[line_number - 1]
+
+                matches = re.match(VERSION_PATTERN, version_line, re.DOTALL)
+                if matches is None:
+                    raise VersionError(
+                        f"Line has no version, "
+                        f"file:'{file_path}' "
+                        f"lineNo:{line_number} "
+                        f"content:'{version_line}'"
+                    )
+                lines[line_number - 1] = matches.group("pre") + str(new_version) + matches.group("post")
+
+                content = "".join(lines)
+                with open(Path.cwd() / file_path, "w") as output_file_handle:
+                    output_file_handle.write(content)
+                changed_files.append(Path(file_config["path"]))
+        return changed_files
+
+    def _load_config(self) -> Dict:
+        version_config_file = Path.cwd() / "upgradeVersion.json"
+        if not version_config_file.exists():
+            raise VersionError(
+                f"No {version_config_file} config file found. "
+                "This file is required for pontos"
+            )
+
+        with open(version_config_file, "r") as f:
+            json_string = f.read()
+            config = json.loads(json_string)
+            return config
+
+    def _read_versions_from_files(self) -> Dict:
+        config = self._load_config()
+
+        file_versions = {}
+        for file_config in config["files"]:
+            file_path = file_config["path"]
+            file = Path.cwd() / file_path
+            if not file.exists():
+                raise VersionError(f"No {file} file found.")
+
+            with open(file, "r") as f:
+                line_number = file_config["line"]
+                readlines = f.readlines()
+                if line_number - 1 > len(readlines):
+                    raise VersionError(
+                        f"Line number:{line_number} is beyond file lines:{len(readlines) + 1} "
+                        f"file:'{file_path}'"
+                    )
+                version_line = readlines[line_number - 1]
+                matches = re.match(VERSION_PATTERN, version_line, re.DOTALL)
+                if matches is None:
+                    raise VersionError(
+                        f"Line has no version, "
+                        f"file:'{file_path}' "
+                        f"lineNo:{line_number} "
+                        f"content:'{version_line}'"
+                    )
+                file_versions[file_path] = matches.group("version")
+        return file_versions
+
+    def _verify_version(self, file_versions: Dict) -> str:
+        last_version = ""
+        last_file_name = ""
+        for file_name, version in file_versions.items():
+            if last_version == "":
+                last_version = version
+                last_file_name = file_name
+                continue
+
+            if last_version != version:
+                raise VersionError(
+                    f"Versions are not the same "
+                    f"last_file_name:'{last_file_name}' "
+                    f"last_version:'{last_version}' "
+                    f"file_name:'{file_name}' "
+                    f"version:'{version}'"
+                )
+        return last_version
+

From 9dc4472797e7d85e63d8ff425cc7426b981b5be1 Mon Sep 17 00:00:00 2001
From: Stefan Tolksdorf 
Date: Wed, 27 Sep 2023 17:58:40 +0200
Subject: [PATCH 02/41] Remove tests

---
 tests/version/commands/test_java.py | 360 ----------------------------
 1 file changed, 360 deletions(-)

diff --git a/tests/version/commands/test_java.py b/tests/version/commands/test_java.py
index 95143aa8c..f6bbd4eea 100644
--- a/tests/version/commands/test_java.py
+++ b/tests/version/commands/test_java.py
@@ -17,363 +17,3 @@
 
 # pylint: disable=line-too-long
 # ruff: noqa: E501
-
-import unittest
-from pathlib import Path
-
-from lxml import etree
-
-from pontos.testing import temp_directory, temp_file
-from pontos.version import VersionError
-from pontos.version.commands import JavaVersionCommand
-from pontos.version.commands._java import (
-    VERSION_PATTERN,
-    find_file,
-    replace_string_in_file,
-)
-from pontos.version.schemes import PEP440VersioningScheme
-
-
-class TestVersionPattern(unittest.TestCase):
-    def test_version_pattern_swagger(self):
-        # Define the test parameters
-        content = """
-@Configuration
-public class SwaggerConfig {{
-
-    @Bean
-    public OpenAPI metaData() {{
-        return new OpenAPI().info(new Info()
-                .title("Api Documentation")
-                .description("Api Documentation for billing service")
-                .version("{}"));
-    }}
-}}
-        """
-        versions = [
-            "2018.0.1",
-            "2023.1.2a1",
-            "2023.3.3-alpha1.dev1",
-            "2023.4.5-rc2",
-            "2023.1.1beta1",
-        ]
-        replacement = "2023.10.10"
-
-        for version in versions:
-            with temp_file(content=content.format(version)) as tmp:
-                replace_string_in_file(tmp, VERSION_PATTERN, replacement)
-
-                updated_content = tmp.read_text(encoding="utf-8")
-
-                # Verify the replacement was performed correctly
-                self.assertNotRegex(
-                    updated_content, version
-                )  # Pattern should not be present
-                self.assertIn(
-                    replacement, updated_content
-                )  # Replacement should be present
-
-    def test_version_pattern_properties(self):
-        # Define the test parameters
-        content = """
-# application
-spring.application.name=boo
-server.port=1elf
-app.stripe.enabled=false
-app.not.for.resale.keys=
-app.gmsp.booking.startOfHistory=2021
-# sentry
-sentry.release={}
-sentry.tags.service_name=boo
-# actuator
-management.health.db.enabled=false
-# spring
-spring.main.allow-bean-definition-overriding=true
-        """
-        versions = [
-            "2018.0.1",
-            "2023.1.2a1",
-            "2023.3.3-alpha1.dev1",
-            "2023.4.5-rc2",
-            "2023.1.1beta1",
-        ]
-        replacement = "2023.10.10"
-
-        for version in versions:
-            with temp_file(content=content.format(version)) as tmp:
-                replace_string_in_file(tmp, VERSION_PATTERN, replacement)
-
-                updated_content = tmp.read_text(encoding="utf-8")
-
-                # Verify the replacement was performed correctly
-                self.assertNotRegex(
-                    updated_content, version
-                )  # Pattern should not be present
-                self.assertIn(
-                    replacement, updated_content
-                )  # Replacement should be present
-
-
-class TestFindFile(unittest.TestCase):
-    def test_file_found(self):
-        with temp_directory() as temp_dir:
-            deep_path = Path(temp_dir / "foo/bat/config/swagger/")
-            deep_path.mkdir(parents=True)
-            Path(deep_path / "SwaggerConfig.java").touch()
-            self.assertTrue(
-                Path(
-                    temp_dir / "foo/bat/config/swagger/SwaggerConfig.java"
-                ).exists()
-            )
-            filename = Path("SwaggerConfig.java")
-            search_path = temp_dir  # Assuming 'config/swagger' is two levels up
-            search_glob = "**/config/swagger/*"
-
-            result = find_file(filename, search_path, search_glob)
-
-            self.assertIsNotNone(result)
-            self.assertEqual(result.name, filename.name)
-
-    def test_file_not_found(self):
-        with temp_directory() as temp_dir:
-            Path(
-                temp_dir / "foo/bat/config/swagger/SwaggerConfig.java",
-                parents=True,
-            )
-            filename = Path("NonExistentFile.java")
-            search_path = temp_dir
-            search_glob = "**/config/swagger/*"
-            with self.assertLogs("root", level="WARNING") as cm:
-                result = find_file(filename, search_path, search_glob)
-                self.assertEqual(
-                    cm.output,
-                    [
-                        (
-                            f"WARNING:root:File {filename.name} not "
-                            f"found in {search_path.resolve()}."
-                        )
-                    ],
-                )
-
-            self.assertIsNone(result)
-
-
-class TestReplaceString(unittest.TestCase):
-    def test_replace_string_in_file(self):
-        # Define the test parameters
-        content = """
-        Foo, bar
-        baz
-            .version("1.2.3")
-        glubb
-        """
-        pattern = r'\.version\("([0-9]+\.[0-9]+\.[0-9]+)"\)'
-        replacement = "1.2.4"
-
-        with temp_file(content=content) as tmp:
-            replace_string_in_file(tmp, pattern, replacement)
-
-            updated_content = tmp.read_text(encoding="utf-8")
-
-            # Verify the replacement was performed correctly
-            self.assertNotRegex(
-                updated_content, "1.2.3"
-            )  # Pattern should not be present
-            self.assertIn(
-                replacement, updated_content
-            )  # Replacement should be present
-
-    def test_replace_string_in_file_no_match(self):
-        # Define the test parameters
-        content = """
-        Foo, bar
-        baz
-            .versio("1.2.3")
-        glubb
-        """
-        pattern = r'\.version\("([0-9]+\.[0-9]+\.[0-9]+)"\)'
-        replacement = "1.2.4"
-
-        with temp_file(content=content) as tmp:
-            # Call the function under test
-            replace_string_in_file(tmp, pattern, replacement)
-
-            # Read the content of the unmodified file
-            updated_content = tmp.read_text(encoding="utf-8")
-
-            # Verify the content remains unchanged
-            self.assertNotRegex(updated_content, replacement)
-            self.assertEqual(updated_content, content)
-
-
-class GetCurrentJavaVersionCommandTestCase(unittest.TestCase):
-    def test_get_current_version(self):
-        content = """
-        
-        4.0.0net.greenbone.umbrella
-        msspadminservice2023.5.3"""
-        with temp_file(content, name="pom.xml", change_into=True):
-            cmd = JavaVersionCommand(PEP440VersioningScheme)
-            version = cmd.get_current_version()
-
-            self.assertEqual(
-                version, PEP440VersioningScheme.parse_version("2023.5.3")
-            )
-
-    def test_no_project_file(self):
-        with temp_directory(change_into=True), self.assertRaisesRegex(
-            VersionError, ".* file not found."
-        ):
-            cmd = JavaVersionCommand(PEP440VersioningScheme)
-            cmd.get_current_version()
-
-    def test_no_package_version(self):
-        content = """
-        
-            4.0.0net.greenbone.umbrella
-            msspadminservice"""
-        with temp_file(
-            content, name="pom.xml", change_into=True
-        ), self.assertRaisesRegex(VersionError, "Version tag missing in"):
-            cmd = JavaVersionCommand(PEP440VersioningScheme)
-            cmd.get_current_version()
-
-    def test_no_valid_xml_in_pom(self):
-        content = "<"
-        with temp_file(
-            content, name="pom.xml", change_into=True
-        ), self.assertRaisesRegex(
-            VersionError, "StartTag: invalid element name,"
-        ):
-            cmd = JavaVersionCommand(PEP440VersioningScheme)
-            cmd.get_current_version()
-
-        content = ""
-        with temp_file(
-            content, name="pom.xml", change_into=True
-        ), self.assertRaisesRegex(
-            VersionError, "Premature end of data in tag foo"
-        ):
-            cmd = JavaVersionCommand(PEP440VersioningScheme)
-            cmd.get_current_version()
-
-
-class UpdateJavaVersionCommandTestCase(unittest.TestCase):
-    swagger_file = "SwaggerConfig.java"
-
-    def test_update_version_file(self):
-        content = """
-        
-        4.0.0net.greenbone.umbrella
-        msspadminservice2023.5.3"""
-
-        with temp_file(content, name="pom.xml", change_into=True) as temp:
-            cmd = JavaVersionCommand(PEP440VersioningScheme)
-            cmd.get_current_version()
-            updated = cmd.update_version(
-                PEP440VersioningScheme.parse_version("2023.6.0")
-            )
-
-            self.assertEqual(
-                updated.previous,
-                PEP440VersioningScheme.parse_version("2023.5.3"),
-            )
-            self.assertEqual(
-                updated.new, PEP440VersioningScheme.parse_version("2023.6.0")
-            )
-            self.assertEqual(updated.changed_files, [temp.resolve()])
-
-            with temp.open(mode="r", encoding="utf-8") as fp:
-                fake_pom = etree.parse(fp).getroot()
-
-            self.assertEqual(fake_pom.find("{*}version").text, "2023.6.0")
-
-    def test_update_version_develop(self):
-        content = """
-        
-        4.0.0net.greenbone.umbrella
-        msspadminservice2023.5.3"""
-
-        with temp_file(content, name="pom.xml", change_into=True) as temp:
-            swagger_search_path = Path("src").resolve()
-            cmd = JavaVersionCommand(PEP440VersioningScheme)
-            new_version = PEP440VersioningScheme.parse_version("2023.6.0.dev1")
-            with self.assertLogs("root", level="WARNING") as cm:
-                updated = cmd.update_version(new_version)
-                self.assertEqual(
-                    cm.output,
-                    [
-                        (
-                            f"WARNING:root:File {self.swagger_file} not "
-                            f"found in {swagger_search_path.resolve()}."
-                        )
-                    ],
-                )
-
-            self.assertEqual(
-                updated.previous,
-                PEP440VersioningScheme.parse_version("2023.5.3"),
-            )
-            self.assertEqual(
-                updated.new,
-                PEP440VersioningScheme.parse_version("2023.6.0.dev1"),
-            )
-            self.assertEqual(updated.changed_files, [temp.resolve()])
-
-            with temp.open(mode="r", encoding="utf-8") as fp:
-                fake_pom = etree.parse(fp).getroot()
-
-            self.assertEqual(fake_pom.find("{*}version").text, "2023.6.0.dev1")
-
-    def test_no_update(self):
-        content = """
-        
-        4.0.0net.greenbone.umbrella
-        msspadminservice2023.5.3"""
-
-        with temp_file(content, name="pom.xml", change_into=True) as temp:
-            cmd = JavaVersionCommand(PEP440VersioningScheme)
-            updated = cmd.update_version(
-                PEP440VersioningScheme.parse_version("2023.5.3")
-            )
-
-            self.assertEqual(
-                updated.previous,
-                PEP440VersioningScheme.parse_version("2023.5.3"),
-            )
-            self.assertEqual(
-                updated.new, PEP440VersioningScheme.parse_version("2023.5.3")
-            )
-            self.assertEqual(updated.changed_files, [])
-
-            with temp.open(mode="r", encoding="utf-8") as fp:
-                fake_pom = etree.parse(fp).getroot()
-
-            self.assertEqual(fake_pom.find("{*}version").text, "2023.5.3")
-
-    def test_forced_update(self):
-        content = """
-        
-        4.0.0net.greenbone.umbrella
-        msspadminservice2023.5.3"""
-
-        with temp_file(content, name="pom.xml", change_into=True) as temp:
-            cmd = JavaVersionCommand(PEP440VersioningScheme)
-            updated = cmd.update_version(
-                PEP440VersioningScheme.parse_version("2023.5.3"), force=True
-            )
-
-            self.assertEqual(
-                updated.previous,
-                PEP440VersioningScheme.parse_version("2023.5.3"),
-            )
-            self.assertEqual(
-                updated.new, PEP440VersioningScheme.parse_version("2023.5.3")
-            )
-            self.assertEqual(updated.changed_files, [temp.resolve()])
-
-            with temp.open(mode="r", encoding="utf-8") as fp:
-                fake_pom = etree.parse(fp).getroot()
-
-            self.assertEqual(fake_pom.find("{*}version").text, "2023.5.3")

From d59a7d04ef974b01988cf82d719aeb9e4632075c Mon Sep 17 00:00:00 2001
From: Stefan Tolksdorf 
Date: Wed, 27 Sep 2023 18:01:32 +0200
Subject: [PATCH 03/41] Fix linting

---
 pontos/version/commands/_java.py | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/pontos/version/commands/_java.py b/pontos/version/commands/_java.py
index 3812c5180..065e2cee0 100644
--- a/pontos/version/commands/_java.py
+++ b/pontos/version/commands/_java.py
@@ -24,13 +24,10 @@
 from ..errors import VersionError
 from ..version import Version, VersionUpdate
 
-VERSION_PATTERN = (
-    r"^(?P
.*[^\d])(?P\d+\.\d+\.\d+(-?([ab]|rc|alpha|beta)\d+(.dev\d+)?)?)(?P.*$)"
-)
+VERSION_PATTERN = r"^(?P
.*[^\d])(?P\d+\.\d+\.\d+(-?([ab]|rc|alpha|beta)\d+(.dev\d+)?)?)(?P.*$)"
 
 # This class is used for Java Version command(s)
 class JavaVersionCommand(VersionCommand):
-
     project_file_name = "upgradeVersion.json"
 
     def get_current_version(self) -> Version:
@@ -44,7 +41,7 @@ def get_current_version(self) -> Version:
         return self.versioning_scheme.parse_version(last_version)
 
     def verify_version(
-            self, version: Union[Literal["current"], Version, None]
+        self, version: Union[Literal["current"], Version, None]
     ) -> None:
         file_versions = self._read_versions_from_files()
 
@@ -58,7 +55,7 @@ def verify_version(
             )
 
     def update_version(
-            self, new_version: Version, *, force: bool = False
+        self, new_version: Version, *, force: bool = False
     ) -> VersionUpdate:
         try:
             current_version = self.get_current_version()
@@ -82,7 +79,7 @@ def _update_version_files(self, new_version) -> List[Path]:
         changed_files: List[Path] = []
         for file_config in config["files"]:
             file_path = file_config["path"]
-            with open(Path.cwd() / file_path, "r") as input_file_handle:
+            with ((open(Path.cwd() / file_path, "r") as input_file_handle)):
                 lines = input_file_handle.readlines()
                 line_number = file_config["line"]
                 version_line = lines[line_number - 1]
@@ -95,7 +92,11 @@ def _update_version_files(self, new_version) -> List[Path]:
                         f"lineNo:{line_number} "
                         f"content:'{version_line}'"
                     )
-                lines[line_number - 1] = matches.group("pre") + str(new_version) + matches.group("post")
+                lines[line_number - 1] = (
+                        matches.group("pre")
+                    + str(new_version)
+                    + matches.group("post")
+                )
 
                 content = "".join(lines)
                 with open(Path.cwd() / file_path, "w") as output_file_handle:

From b09d9caaaee52ecd7d72c7e15a02ebbac7295a1c Mon Sep 17 00:00:00 2001
From: Stefan Tolksdorf 
Date: Wed, 27 Sep 2023 18:05:05 +0200
Subject: [PATCH 04/41] Fix linting

---
 pontos/version/commands/_java.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pontos/version/commands/_java.py b/pontos/version/commands/_java.py
index 065e2cee0..89ed85940 100644
--- a/pontos/version/commands/_java.py
+++ b/pontos/version/commands/_java.py
@@ -79,7 +79,7 @@ def _update_version_files(self, new_version) -> List[Path]:
         changed_files: List[Path] = []
         for file_config in config["files"]:
             file_path = file_config["path"]
-            with ((open(Path.cwd() / file_path, "r") as input_file_handle)):
+            with open(Path.cwd() / file_path, "r") as input_file_handle:
                 lines = input_file_handle.readlines()
                 line_number = file_config["line"]
                 version_line = lines[line_number - 1]

From 1f08ba38897997f8c29699f75f53a5cd81a3bafb Mon Sep 17 00:00:00 2001
From: Stefan Tolksdorf 
Date: Wed, 27 Sep 2023 18:10:00 +0200
Subject: [PATCH 05/41] Fix linting

---
 pontos/version/commands/_java.py | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/pontos/version/commands/_java.py b/pontos/version/commands/_java.py
index 89ed85940..a727cef2c 100644
--- a/pontos/version/commands/_java.py
+++ b/pontos/version/commands/_java.py
@@ -93,7 +93,7 @@ def _update_version_files(self, new_version) -> List[Path]:
                         f"content:'{version_line}'"
                     )
                 lines[line_number - 1] = (
-                        matches.group("pre")
+                    matches.group("pre")
                     + str(new_version)
                     + matches.group("post")
                 )
@@ -165,4 +165,3 @@ def _verify_version(self, file_versions: Dict) -> str:
                     f"version:'{version}'"
                 )
         return last_version
-

From e1deeff1cb2b4b712556cd3db66eaf72630c9492 Mon Sep 17 00:00:00 2001
From: Stefan Tolksdorf 
Date: Wed, 27 Sep 2023 18:11:33 +0200
Subject: [PATCH 06/41] Fix linting

---
 pontos/version/commands/_java.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/pontos/version/commands/_java.py b/pontos/version/commands/_java.py
index a727cef2c..58c57b2e6 100644
--- a/pontos/version/commands/_java.py
+++ b/pontos/version/commands/_java.py
@@ -26,6 +26,7 @@
 
 VERSION_PATTERN = r"^(?P
.*[^\d])(?P\d+\.\d+\.\d+(-?([ab]|rc|alpha|beta)\d+(.dev\d+)?)?)(?P.*$)"
 
+
 # This class is used for Java Version command(s)
 class JavaVersionCommand(VersionCommand):
     project_file_name = "upgradeVersion.json"

From 6f586653e85f01914824fb75e60d0d94f5b055a5 Mon Sep 17 00:00:00 2001
From: Stefan Tolksdorf 
Date: Wed, 27 Sep 2023 18:13:27 +0200
Subject: [PATCH 07/41] Fix linting

---
 pontos/version/commands/_java.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/pontos/version/commands/_java.py b/pontos/version/commands/_java.py
index 58c57b2e6..e3f03e890 100644
--- a/pontos/version/commands/_java.py
+++ b/pontos/version/commands/_java.py
@@ -24,7 +24,10 @@
 from ..errors import VersionError
 from ..version import Version, VersionUpdate
 
-VERSION_PATTERN = r"^(?P
.*[^\d])(?P\d+\.\d+\.\d+(-?([ab]|rc|alpha|beta)\d+(.dev\d+)?)?)(?P.*$)"
+VERSION_PATTERN = (r"^(?P
.*[^\d])"
+                   r"(?P\d+\.\d+\.\d+"
+                   r"(-?([ab]|rc|alpha|beta)\d+(.dev\d+)?)?)"
+                   r"(?P.*$)")
 
 
 # This class is used for Java Version command(s)
@@ -133,7 +136,8 @@ def _read_versions_from_files(self) -> Dict:
                 readlines = f.readlines()
                 if line_number - 1 > len(readlines):
                     raise VersionError(
-                        f"Line number:{line_number} is beyond file lines:{len(readlines) + 1} "
+                        f"Line number:{line_number} "
+                        f"is beyond file lines:{len(readlines) + 1} "
                         f"file:'{file_path}'"
                     )
                 version_line = readlines[line_number - 1]

From e3c99ee78434163d2505d246b32c4705b9a664cc Mon Sep 17 00:00:00 2001
From: Stefan Tolksdorf 
Date: Wed, 27 Sep 2023 18:15:10 +0200
Subject: [PATCH 08/41] Fix linting

---
 pontos/version/commands/_java.py | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/pontos/version/commands/_java.py b/pontos/version/commands/_java.py
index e3f03e890..4eb30bbc8 100644
--- a/pontos/version/commands/_java.py
+++ b/pontos/version/commands/_java.py
@@ -24,10 +24,12 @@
 from ..errors import VersionError
 from ..version import Version, VersionUpdate
 
-VERSION_PATTERN = (r"^(?P
.*[^\d])"
-                   r"(?P\d+\.\d+\.\d+"
-                   r"(-?([ab]|rc|alpha|beta)\d+(.dev\d+)?)?)"
-                   r"(?P.*$)")
+VERSION_PATTERN = (
+    r"^(?P
.*[^\d])"
+    r"(?P\d+\.\d+\.\d+"
+    r"(-?([ab]|rc|alpha|beta)\d+(.dev\d+)?)?)"
+    r"(?P.*$)"
+)
 
 
 # This class is used for Java Version command(s)

From d8add03dcd8dac043671b4a702fdf0389b5b930c Mon Sep 17 00:00:00 2001
From: Stefan Tolksdorf 
Date: Wed, 27 Sep 2023 18:26:56 +0200
Subject: [PATCH 09/41] Add test for get_current_version

---
 tests/version/commands/test_java.py | 45 +++++++++++++++++++++++++++--
 1 file changed, 43 insertions(+), 2 deletions(-)

diff --git a/tests/version/commands/test_java.py b/tests/version/commands/test_java.py
index f6bbd4eea..5b25661b6 100644
--- a/tests/version/commands/test_java.py
+++ b/tests/version/commands/test_java.py
@@ -14,6 +14,47 @@
 #
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see .
+import unittest
+from pathlib import Path
 
-# pylint: disable=line-too-long
-# ruff: noqa: E501
+from pontos.testing import temp_file
+from pontos.version.commands import JavaVersionCommand
+from pontos.version.schemes import SemanticVersioningScheme
+
+TEMPLATE_UPGRADE_VERSION_JSON = """{
+  "files": [
+    {
+      "path": "README.md",
+      "line": 3
+    },
+  ]
+}
+"""
+
+TEMPLATE_UPGRADE_VERSION_MARKDOWN = """# Task service
+
+**task service**: Version 2023.9.3
+
+## starting the local 
+"""
+
+
+class GetCurrentJavaVersionCommandTestCase(unittest.TestCase):
+    def test_getting_version(self):
+        with temp_file(
+            name="go.mod",
+            change_into=True,
+        ):
+            version_file_path = Path("upgradeVersion.json")
+            version_file_path.write_text(
+                TEMPLATE_UPGRADE_VERSION_JSON, encoding="utf-8"
+            )
+
+            result_version = JavaVersionCommand(
+                SemanticVersioningScheme
+            ).get_current_version()
+
+            self.assertEqual(
+                result_version, SemanticVersioningScheme.parse_version("2023.9.3")
+            )
+            version_file_path.unlink()

From 946b49ffd3e47deb7d372e0a68c0bf30590eabf3 Mon Sep 17 00:00:00 2001
From: Stefan Tolksdorf 
Date: Wed, 27 Sep 2023 18:28:44 +0200
Subject: [PATCH 10/41] Add test for get_current_version

---
 tests/version/commands/test_java.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/tests/version/commands/test_java.py b/tests/version/commands/test_java.py
index 5b25661b6..9685e8018 100644
--- a/tests/version/commands/test_java.py
+++ b/tests/version/commands/test_java.py
@@ -49,6 +49,10 @@ def test_getting_version(self):
             version_file_path.write_text(
                 TEMPLATE_UPGRADE_VERSION_JSON, encoding="utf-8"
             )
+            readme_file_path = Path("README.md")
+            readme_file_path.write_text(
+                TEMPLATE_UPGRADE_VERSION_MARKDOWN, encoding="utf-8"
+            )
 
             result_version = JavaVersionCommand(
                 SemanticVersioningScheme
@@ -57,4 +61,6 @@ def test_getting_version(self):
             self.assertEqual(
                 result_version, SemanticVersioningScheme.parse_version("2023.9.3")
             )
+
             version_file_path.unlink()
+            readme_file_path.unlink()

From 17b14ba491d13481a7f2b8bc0c777249c32dc5ab Mon Sep 17 00:00:00 2001
From: Stefan Tolksdorf 
Date: Wed, 27 Sep 2023 18:30:58 +0200
Subject: [PATCH 11/41] Add test for get_current_version

---
 tests/version/commands/test_java.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/version/commands/test_java.py b/tests/version/commands/test_java.py
index 9685e8018..86168e7d4 100644
--- a/tests/version/commands/test_java.py
+++ b/tests/version/commands/test_java.py
@@ -26,7 +26,7 @@
     {
       "path": "README.md",
       "line": 3
-    },
+    }
   ]
 }
 """

From d67fd1c7d1ac6fd8e46368ef20a0a22c72edc04e Mon Sep 17 00:00:00 2001
From: Stefan Tolksdorf 
Date: Wed, 27 Sep 2023 18:46:49 +0200
Subject: [PATCH 12/41] Add test for get_current_version

---
 tests/version/commands/test_java.py | 71 +++++++++++++++++++++++++++--
 1 file changed, 67 insertions(+), 4 deletions(-)

diff --git a/tests/version/commands/test_java.py b/tests/version/commands/test_java.py
index 86168e7d4..32738615e 100644
--- a/tests/version/commands/test_java.py
+++ b/tests/version/commands/test_java.py
@@ -33,7 +33,7 @@
 
 TEMPLATE_UPGRADE_VERSION_MARKDOWN = """# Task service
 
-**task service**: Version 2023.9.3
+**task service**: Version {}
 
 ## starting the local 
 """
@@ -42,16 +42,18 @@
 class GetCurrentJavaVersionCommandTestCase(unittest.TestCase):
     def test_getting_version(self):
         with temp_file(
-            name="go.mod",
+            name="upgradeVersion.json",
             change_into=True,
         ):
             version_file_path = Path("upgradeVersion.json")
             version_file_path.write_text(
                 TEMPLATE_UPGRADE_VERSION_JSON, encoding="utf-8"
             )
+
+            version = "2023.9.3"
             readme_file_path = Path("README.md")
             readme_file_path.write_text(
-                TEMPLATE_UPGRADE_VERSION_MARKDOWN, encoding="utf-8"
+                TEMPLATE_UPGRADE_VERSION_MARKDOWN.format(version), encoding="utf-8"
             )
 
             result_version = JavaVersionCommand(
@@ -59,8 +61,69 @@ def test_getting_version(self):
             ).get_current_version()
 
             self.assertEqual(
-                result_version, SemanticVersioningScheme.parse_version("2023.9.3")
+                result_version,
+                SemanticVersioningScheme.parse_version(version)
             )
 
             version_file_path.unlink()
             readme_file_path.unlink()
+
+
+class VerifyJavaVersionCommandTestCase(unittest.TestCase):
+    def test_verify_version(self):
+        with temp_file(
+            name="upgradeVersion.json",
+            change_into=True,
+        ):
+            version_file_path = Path("upgradeVersion.json")
+            version_file_path.write_text(
+                TEMPLATE_UPGRADE_VERSION_JSON, encoding="utf-8"
+            )
+
+            version = "2023.9.3"
+            readme_file_path = Path("README.md")
+            readme_file_path.write_text(
+                TEMPLATE_UPGRADE_VERSION_MARKDOWN.format(version), encoding="utf-8"
+            )
+
+            JavaVersionCommand(
+                SemanticVersioningScheme
+            ).verify_version(SemanticVersioningScheme.parse_version(version))
+
+            version_file_path.unlink()
+            readme_file_path.unlink()
+
+
+class UpdateJavaVersionCommandTestCase(unittest.TestCase):
+    def test_update_version(self):
+        with temp_file(
+            name="upgradeVersion.json",
+            change_into=True,
+        ):
+            version_file_path = Path("upgradeVersion.json")
+            version_file_path.write_text(
+                TEMPLATE_UPGRADE_VERSION_JSON, encoding="utf-8"
+            )
+
+            version = "2023.9.3"
+            readme_file_path = Path("README.md")
+            readme_file_path.write_text(
+                TEMPLATE_UPGRADE_VERSION_MARKDOWN.format(version), encoding="utf-8"
+            )
+
+            new_version = "2023.9.4"
+            updated_version_obj = JavaVersionCommand(
+                SemanticVersioningScheme
+            ).update_version(SemanticVersioningScheme.parse_version(new_version))
+
+            self.assertEqual(updated_version_obj.previous, version)
+            self.assertEqual(updated_version_obj.new, new_version)
+            self.assertEqual(
+                updated_version_obj.changed_files, ["README.md"]
+            )
+
+            content = readme_file_path.read_text(encoding="UTF-8")
+            self.assertEqual(content, TEMPLATE_UPGRADE_VERSION_MARKDOWN.format(new_version))
+
+            version_file_path.unlink()
+            readme_file_path.unlink()

From c73973b5d5e17d40d8db0ca1367c53c99e80ea79 Mon Sep 17 00:00:00 2001
From: Stefan Tolksdorf 
Date: Wed, 27 Sep 2023 18:49:24 +0200
Subject: [PATCH 13/41] Add test for get_current_version

---
 tests/version/commands/test_java.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/version/commands/test_java.py b/tests/version/commands/test_java.py
index 32738615e..a5091e2cd 100644
--- a/tests/version/commands/test_java.py
+++ b/tests/version/commands/test_java.py
@@ -116,8 +116,8 @@ def test_update_version(self):
                 SemanticVersioningScheme
             ).update_version(SemanticVersioningScheme.parse_version(new_version))
 
-            self.assertEqual(updated_version_obj.previous, version)
-            self.assertEqual(updated_version_obj.new, new_version)
+            self.assertEqual(updated_version_obj.previous, SemanticVersioningScheme.parse_version(version))
+            self.assertEqual(updated_version_obj.new, SemanticVersioningScheme.parse_version(new_version))
             self.assertEqual(
                 updated_version_obj.changed_files, ["README.md"]
             )

From 1840893028ffeacc642fbb143d5813b7a40a5cda Mon Sep 17 00:00:00 2001
From: Stefan Tolksdorf 
Date: Wed, 27 Sep 2023 18:51:03 +0200
Subject: [PATCH 14/41] Add test for get_current_version

---
 tests/version/commands/test_java.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/version/commands/test_java.py b/tests/version/commands/test_java.py
index a5091e2cd..8a299d71f 100644
--- a/tests/version/commands/test_java.py
+++ b/tests/version/commands/test_java.py
@@ -119,7 +119,7 @@ def test_update_version(self):
             self.assertEqual(updated_version_obj.previous, SemanticVersioningScheme.parse_version(version))
             self.assertEqual(updated_version_obj.new, SemanticVersioningScheme.parse_version(new_version))
             self.assertEqual(
-                updated_version_obj.changed_files, ["README.md"]
+                updated_version_obj.changed_files, [Path("README.md")]
             )
 
             content = readme_file_path.read_text(encoding="UTF-8")

From b78a1e1d6921895cf5af0f62b7d47960714ea1d6 Mon Sep 17 00:00:00 2001
From: Stefan Tolksdorf 
Date: Wed, 27 Sep 2023 19:03:32 +0200
Subject: [PATCH 15/41] Add test for get_current_version

---
 tests/version/commands/test_java.py | 44 +++++++++++++++++++++--------
 1 file changed, 32 insertions(+), 12 deletions(-)

diff --git a/tests/version/commands/test_java.py b/tests/version/commands/test_java.py
index 8a299d71f..7ae16dd4b 100644
--- a/tests/version/commands/test_java.py
+++ b/tests/version/commands/test_java.py
@@ -41,10 +41,7 @@
 
 class GetCurrentJavaVersionCommandTestCase(unittest.TestCase):
     def test_getting_version(self):
-        with temp_file(
-            name="upgradeVersion.json",
-            change_into=True,
-        ):
+        with temp_file(name="upgradeVersion.json", change_into=True):
             version_file_path = Path("upgradeVersion.json")
             version_file_path.write_text(
                 TEMPLATE_UPGRADE_VERSION_JSON, encoding="utf-8"
@@ -71,10 +68,7 @@ def test_getting_version(self):
 
 class VerifyJavaVersionCommandTestCase(unittest.TestCase):
     def test_verify_version(self):
-        with temp_file(
-            name="upgradeVersion.json",
-            change_into=True,
-        ):
+        with temp_file(name="upgradeVersion.json", change_into=True):
             version_file_path = Path("upgradeVersion.json")
             version_file_path.write_text(
                 TEMPLATE_UPGRADE_VERSION_JSON, encoding="utf-8"
@@ -96,10 +90,7 @@ def test_verify_version(self):
 
 class UpdateJavaVersionCommandTestCase(unittest.TestCase):
     def test_update_version(self):
-        with temp_file(
-            name="upgradeVersion.json",
-            change_into=True,
-        ):
+        with temp_file(name="upgradeVersion.json", change_into=True):
             version_file_path = Path("upgradeVersion.json")
             version_file_path.write_text(
                 TEMPLATE_UPGRADE_VERSION_JSON, encoding="utf-8"
@@ -127,3 +118,32 @@ def test_update_version(self):
 
             version_file_path.unlink()
             readme_file_path.unlink()
+
+    def test_forced_update_version(self):
+        with temp_file(name="upgradeVersion.json", change_into=True):
+            version_file_path = Path("upgradeVersion.json")
+            version_file_path.write_text(
+                TEMPLATE_UPGRADE_VERSION_JSON, encoding="utf-8"
+            )
+
+            version = "2023.9.3"
+            readme_file_path = Path("README.md")
+            readme_file_path.write_text(
+                TEMPLATE_UPGRADE_VERSION_MARKDOWN.format(version), encoding="utf-8"
+            )
+
+            updated_version_obj = JavaVersionCommand(
+                SemanticVersioningScheme
+            ).update_version(SemanticVersioningScheme.parse_version(version), force=True)
+
+            self.assertEqual(updated_version_obj.previous, SemanticVersioningScheme.parse_version(version))
+            self.assertEqual(updated_version_obj.new, SemanticVersioningScheme.parse_version(version))
+            self.assertEqual(
+                updated_version_obj.changed_files, [Path("README.md")]
+            )
+
+            content = readme_file_path.read_text(encoding="UTF-8")
+            self.assertEqual(content, TEMPLATE_UPGRADE_VERSION_MARKDOWN.format(version))
+
+            version_file_path.unlink()
+            readme_file_path.unlink()

From 1c484bd43646e31a8f32589066da71a7e085f3f5 Mon Sep 17 00:00:00 2001
From: Stefan Tolksdorf 
Date: Wed, 27 Sep 2023 19:08:46 +0200
Subject: [PATCH 16/41] Add test for get_current_version

---
 tests/version/commands/test_java.py | 24 +++++++++++++++++++-----
 1 file changed, 19 insertions(+), 5 deletions(-)

diff --git a/tests/version/commands/test_java.py b/tests/version/commands/test_java.py
index 7ae16dd4b..e6d2dda3c 100644
--- a/tests/version/commands/test_java.py
+++ b/tests/version/commands/test_java.py
@@ -17,7 +17,7 @@
 import unittest
 from pathlib import Path
 
-from pontos.testing import temp_file
+from pontos.testing import temp_directory, temp_file
 from pontos.version.commands import JavaVersionCommand
 from pontos.version.schemes import SemanticVersioningScheme
 
@@ -41,7 +41,7 @@
 
 class GetCurrentJavaVersionCommandTestCase(unittest.TestCase):
     def test_getting_version(self):
-        with temp_file(name="upgradeVersion.json", change_into=True):
+        with temp_directory(change_into=True):
             version_file_path = Path("upgradeVersion.json")
             version_file_path.write_text(
                 TEMPLATE_UPGRADE_VERSION_JSON, encoding="utf-8"
@@ -68,7 +68,7 @@ def test_getting_version(self):
 
 class VerifyJavaVersionCommandTestCase(unittest.TestCase):
     def test_verify_version(self):
-        with temp_file(name="upgradeVersion.json", change_into=True):
+        with temp_directory(change_into=True):
             version_file_path = Path("upgradeVersion.json")
             version_file_path.write_text(
                 TEMPLATE_UPGRADE_VERSION_JSON, encoding="utf-8"
@@ -90,7 +90,7 @@ def test_verify_version(self):
 
 class UpdateJavaVersionCommandTestCase(unittest.TestCase):
     def test_update_version(self):
-        with temp_file(name="upgradeVersion.json", change_into=True):
+        with temp_directory(change_into=True):
             version_file_path = Path("upgradeVersion.json")
             version_file_path.write_text(
                 TEMPLATE_UPGRADE_VERSION_JSON, encoding="utf-8"
@@ -120,7 +120,7 @@ def test_update_version(self):
             readme_file_path.unlink()
 
     def test_forced_update_version(self):
-        with temp_file(name="upgradeVersion.json", change_into=True):
+        with temp_directory(change_into=True):
             version_file_path = Path("upgradeVersion.json")
             version_file_path.write_text(
                 TEMPLATE_UPGRADE_VERSION_JSON, encoding="utf-8"
@@ -147,3 +147,17 @@ def test_forced_update_version(self):
 
             version_file_path.unlink()
             readme_file_path.unlink()
+
+
+class ProjectFileJavaVersionCommandTestCase(unittest.TestCase):
+    def test_project_file_not_found(self):
+        with temp_directory(change_into=True):
+            cmd = JavaVersionCommand(SemanticVersioningScheme)
+
+            self.assertFalse(cmd.project_found())
+
+    def test_project_file_found(self):
+        with temp_file(name="upgradeVersion.json", change_into=True):
+            cmd = JavaVersionCommand(SemanticVersioningScheme)
+
+            self.assertTrue(cmd.project_found())

From 1493f5ffe2a190c41de90aa7f680a20f20b95244 Mon Sep 17 00:00:00 2001
From: Stefan Tolksdorf 
Date: Wed, 27 Sep 2023 19:12:39 +0200
Subject: [PATCH 17/41] Add test for get_current_version

---
 tests/version/commands/test_java.py | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/tests/version/commands/test_java.py b/tests/version/commands/test_java.py
index e6d2dda3c..81454d39a 100644
--- a/tests/version/commands/test_java.py
+++ b/tests/version/commands/test_java.py
@@ -119,6 +119,34 @@ def test_update_version(self):
             version_file_path.unlink()
             readme_file_path.unlink()
 
+    def test_no_update_version(self):
+            version_file_path = Path("upgradeVersion.json")
+            version_file_path.write_text(
+                TEMPLATE_UPGRADE_VERSION_JSON, encoding="utf-8"
+            )
+
+            version = "2023.9.3"
+            readme_file_path = Path("README.md")
+            readme_file_path.write_text(
+                TEMPLATE_UPGRADE_VERSION_MARKDOWN.format(version), encoding="utf-8"
+            )
+
+            updated_version_obj = JavaVersionCommand(
+                SemanticVersioningScheme
+            ).update_version(SemanticVersioningScheme.parse_version(version))
+
+            self.assertEqual(updated_version_obj.previous, SemanticVersioningScheme.parse_version(version))
+            self.assertEqual(updated_version_obj.new, SemanticVersioningScheme.parse_version(new_version))
+            self.assertEqual(
+                updated_version_obj.changed_files, []
+            )
+
+            content = readme_file_path.read_text(encoding="UTF-8")
+            self.assertEqual(content, TEMPLATE_UPGRADE_VERSION_MARKDOWN.format(version))
+
+            version_file_path.unlink()
+            readme_file_path.unlink()
+
     def test_forced_update_version(self):
         with temp_directory(change_into=True):
             version_file_path = Path("upgradeVersion.json")

From 22cee71c2b8fe0507ec6b9db260f11fb7754552e Mon Sep 17 00:00:00 2001
From: Stefan Tolksdorf 
Date: Wed, 27 Sep 2023 19:14:42 +0200
Subject: [PATCH 18/41] Add test for get_current_version

---
 tests/version/commands/test_java.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/version/commands/test_java.py b/tests/version/commands/test_java.py
index 81454d39a..67058ce59 100644
--- a/tests/version/commands/test_java.py
+++ b/tests/version/commands/test_java.py
@@ -136,7 +136,7 @@ def test_no_update_version(self):
             ).update_version(SemanticVersioningScheme.parse_version(version))
 
             self.assertEqual(updated_version_obj.previous, SemanticVersioningScheme.parse_version(version))
-            self.assertEqual(updated_version_obj.new, SemanticVersioningScheme.parse_version(new_version))
+            self.assertEqual(updated_version_obj.new, SemanticVersioningScheme.parse_version(version))
             self.assertEqual(
                 updated_version_obj.changed_files, []
             )

From 20e6ac3c2200e2feef03e8ce64ab30364a002114 Mon Sep 17 00:00:00 2001
From: Stefan Tolksdorf 
Date: Wed, 27 Sep 2023 19:20:36 +0200
Subject: [PATCH 19/41] Add test for get_current_version

---
 tests/version/commands/test_java.py | 68 +++++++++++++++++++++--------
 1 file changed, 51 insertions(+), 17 deletions(-)

diff --git a/tests/version/commands/test_java.py b/tests/version/commands/test_java.py
index 67058ce59..474f9b454 100644
--- a/tests/version/commands/test_java.py
+++ b/tests/version/commands/test_java.py
@@ -50,7 +50,8 @@ def test_getting_version(self):
             version = "2023.9.3"
             readme_file_path = Path("README.md")
             readme_file_path.write_text(
-                TEMPLATE_UPGRADE_VERSION_MARKDOWN.format(version), encoding="utf-8"
+                TEMPLATE_UPGRADE_VERSION_MARKDOWN.format(version),
+                encoding="utf-8"
             )
 
             result_version = JavaVersionCommand(
@@ -77,7 +78,8 @@ def test_verify_version(self):
             version = "2023.9.3"
             readme_file_path = Path("README.md")
             readme_file_path.write_text(
-                TEMPLATE_UPGRADE_VERSION_MARKDOWN.format(version), encoding="utf-8"
+                TEMPLATE_UPGRADE_VERSION_MARKDOWN.format(version),
+                encoding="utf-8"
             )
 
             JavaVersionCommand(
@@ -93,13 +95,15 @@ def test_update_version(self):
         with temp_directory(change_into=True):
             version_file_path = Path("upgradeVersion.json")
             version_file_path.write_text(
-                TEMPLATE_UPGRADE_VERSION_JSON, encoding="utf-8"
+                TEMPLATE_UPGRADE_VERSION_JSON,
+                encoding="utf-8"
             )
 
             version = "2023.9.3"
             readme_file_path = Path("README.md")
             readme_file_path.write_text(
-                TEMPLATE_UPGRADE_VERSION_MARKDOWN.format(version), encoding="utf-8"
+                TEMPLATE_UPGRADE_VERSION_MARKDOWN.format(version),
+                encoding="utf-8"
             )
 
             new_version = "2023.9.4"
@@ -107,42 +111,64 @@ def test_update_version(self):
                 SemanticVersioningScheme
             ).update_version(SemanticVersioningScheme.parse_version(new_version))
 
-            self.assertEqual(updated_version_obj.previous, SemanticVersioningScheme.parse_version(version))
-            self.assertEqual(updated_version_obj.new, SemanticVersioningScheme.parse_version(new_version))
+            self.assertEqual(
+                updated_version_obj.previous,
+                SemanticVersioningScheme.parse_version(version)
+            )
+            self.assertEqual(
+                updated_version_obj.new,
+                SemanticVersioningScheme.parse_version(new_version)
+            )
             self.assertEqual(
                 updated_version_obj.changed_files, [Path("README.md")]
             )
 
             content = readme_file_path.read_text(encoding="UTF-8")
-            self.assertEqual(content, TEMPLATE_UPGRADE_VERSION_MARKDOWN.format(new_version))
+            self.assertEqual(
+                content,
+                TEMPLATE_UPGRADE_VERSION_MARKDOWN.format(new_version)
+            )
 
             version_file_path.unlink()
             readme_file_path.unlink()
 
     def test_no_update_version(self):
+        with temp_directory(change_into=True):
             version_file_path = Path("upgradeVersion.json")
             version_file_path.write_text(
-                TEMPLATE_UPGRADE_VERSION_JSON, encoding="utf-8"
+                TEMPLATE_UPGRADE_VERSION_JSON,
+                encoding="utf-8"
             )
 
             version = "2023.9.3"
             readme_file_path = Path("README.md")
             readme_file_path.write_text(
-                TEMPLATE_UPGRADE_VERSION_MARKDOWN.format(version), encoding="utf-8"
+                TEMPLATE_UPGRADE_VERSION_MARKDOWN.format(version),
+                encoding="utf-8"
             )
 
             updated_version_obj = JavaVersionCommand(
                 SemanticVersioningScheme
             ).update_version(SemanticVersioningScheme.parse_version(version))
 
-            self.assertEqual(updated_version_obj.previous, SemanticVersioningScheme.parse_version(version))
-            self.assertEqual(updated_version_obj.new, SemanticVersioningScheme.parse_version(version))
             self.assertEqual(
-                updated_version_obj.changed_files, []
+                updated_version_obj.previous,
+                SemanticVersioningScheme.parse_version(version)
+            )
+            self.assertEqual(
+                updated_version_obj.new,
+                SemanticVersioningScheme.parse_version(version)
+            )
+            self.assertEqual(
+                updated_version_obj.changed_files,
+                []
             )
 
             content = readme_file_path.read_text(encoding="UTF-8")
-            self.assertEqual(content, TEMPLATE_UPGRADE_VERSION_MARKDOWN.format(version))
+            self.assertEqual(
+                content,
+                TEMPLATE_UPGRADE_VERSION_MARKDOWN.format(version)
+            )
 
             version_file_path.unlink()
             readme_file_path.unlink()
@@ -151,21 +177,29 @@ def test_forced_update_version(self):
         with temp_directory(change_into=True):
             version_file_path = Path("upgradeVersion.json")
             version_file_path.write_text(
-                TEMPLATE_UPGRADE_VERSION_JSON, encoding="utf-8"
+                TEMPLATE_UPGRADE_VERSION_JSON,
+                encoding="utf-8"
             )
 
             version = "2023.9.3"
             readme_file_path = Path("README.md")
             readme_file_path.write_text(
-                TEMPLATE_UPGRADE_VERSION_MARKDOWN.format(version), encoding="utf-8"
+                TEMPLATE_UPGRADE_VERSION_MARKDOWN.format(version),
+                encoding="utf-8"
             )
 
             updated_version_obj = JavaVersionCommand(
                 SemanticVersioningScheme
             ).update_version(SemanticVersioningScheme.parse_version(version), force=True)
 
-            self.assertEqual(updated_version_obj.previous, SemanticVersioningScheme.parse_version(version))
-            self.assertEqual(updated_version_obj.new, SemanticVersioningScheme.parse_version(version))
+            self.assertEqual(
+                updated_version_obj.previous,
+                SemanticVersioningScheme.parse_version(version)
+            )
+            self.assertEqual(
+                updated_version_obj.new,
+                SemanticVersioningScheme.parse_version(version)
+            )
             self.assertEqual(
                 updated_version_obj.changed_files, [Path("README.md")]
             )

From 59d29a585399bebd63cbea0845d60869f690e9a1 Mon Sep 17 00:00:00 2001
From: Stefan Tolksdorf 
Date: Wed, 27 Sep 2023 19:26:01 +0200
Subject: [PATCH 20/41] Add test for get_current_version

---
 tests/version/commands/test_java.py | 45 ++++++++++++++++-------------
 1 file changed, 25 insertions(+), 20 deletions(-)

diff --git a/tests/version/commands/test_java.py b/tests/version/commands/test_java.py
index 474f9b454..ee1448cf3 100644
--- a/tests/version/commands/test_java.py
+++ b/tests/version/commands/test_java.py
@@ -51,7 +51,7 @@ def test_getting_version(self):
             readme_file_path = Path("README.md")
             readme_file_path.write_text(
                 TEMPLATE_UPGRADE_VERSION_MARKDOWN.format(version),
-                encoding="utf-8"
+                encoding="utf-8",
             )
 
             result_version = JavaVersionCommand(
@@ -59,8 +59,7 @@ def test_getting_version(self):
             ).get_current_version()
 
             self.assertEqual(
-                result_version,
-                SemanticVersioningScheme.parse_version(version)
+                result_version, SemanticVersioningScheme.parse_version(version)
             )
 
             version_file_path.unlink()
@@ -79,12 +78,12 @@ def test_verify_version(self):
             readme_file_path = Path("README.md")
             readme_file_path.write_text(
                 TEMPLATE_UPGRADE_VERSION_MARKDOWN.format(version),
-                encoding="utf-8"
+                encoding="utf-8",
             )
 
-            JavaVersionCommand(
-                SemanticVersioningScheme
-            ).verify_version(SemanticVersioningScheme.parse_version(version))
+            JavaVersionCommand(SemanticVersioningScheme).verify_version(
+                SemanticVersioningScheme.parse_version(version)
+            )
 
             version_file_path.unlink()
             readme_file_path.unlink()
@@ -103,7 +102,7 @@ def test_update_version(self):
             readme_file_path = Path("README.md")
             readme_file_path.write_text(
                 TEMPLATE_UPGRADE_VERSION_MARKDOWN.format(version),
-                encoding="utf-8"
+                encoding="utf-8",
             )
 
             new_version = "2023.9.4"
@@ -113,11 +112,11 @@ def test_update_version(self):
 
             self.assertEqual(
                 updated_version_obj.previous,
-                SemanticVersioningScheme.parse_version(version)
+                SemanticVersioningScheme.parse_version(version),
             )
             self.assertEqual(
                 updated_version_obj.new,
-                SemanticVersioningScheme.parse_version(new_version)
+                SemanticVersioningScheme.parse_version(new_version),
             )
             self.assertEqual(
                 updated_version_obj.changed_files, [Path("README.md")]
@@ -126,7 +125,7 @@ def test_update_version(self):
             content = readme_file_path.read_text(encoding="UTF-8")
             self.assertEqual(
                 content,
-                TEMPLATE_UPGRADE_VERSION_MARKDOWN.format(new_version)
+                TEMPLATE_UPGRADE_VERSION_MARKDOWN.format(new_version),
             )
 
             version_file_path.unlink()
@@ -153,21 +152,21 @@ def test_no_update_version(self):
 
             self.assertEqual(
                 updated_version_obj.previous,
-                SemanticVersioningScheme.parse_version(version)
+                SemanticVersioningScheme.parse_version(version),
             )
             self.assertEqual(
                 updated_version_obj.new,
-                SemanticVersioningScheme.parse_version(version)
+                SemanticVersioningScheme.parse_version(version),
             )
             self.assertEqual(
                 updated_version_obj.changed_files,
-                []
+                [],
             )
 
             content = readme_file_path.read_text(encoding="UTF-8")
             self.assertEqual(
                 content,
-                TEMPLATE_UPGRADE_VERSION_MARKDOWN.format(version)
+                TEMPLATE_UPGRADE_VERSION_MARKDOWN.format(version),
             )
 
             version_file_path.unlink()
@@ -190,22 +189,28 @@ def test_forced_update_version(self):
 
             updated_version_obj = JavaVersionCommand(
                 SemanticVersioningScheme
-            ).update_version(SemanticVersioningScheme.parse_version(version), force=True)
+            ).update_version(
+                SemanticVersioningScheme.parse_version(version), force=True
+            )
 
             self.assertEqual(
                 updated_version_obj.previous,
-                SemanticVersioningScheme.parse_version(version)
+                SemanticVersioningScheme.parse_version(version),
             )
             self.assertEqual(
                 updated_version_obj.new,
-                SemanticVersioningScheme.parse_version(version)
+                SemanticVersioningScheme.parse_version(version),
             )
             self.assertEqual(
-                updated_version_obj.changed_files, [Path("README.md")]
+                updated_version_obj.changed_files,
+                [Path("README.md")],
             )
 
             content = readme_file_path.read_text(encoding="UTF-8")
-            self.assertEqual(content, TEMPLATE_UPGRADE_VERSION_MARKDOWN.format(version))
+            self.assertEqual(
+                content,
+                TEMPLATE_UPGRADE_VERSION_MARKDOWN.format(version),
+            )
 
             version_file_path.unlink()
             readme_file_path.unlink()

From 4b989c00baa86893eca820d6527e93de6edc5aff Mon Sep 17 00:00:00 2001
From: Stefan Tolksdorf 
Date: Wed, 27 Sep 2023 19:29:47 +0200
Subject: [PATCH 21/41] Add test for get_current_version

---
 tests/version/commands/test_java.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tests/version/commands/test_java.py b/tests/version/commands/test_java.py
index ee1448cf3..ffe1e50ca 100644
--- a/tests/version/commands/test_java.py
+++ b/tests/version/commands/test_java.py
@@ -44,7 +44,8 @@ def test_getting_version(self):
         with temp_directory(change_into=True):
             version_file_path = Path("upgradeVersion.json")
             version_file_path.write_text(
-                TEMPLATE_UPGRADE_VERSION_JSON, encoding="utf-8"
+                TEMPLATE_UPGRADE_VERSION_JSON,
+                encoding="utf-8",
             )
 
             version = "2023.9.3"

From 2c0c63c2f1fe548ae64bf7714ffe5a6eb2768899 Mon Sep 17 00:00:00 2001
From: Stefan Tolksdorf 
Date: Wed, 27 Sep 2023 19:34:29 +0200
Subject: [PATCH 22/41] Add test for get_current_version

---
 tests/version/commands/test_java.py | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/tests/version/commands/test_java.py b/tests/version/commands/test_java.py
index ffe1e50ca..95279059a 100644
--- a/tests/version/commands/test_java.py
+++ b/tests/version/commands/test_java.py
@@ -95,8 +95,7 @@ def test_update_version(self):
         with temp_directory(change_into=True):
             version_file_path = Path("upgradeVersion.json")
             version_file_path.write_text(
-                TEMPLATE_UPGRADE_VERSION_JSON,
-                encoding="utf-8"
+                TEMPLATE_UPGRADE_VERSION_JSON, encoding="utf-8"
             )
 
             version = "2023.9.3"
@@ -109,7 +108,9 @@ def test_update_version(self):
             new_version = "2023.9.4"
             updated_version_obj = JavaVersionCommand(
                 SemanticVersioningScheme
-            ).update_version(SemanticVersioningScheme.parse_version(new_version))
+            ).update_version(
+                SemanticVersioningScheme.parse_version(new_version)
+            )
 
             self.assertEqual(
                 updated_version_obj.previous,
@@ -137,14 +138,14 @@ def test_no_update_version(self):
             version_file_path = Path("upgradeVersion.json")
             version_file_path.write_text(
                 TEMPLATE_UPGRADE_VERSION_JSON,
-                encoding="utf-8"
+                encoding="utf-8",
             )
 
             version = "2023.9.3"
             readme_file_path = Path("README.md")
             readme_file_path.write_text(
                 TEMPLATE_UPGRADE_VERSION_MARKDOWN.format(version),
-                encoding="utf-8"
+                encoding="utf-8",
             )
 
             updated_version_obj = JavaVersionCommand(
@@ -178,14 +179,14 @@ def test_forced_update_version(self):
             version_file_path = Path("upgradeVersion.json")
             version_file_path.write_text(
                 TEMPLATE_UPGRADE_VERSION_JSON,
-                encoding="utf-8"
+                encoding="utf-8",
             )
 
             version = "2023.9.3"
             readme_file_path = Path("README.md")
             readme_file_path.write_text(
                 TEMPLATE_UPGRADE_VERSION_MARKDOWN.format(version),
-                encoding="utf-8"
+                encoding="utf-8",
             )
 
             updated_version_obj = JavaVersionCommand(

From 7b65314b7ea771e31ff656994ce4197b9909428c Mon Sep 17 00:00:00 2001
From: Stefan Tolksdorf 
Date: Wed, 27 Sep 2023 19:43:55 +0200
Subject: [PATCH 23/41] Add test for get_current_version

---
 tests/version/commands/test_java.py | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/tests/version/commands/test_java.py b/tests/version/commands/test_java.py
index 95279059a..6cda24b18 100644
--- a/tests/version/commands/test_java.py
+++ b/tests/version/commands/test_java.py
@@ -18,6 +18,7 @@
 from pathlib import Path
 
 from pontos.testing import temp_directory, temp_file
+from pontos.version import VersionError
 from pontos.version.commands import JavaVersionCommand
 from pontos.version.schemes import SemanticVersioningScheme
 
@@ -89,6 +90,34 @@ def test_verify_version(self):
             version_file_path.unlink()
             readme_file_path.unlink()
 
+    def test_verify_version_does_not_match(self):
+        exp_err_msg = "No version found in the version.go file."
+        with temp_directory(
+                change_into=True
+        ), self.assertRaisesRegex(
+            VersionError,
+            exp_err_msg,
+        ):
+            version_file_path = Path("upgradeVersion.json")
+            version_file_path.write_text(
+                TEMPLATE_UPGRADE_VERSION_JSON, encoding="utf-8"
+            )
+
+            version = "2023.9.3"
+            new_version = "2023.9.3"
+            readme_file_path = Path("README.md")
+            readme_file_path.write_text(
+                TEMPLATE_UPGRADE_VERSION_MARKDOWN.format(version),
+                encoding="utf-8",
+            )
+
+            JavaVersionCommand(SemanticVersioningScheme).verify_version(
+                SemanticVersioningScheme.parse_version(new_version)
+            )
+
+            version_file_path.unlink()
+            readme_file_path.unlink()
+
 
 class UpdateJavaVersionCommandTestCase(unittest.TestCase):
     def test_update_version(self):

From cf453b6bc7c02a62fa9ae60f3380fe8345fc688a Mon Sep 17 00:00:00 2001
From: Stefan Tolksdorf 
Date: Wed, 27 Sep 2023 19:49:01 +0200
Subject: [PATCH 24/41] Add test for get_current_version

---
 tests/version/commands/test_java.py | 29 +++++++++++++++++++++++++++--
 1 file changed, 27 insertions(+), 2 deletions(-)

diff --git a/tests/version/commands/test_java.py b/tests/version/commands/test_java.py
index 6cda24b18..5b6cfdcc8 100644
--- a/tests/version/commands/test_java.py
+++ b/tests/version/commands/test_java.py
@@ -91,7 +91,12 @@ def test_verify_version(self):
             readme_file_path.unlink()
 
     def test_verify_version_does_not_match(self):
-        exp_err_msg = "No version found in the version.go file."
+        exp_err_msg = (
+            "Provided version 2023.9.4 does not match the "
+            + "current version 2023.9.3 in "
+            + "upgradeVersion.json."
+        )
+
         with temp_directory(
                 change_into=True
         ), self.assertRaisesRegex(
@@ -104,7 +109,7 @@ def test_verify_version_does_not_match(self):
             )
 
             version = "2023.9.3"
-            new_version = "2023.9.3"
+            new_version = "2023.9.4"
             readme_file_path = Path("README.md")
             readme_file_path.write_text(
                 TEMPLATE_UPGRADE_VERSION_MARKDOWN.format(version),
@@ -118,6 +123,26 @@ def test_verify_version_does_not_match(self):
             version_file_path.unlink()
             readme_file_path.unlink()
 
+    def test_verify_version_no_files_configured(self):
+        exp_err_msg = "no version found"
+        with temp_directory(
+                change_into=True
+        ), self.assertRaisesRegex(
+            VersionError,
+            exp_err_msg,
+        ):
+            version_file_path = Path("upgradeVersion.json")
+            version_file_path.write_text(
+                """{"files": []}""",
+                encoding="utf-8",
+            )
+
+            JavaVersionCommand(SemanticVersioningScheme).verify_version(
+                SemanticVersioningScheme.parse_version("2023.9.3")
+            )
+
+            version_file_path.unlink()
+
 
 class UpdateJavaVersionCommandTestCase(unittest.TestCase):
     def test_update_version(self):

From b52da668810483b90ec5169cc9ed0fb0f28d4a51 Mon Sep 17 00:00:00 2001
From: Stefan Tolksdorf 
Date: Wed, 27 Sep 2023 19:51:42 +0200
Subject: [PATCH 25/41] Add test for get_current_version

---
 tests/version/commands/test_java.py | 40 ++++++++++++++---------------
 1 file changed, 20 insertions(+), 20 deletions(-)

diff --git a/tests/version/commands/test_java.py b/tests/version/commands/test_java.py
index 5b6cfdcc8..a6b4d1818 100644
--- a/tests/version/commands/test_java.py
+++ b/tests/version/commands/test_java.py
@@ -67,6 +67,26 @@ def test_getting_version(self):
             version_file_path.unlink()
             readme_file_path.unlink()
 
+    def test_getting_version_no_files_configured(self):
+        exp_err_msg = "no version found"
+        with temp_directory(
+                change_into=True
+        ), self.assertRaisesRegex(
+            VersionError,
+            exp_err_msg,
+        ):
+            version_file_path = Path("upgradeVersion.json")
+            version_file_path.write_text(
+                """{"files": []}""",
+                encoding="utf-8",
+            )
+
+            JavaVersionCommand(
+                SemanticVersioningScheme
+            ).get_current_version()
+
+            version_file_path.unlink()
+
 
 class VerifyJavaVersionCommandTestCase(unittest.TestCase):
     def test_verify_version(self):
@@ -123,26 +143,6 @@ def test_verify_version_does_not_match(self):
             version_file_path.unlink()
             readme_file_path.unlink()
 
-    def test_verify_version_no_files_configured(self):
-        exp_err_msg = "no version found"
-        with temp_directory(
-                change_into=True
-        ), self.assertRaisesRegex(
-            VersionError,
-            exp_err_msg,
-        ):
-            version_file_path = Path("upgradeVersion.json")
-            version_file_path.write_text(
-                """{"files": []}""",
-                encoding="utf-8",
-            )
-
-            JavaVersionCommand(SemanticVersioningScheme).verify_version(
-                SemanticVersioningScheme.parse_version("2023.9.3")
-            )
-
-            version_file_path.unlink()
-
 
 class UpdateJavaVersionCommandTestCase(unittest.TestCase):
     def test_update_version(self):

From 82920a076629fb86ac20deb96f1ac8f520efdf76 Mon Sep 17 00:00:00 2001
From: Stefan Tolksdorf 
Date: Wed, 27 Sep 2023 19:55:53 +0200
Subject: [PATCH 26/41] Add test for get_current_version

---
 pontos/version/commands/_java.py    | 4 ++--
 tests/version/commands/test_java.py | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/pontos/version/commands/_java.py b/pontos/version/commands/_java.py
index 4eb30bbc8..0c42b141d 100644
--- a/pontos/version/commands/_java.py
+++ b/pontos/version/commands/_java.py
@@ -56,8 +56,8 @@ def verify_version(
         if last_version != str(version):
             raise VersionError(
                 f"Provided version {version} does not match the "
-                f"current version {last_version} in "
-                f"{self.project_file_path}."
+                f"current version {last_version} "
+                f"in '{self.project_file_path}'"
             )
 
     def update_version(
diff --git a/tests/version/commands/test_java.py b/tests/version/commands/test_java.py
index a6b4d1818..f35921a5a 100644
--- a/tests/version/commands/test_java.py
+++ b/tests/version/commands/test_java.py
@@ -112,9 +112,9 @@ def test_verify_version(self):
 
     def test_verify_version_does_not_match(self):
         exp_err_msg = (
-            "Provided version 2023.9.4 does not match the "
-            + "current version 2023.9.3 in "
-            + "upgradeVersion.json."
+            r"Provided version 2023\.9\.4 does not match the "
+            + r"current version 2023\.9\.3 "
+            + r"in '/tmp/.*/upgradeVersion\.json'"
         )
 
         with temp_directory(

From ab6c30ccbb95dc97701c562a467fd29cb415a1b2 Mon Sep 17 00:00:00 2001
From: Stefan Tolksdorf 
Date: Wed, 27 Sep 2023 19:57:14 +0200
Subject: [PATCH 27/41] Add test for get_current_version

---
 tests/version/commands/test_java.py | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/tests/version/commands/test_java.py b/tests/version/commands/test_java.py
index f35921a5a..4dfaab037 100644
--- a/tests/version/commands/test_java.py
+++ b/tests/version/commands/test_java.py
@@ -69,9 +69,7 @@ def test_getting_version(self):
 
     def test_getting_version_no_files_configured(self):
         exp_err_msg = "no version found"
-        with temp_directory(
-                change_into=True
-        ), self.assertRaisesRegex(
+        with temp_directory(change_into=True), self.assertRaisesRegex(
             VersionError,
             exp_err_msg,
         ):
@@ -117,9 +115,7 @@ def test_verify_version_does_not_match(self):
             + r"in '/tmp/.*/upgradeVersion\.json'"
         )
 
-        with temp_directory(
-                change_into=True
-        ), self.assertRaisesRegex(
+        with temp_directory(change_into=True), self.assertRaisesRegex(
             VersionError,
             exp_err_msg,
         ):

From ea4162dd985fa3ded2365a7b170cb0894b7f1b0c Mon Sep 17 00:00:00 2001
From: Stefan Tolksdorf 
Date: Wed, 27 Sep 2023 19:59:27 +0200
Subject: [PATCH 28/41] Add test for get_current_version

---
 tests/version/commands/test_java.py | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/tests/version/commands/test_java.py b/tests/version/commands/test_java.py
index 4dfaab037..b5333c335 100644
--- a/tests/version/commands/test_java.py
+++ b/tests/version/commands/test_java.py
@@ -79,9 +79,7 @@ def test_getting_version_no_files_configured(self):
                 encoding="utf-8",
             )
 
-            JavaVersionCommand(
-                SemanticVersioningScheme
-            ).get_current_version()
+            JavaVersionCommand(SemanticVersioningScheme).get_current_version()
 
             version_file_path.unlink()
 

From 24fa90925202dfb153044f3ff7c9979339fc180d Mon Sep 17 00:00:00 2001
From: Stefan Tolksdorf 
Date: Wed, 27 Sep 2023 20:07:38 +0200
Subject: [PATCH 29/41] Add test for get_current_version

---
 tests/version/commands/test_java.py | 43 +++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)

diff --git a/tests/version/commands/test_java.py b/tests/version/commands/test_java.py
index b5333c335..f37679d38 100644
--- a/tests/version/commands/test_java.py
+++ b/tests/version/commands/test_java.py
@@ -32,6 +32,16 @@
 }
 """
 
+TEMPLATE_UPGRADE_VERSION_WITH_LINE_JSON = """{
+  "files": [
+    {
+      "path": "README.md",
+      "line": {}
+    }
+  ]
+}
+"""
+
 TEMPLATE_UPGRADE_VERSION_MARKDOWN = """# Task service
 
 **task service**: Version {}
@@ -265,6 +275,39 @@ def test_forced_update_version(self):
             version_file_path.unlink()
             readme_file_path.unlink()
 
+    def test_update_version_upgrade_config_with_wrong_line_number(self):
+        exp_err_msg = (
+            r"Line has no version, "
+            r"file:'/tmp/.*/README\.md' "
+            r"lineNo:4 "
+            r"content:''"
+        )
+        with temp_directory(change_into=True), self.assertRaisesRegex(
+            VersionError,
+            exp_err_msg,
+        ):
+            version_file_path = Path("upgradeVersion.json")
+            version_file_path.write_text(
+                TEMPLATE_UPGRADE_VERSION_WITH_LINE_JSON.format("4"), encoding="utf-8"
+            )
+
+            version = "2023.9.3"
+            readme_file_path = Path("README.md")
+            readme_file_path.write_text(
+                TEMPLATE_UPGRADE_VERSION_MARKDOWN.format(version),
+                encoding="utf-8",
+            )
+
+            new_version = "2023.9.4"
+            JavaVersionCommand(
+                SemanticVersioningScheme
+            ).update_version(
+                SemanticVersioningScheme.parse_version(new_version)
+            )
+
+            version_file_path.unlink()
+            readme_file_path.unlink()
+
 
 class ProjectFileJavaVersionCommandTestCase(unittest.TestCase):
     def test_project_file_not_found(self):

From 288ed7c48dae4a9fcad4acf066b42d054b65d035 Mon Sep 17 00:00:00 2001
From: Stefan Tolksdorf 
Date: Wed, 27 Sep 2023 20:11:37 +0200
Subject: [PATCH 30/41] Add test for get_current_version

---
 tests/version/commands/test_java.py | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/tests/version/commands/test_java.py b/tests/version/commands/test_java.py
index f37679d38..eb006b8da 100644
--- a/tests/version/commands/test_java.py
+++ b/tests/version/commands/test_java.py
@@ -93,6 +93,19 @@ def test_getting_version_no_files_configured(self):
 
             version_file_path.unlink()
 
+    def test_getting_version_without_version_config(self):
+        exp_err_msg = (
+                r"No /tmp/.*/upgradeVersion\.json config file found\. "
+                r"This file is required for pontos"
+        )
+        with temp_directory(change_into=True), self.assertRaisesRegex(
+            VersionError,
+            exp_err_msg,
+        ):
+            JavaVersionCommand(
+                SemanticVersioningScheme
+            ).get_current_version()
+
 
 class VerifyJavaVersionCommandTestCase(unittest.TestCase):
     def test_verify_version(self):

From 917c819d03e7b7f7cf6695caa52277d9c88c878b Mon Sep 17 00:00:00 2001
From: Stefan Tolksdorf 
Date: Wed, 27 Sep 2023 20:18:16 +0200
Subject: [PATCH 31/41] Add test for get_current_version

---
 tests/version/commands/test_java.py | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/tests/version/commands/test_java.py b/tests/version/commands/test_java.py
index eb006b8da..f14c2a05e 100644
--- a/tests/version/commands/test_java.py
+++ b/tests/version/commands/test_java.py
@@ -16,6 +16,7 @@
 # along with this program.  If not, see .
 import unittest
 from pathlib import Path
+from string import Template
 
 from pontos.testing import temp_directory, temp_file
 from pontos.version import VersionError
@@ -32,15 +33,15 @@
 }
 """
 
-TEMPLATE_UPGRADE_VERSION_WITH_LINE_JSON = """{
+TEMPLATE_UPGRADE_VERSION_WITH_LINE_JSON = Template("""{
   "files": [
     {
       "path": "README.md",
-      "line": {}
+      "line": ${LINE_NO}
     }
   ]
 }
-"""
+""")
 
 TEMPLATE_UPGRADE_VERSION_MARKDOWN = """# Task service
 
@@ -301,7 +302,8 @@ def test_update_version_upgrade_config_with_wrong_line_number(self):
         ):
             version_file_path = Path("upgradeVersion.json")
             version_file_path.write_text(
-                TEMPLATE_UPGRADE_VERSION_WITH_LINE_JSON.format("4"), encoding="utf-8"
+                TEMPLATE_UPGRADE_VERSION_WITH_LINE_JSON.substitute(LINE_NO="4"),
+                encoding="utf-8",
             )
 
             version = "2023.9.3"

From 51e75b5199202923f8887ffcffafbb4d1c318582 Mon Sep 17 00:00:00 2001
From: Stefan Tolksdorf 
Date: Wed, 27 Sep 2023 20:22:02 +0200
Subject: [PATCH 32/41] Add test for get_current_version

---
 tests/version/commands/test_java.py | 20 +++++++++-----------
 1 file changed, 9 insertions(+), 11 deletions(-)

diff --git a/tests/version/commands/test_java.py b/tests/version/commands/test_java.py
index f14c2a05e..8430067a6 100644
--- a/tests/version/commands/test_java.py
+++ b/tests/version/commands/test_java.py
@@ -33,7 +33,8 @@
 }
 """
 
-TEMPLATE_UPGRADE_VERSION_WITH_LINE_JSON = Template("""{
+TEMPLATE_UPGRADE_VERSION_WITH_LINE_JSON = Template(
+    """{
   "files": [
     {
       "path": "README.md",
@@ -41,7 +42,8 @@
     }
   ]
 }
-""")
+"""
+)
 
 TEMPLATE_UPGRADE_VERSION_MARKDOWN = """# Task service
 
@@ -96,16 +98,14 @@ def test_getting_version_no_files_configured(self):
 
     def test_getting_version_without_version_config(self):
         exp_err_msg = (
-                r"No /tmp/.*/upgradeVersion\.json config file found\. "
-                r"This file is required for pontos"
+            r"No /tmp/.*/upgradeVersion\.json config file found\. "
+            r"This file is required for pontos"
         )
         with temp_directory(change_into=True), self.assertRaisesRegex(
             VersionError,
             exp_err_msg,
         ):
-            JavaVersionCommand(
-                SemanticVersioningScheme
-            ).get_current_version()
+            JavaVersionCommand(SemanticVersioningScheme).get_current_version()
 
 
 class VerifyJavaVersionCommandTestCase(unittest.TestCase):
@@ -292,7 +292,7 @@ def test_forced_update_version(self):
     def test_update_version_upgrade_config_with_wrong_line_number(self):
         exp_err_msg = (
             r"Line has no version, "
-            r"file:'/tmp/.*/README\.md' "
+            r"file:'README\.md' "
             r"lineNo:4 "
             r"content:''"
         )
@@ -314,9 +314,7 @@ def test_update_version_upgrade_config_with_wrong_line_number(self):
             )
 
             new_version = "2023.9.4"
-            JavaVersionCommand(
-                SemanticVersioningScheme
-            ).update_version(
+            JavaVersionCommand(SemanticVersioningScheme).update_version(
                 SemanticVersioningScheme.parse_version(new_version)
             )
 

From 78e1c4c9b1b8e89f3895fcb53128c7af3fa66057 Mon Sep 17 00:00:00 2001
From: Stefan Tolksdorf 
Date: Wed, 27 Sep 2023 20:24:40 +0200
Subject: [PATCH 33/41] Add test for get_current_version

---
 tests/version/commands/test_java.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/version/commands/test_java.py b/tests/version/commands/test_java.py
index 8430067a6..7d547833d 100644
--- a/tests/version/commands/test_java.py
+++ b/tests/version/commands/test_java.py
@@ -292,7 +292,7 @@ def test_forced_update_version(self):
     def test_update_version_upgrade_config_with_wrong_line_number(self):
         exp_err_msg = (
             r"Line has no version, "
-            r"file:'README\.md' "
+            r"file:'README.md' "
             r"lineNo:4 "
             r"content:''"
         )

From 157d8180769e7d7d224f04bee436e484849e0e70 Mon Sep 17 00:00:00 2001
From: Stefan Tolksdorf 
Date: Wed, 27 Sep 2023 20:25:04 +0200
Subject: [PATCH 34/41] Add test for get_current_version

---
 tests/version/commands/test_java.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/tests/version/commands/test_java.py b/tests/version/commands/test_java.py
index 7d547833d..da0a08291 100644
--- a/tests/version/commands/test_java.py
+++ b/tests/version/commands/test_java.py
@@ -291,10 +291,10 @@ def test_forced_update_version(self):
 
     def test_update_version_upgrade_config_with_wrong_line_number(self):
         exp_err_msg = (
-            r"Line has no version, "
-            r"file:'README.md' "
-            r"lineNo:4 "
-            r"content:''"
+            "Line has no version, "
+            "file:'README.md' "
+            "lineNo:4 "
+            "content:'\n'"
         )
         with temp_directory(change_into=True), self.assertRaisesRegex(
             VersionError,

From c6ef8404513f7f52e7d728e257733bed020cd8fa Mon Sep 17 00:00:00 2001
From: Stefan Tolksdorf 
Date: Thu, 28 Sep 2023 11:06:43 +0200
Subject: [PATCH 35/41] Add test for get_current_version

---
 pontos/version/commands/_java.py    | 12 ++++++------
 tests/version/commands/test_java.py | 14 ++++++++++++++
 2 files changed, 20 insertions(+), 6 deletions(-)

diff --git a/pontos/version/commands/_java.py b/pontos/version/commands/_java.py
index 0c42b141d..f3dc1de4a 100644
--- a/pontos/version/commands/_java.py
+++ b/pontos/version/commands/_java.py
@@ -85,7 +85,7 @@ def _update_version_files(self, new_version) -> List[Path]:
         changed_files: List[Path] = []
         for file_config in config["files"]:
             file_path = file_config["path"]
-            with open(Path.cwd() / file_path, "r") as input_file_handle:
+            with (Path.cwd() / file_path).open("r") as input_file_handle:
                 lines = input_file_handle.readlines()
                 line_number = file_config["line"]
                 version_line = lines[line_number - 1]
@@ -110,7 +110,7 @@ def _update_version_files(self, new_version) -> List[Path]:
                 changed_files.append(Path(file_config["path"]))
         return changed_files
 
-    def _load_config(self) -> Dict:
+    def _load_config(self) -> Dict[str, Any]:
         version_config_file = Path.cwd() / "upgradeVersion.json"
         if not version_config_file.exists():
             raise VersionError(
@@ -118,12 +118,12 @@ def _load_config(self) -> Dict:
                 "This file is required for pontos"
             )
 
-        with open(version_config_file, "r") as f:
+        with version_config_file.open("r") as f:
             json_string = f.read()
             config = json.loads(json_string)
             return config
 
-    def _read_versions_from_files(self) -> Dict:
+    def _read_versions_from_files(self) -> Dict[str, str]:
         config = self._load_config()
 
         file_versions = {}
@@ -133,7 +133,7 @@ def _read_versions_from_files(self) -> Dict:
             if not file.exists():
                 raise VersionError(f"No {file} file found.")
 
-            with open(file, "r") as f:
+            with file.open("r") as f:
                 line_number = file_config["line"]
                 readlines = f.readlines()
                 if line_number - 1 > len(readlines):
@@ -154,7 +154,7 @@ def _read_versions_from_files(self) -> Dict:
                 file_versions[file_path] = matches.group("version")
         return file_versions
 
-    def _verify_version(self, file_versions: Dict) -> str:
+    def _verify_version(self, file_versions: Dict[str, str]) -> str:
         last_version = ""
         last_file_name = ""
         for file_name, version in file_versions.items():
diff --git a/tests/version/commands/test_java.py b/tests/version/commands/test_java.py
index da0a08291..6bd5a867f 100644
--- a/tests/version/commands/test_java.py
+++ b/tests/version/commands/test_java.py
@@ -28,6 +28,10 @@
     {
       "path": "README.md",
       "line": 3
+    },
+    {
+      "path": "src/application.properties",
+      "line": 2
     }
   ]
 }
@@ -52,6 +56,10 @@
 ## starting the local 
 """
 
+TEMPLATE_UPGRADE_VERSION_WITH_VERSION_PROPERTIES = """# application
+sentry.release={}
+server.port=8080
+"""
 
 class GetCurrentJavaVersionCommandTestCase(unittest.TestCase):
     def test_getting_version(self):
@@ -122,6 +130,11 @@ def test_verify_version(self):
                 TEMPLATE_UPGRADE_VERSION_MARKDOWN.format(version),
                 encoding="utf-8",
             )
+            properties_file_path = Path("src/application.properties")
+            properties_file_path.write_text(
+                TEMPLATE_UPGRADE_VERSION_WITH_VERSION_PROPERTIES.format(version),
+                encoding="latin-1",
+            )
 
             JavaVersionCommand(SemanticVersioningScheme).verify_version(
                 SemanticVersioningScheme.parse_version(version)
@@ -129,6 +142,7 @@ def test_verify_version(self):
 
             version_file_path.unlink()
             readme_file_path.unlink()
+            properties_file_path.unlink()
 
     def test_verify_version_does_not_match(self):
         exp_err_msg = (

From f3562d08833a1fba8012885b592b83612c44920d Mon Sep 17 00:00:00 2001
From: Stefan Tolksdorf 
Date: Thu, 28 Sep 2023 11:09:43 +0200
Subject: [PATCH 36/41] Add test for get_current_version

---
 pontos/version/commands/_java.py    | 2 +-
 tests/version/commands/test_java.py | 4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/pontos/version/commands/_java.py b/pontos/version/commands/_java.py
index f3dc1de4a..7d00a09af 100644
--- a/pontos/version/commands/_java.py
+++ b/pontos/version/commands/_java.py
@@ -18,7 +18,7 @@
 import json
 import re
 from pathlib import Path
-from typing import Literal, Union, Dict, List
+from typing import Literal, Union, Dict, List, Any
 
 from ._command import VersionCommand
 from ..errors import VersionError
diff --git a/tests/version/commands/test_java.py b/tests/version/commands/test_java.py
index 6bd5a867f..83a8a9acb 100644
--- a/tests/version/commands/test_java.py
+++ b/tests/version/commands/test_java.py
@@ -132,7 +132,9 @@ def test_verify_version(self):
             )
             properties_file_path = Path("src/application.properties")
             properties_file_path.write_text(
-                TEMPLATE_UPGRADE_VERSION_WITH_VERSION_PROPERTIES.format(version),
+                TEMPLATE_UPGRADE_VERSION_WITH_VERSION_PROPERTIES.format(
+                    version
+                ),
                 encoding="latin-1",
             )
 

From 10d2fb987ea9a98828cd8698c3b5da501fea857d Mon Sep 17 00:00:00 2001
From: Stefan Tolksdorf 
Date: Thu, 28 Sep 2023 11:19:56 +0200
Subject: [PATCH 37/41] Add test for get_current_version

---
 tests/version/commands/test_java.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tests/version/commands/test_java.py b/tests/version/commands/test_java.py
index 83a8a9acb..663a1f194 100644
--- a/tests/version/commands/test_java.py
+++ b/tests/version/commands/test_java.py
@@ -61,6 +61,7 @@
 server.port=8080
 """
 
+
 class GetCurrentJavaVersionCommandTestCase(unittest.TestCase):
     def test_getting_version(self):
         with temp_directory(change_into=True):
@@ -131,6 +132,7 @@ def test_verify_version(self):
                 encoding="utf-8",
             )
             properties_file_path = Path("src/application.properties")
+            properties_file_path.mkdir(parents=True, exist_ok=True)
             properties_file_path.write_text(
                 TEMPLATE_UPGRADE_VERSION_WITH_VERSION_PROPERTIES.format(
                     version

From 188fd4a99b6a2bfbf6644fe30f099a565a3718fc Mon Sep 17 00:00:00 2001
From: Stefan Tolksdorf 
Date: Thu, 28 Sep 2023 11:23:02 +0200
Subject: [PATCH 38/41] Add test for get_current_version

---
 pontos/version/commands/_java.py    | 2 +-
 tests/version/commands/test_java.py | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/pontos/version/commands/_java.py b/pontos/version/commands/_java.py
index 7d00a09af..379c7e071 100644
--- a/pontos/version/commands/_java.py
+++ b/pontos/version/commands/_java.py
@@ -105,7 +105,7 @@ def _update_version_files(self, new_version) -> List[Path]:
                 )
 
                 content = "".join(lines)
-                with open(Path.cwd() / file_path, "w") as output_file_handle:
+                with (Path.cwd() / file_path).open("w") as output_file_handle:
                     output_file_handle.write(content)
                 changed_files.append(Path(file_config["path"]))
         return changed_files
diff --git a/tests/version/commands/test_java.py b/tests/version/commands/test_java.py
index 663a1f194..164bb2691 100644
--- a/tests/version/commands/test_java.py
+++ b/tests/version/commands/test_java.py
@@ -132,7 +132,7 @@ def test_verify_version(self):
                 encoding="utf-8",
             )
             properties_file_path = Path("src/application.properties")
-            properties_file_path.mkdir(parents=True, exist_ok=True)
+            Path("src").mkdir(parents=True, exist_ok=True)
             properties_file_path.write_text(
                 TEMPLATE_UPGRADE_VERSION_WITH_VERSION_PROPERTIES.format(
                     version

From e949a1645c0fbc49ce8c7bb8d420cf46bcb22895 Mon Sep 17 00:00:00 2001
From: Stefan Tolksdorf 
Date: Thu, 28 Sep 2023 11:30:30 +0200
Subject: [PATCH 39/41] Add test for get_current_version

---
 tests/version/commands/test_java.py | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/tests/version/commands/test_java.py b/tests/version/commands/test_java.py
index 164bb2691..4249b4afa 100644
--- a/tests/version/commands/test_java.py
+++ b/tests/version/commands/test_java.py
@@ -30,7 +30,7 @@
       "line": 3
     },
     {
-      "path": "src/application.properties",
+      "path": "application.properties",
       "line": 2
     }
   ]
@@ -131,8 +131,7 @@ def test_verify_version(self):
                 TEMPLATE_UPGRADE_VERSION_MARKDOWN.format(version),
                 encoding="utf-8",
             )
-            properties_file_path = Path("src/application.properties")
-            Path("src").mkdir(parents=True, exist_ok=True)
+            properties_file_path = Path("application.properties")
             properties_file_path.write_text(
                 TEMPLATE_UPGRADE_VERSION_WITH_VERSION_PROPERTIES.format(
                     version

From 038f1f4488ab02bcd8ef37984a83490aea603403 Mon Sep 17 00:00:00 2001
From: Stefan Tolksdorf 
Date: Thu, 28 Sep 2023 11:34:33 +0200
Subject: [PATCH 40/41] Add test for get_current_version

---
 tests/version/commands/test_java.py | 25 ++++++++++++++++++-------
 1 file changed, 18 insertions(+), 7 deletions(-)

diff --git a/tests/version/commands/test_java.py b/tests/version/commands/test_java.py
index 4249b4afa..766e90d67 100644
--- a/tests/version/commands/test_java.py
+++ b/tests/version/commands/test_java.py
@@ -23,7 +23,17 @@
 from pontos.version.commands import JavaVersionCommand
 from pontos.version.schemes import SemanticVersioningScheme
 
-TEMPLATE_UPGRADE_VERSION_JSON = """{
+TEMPLATE_UPGRADE_VERSION_SINGLE_JSON = """{
+  "files": [
+    {
+      "path": "README.md",
+      "line": 3
+    }
+  ]
+}
+"""
+
+TEMPLATE_UPGRADE_VERSION_MULTI_JSON = """{
   "files": [
     {
       "path": "README.md",
@@ -67,7 +77,7 @@ def test_getting_version(self):
         with temp_directory(change_into=True):
             version_file_path = Path("upgradeVersion.json")
             version_file_path.write_text(
-                TEMPLATE_UPGRADE_VERSION_JSON,
+                TEMPLATE_UPGRADE_VERSION_SINGLE_JSON,
                 encoding="utf-8",
             )
 
@@ -122,7 +132,7 @@ def test_verify_version(self):
         with temp_directory(change_into=True):
             version_file_path = Path("upgradeVersion.json")
             version_file_path.write_text(
-                TEMPLATE_UPGRADE_VERSION_JSON, encoding="utf-8"
+                TEMPLATE_UPGRADE_VERSION_MULTI_JSON, encoding="utf-8"
             )
 
             version = "2023.9.3"
@@ -139,6 +149,7 @@ def test_verify_version(self):
                 encoding="latin-1",
             )
 
+
             JavaVersionCommand(SemanticVersioningScheme).verify_version(
                 SemanticVersioningScheme.parse_version(version)
             )
@@ -160,7 +171,7 @@ def test_verify_version_does_not_match(self):
         ):
             version_file_path = Path("upgradeVersion.json")
             version_file_path.write_text(
-                TEMPLATE_UPGRADE_VERSION_JSON, encoding="utf-8"
+                TEMPLATE_UPGRADE_VERSION_SINGLE_JSON, encoding="utf-8"
             )
 
             version = "2023.9.3"
@@ -184,7 +195,7 @@ def test_update_version(self):
         with temp_directory(change_into=True):
             version_file_path = Path("upgradeVersion.json")
             version_file_path.write_text(
-                TEMPLATE_UPGRADE_VERSION_JSON, encoding="utf-8"
+                TEMPLATE_UPGRADE_VERSION_SINGLE_JSON, encoding="utf-8"
             )
 
             version = "2023.9.3"
@@ -226,7 +237,7 @@ def test_no_update_version(self):
         with temp_directory(change_into=True):
             version_file_path = Path("upgradeVersion.json")
             version_file_path.write_text(
-                TEMPLATE_UPGRADE_VERSION_JSON,
+                TEMPLATE_UPGRADE_VERSION_SINGLE_JSON,
                 encoding="utf-8",
             )
 
@@ -267,7 +278,7 @@ def test_forced_update_version(self):
         with temp_directory(change_into=True):
             version_file_path = Path("upgradeVersion.json")
             version_file_path.write_text(
-                TEMPLATE_UPGRADE_VERSION_JSON,
+                TEMPLATE_UPGRADE_VERSION_SINGLE_JSON,
                 encoding="utf-8",
             )
 

From 830dfbe079794bd31bc09797bb3a90b29dde77be Mon Sep 17 00:00:00 2001
From: Stefan Tolksdorf 
Date: Thu, 28 Sep 2023 11:36:14 +0200
Subject: [PATCH 41/41] Add test for get_current_version

---
 tests/version/commands/test_java.py | 1 -
 1 file changed, 1 deletion(-)

diff --git a/tests/version/commands/test_java.py b/tests/version/commands/test_java.py
index 766e90d67..50f2a8ece 100644
--- a/tests/version/commands/test_java.py
+++ b/tests/version/commands/test_java.py
@@ -149,7 +149,6 @@ def test_verify_version(self):
                 encoding="latin-1",
             )
 
-
             JavaVersionCommand(SemanticVersioningScheme).verify_version(
                 SemanticVersioningScheme.parse_version(version)
             )