<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by MEENU SINGH on Medium]]></title>
        <description><![CDATA[Stories by MEENU SINGH on Medium]]></description>
        <link>https://medium.com/@2024sl93093?source=rss-9d3ff9979a05------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*VY5igBZIp9IVg4x5</url>
            <title>Stories by MEENU SINGH on Medium</title>
            <link>https://medium.com/@2024sl93093?source=rss-9d3ff9979a05------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 18:51:00 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@2024sl93093/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Selenium Automation Testing for Beginners: A Hands-On Guide to Automation Testing]]></title>
            <link>https://medium.com/@2024sl93093/selenium-automation-testing-for-beginners-a-hands-on-guide-to-automation-testing-e653ac709a76?source=rss-9d3ff9979a05------2</link>
            <guid isPermaLink="false">https://medium.com/p/e653ac709a76</guid>
            <category><![CDATA[junit]]></category>
            <category><![CDATA[webdriver]]></category>
            <category><![CDATA[automation-testing]]></category>
            <category><![CDATA[selenium]]></category>
            <category><![CDATA[java]]></category>
            <dc:creator><![CDATA[MEENU SINGH]]></dc:creator>
            <pubDate>Fri, 23 May 2025 17:28:00 GMT</pubDate>
            <atom:updated>2025-05-30T16:31:52.968Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nQDdGN9mmsdqpeDxbi2fOg.png" /></figure><h3>Introduction</h3><p>As software gets more complex, testing becomes harder and more important. Manual testing is good for exploring new features but can be slow and repetitive when checking old features again. Automation testing helps by letting us write scripts that act like real users — this saves time, covers more tests, and gives reliable results.</p><h3>👋 Welcome to the World of Automation</h3><p>If you’ve ever heard, <em>“Just automate it with Selenium,”</em> and wondered how — you’re in the right place. This guide is crafted for absolute beginners and outlines everything from the <strong>purpose of automation testing</strong> to <strong>writing and executing your first Selenium script</strong>.</p><h3>Importance of Test Automation in Modern Software Development</h3><p>Test automation plays a vital role in today’s fast-paced software development landscape. Here’s why it has become indispensable:</p><h3>⚡ Rapid Feedback and Speed</h3><p>Automated tests run significantly faster than manual ones, enabling quick feedback and early defect detection. This is vital for Agile teams and CI/CD pipelines where code changes are frequent.</p><h3>🎯 Precision and Reliability</h3><p>Automation removes human error by executing tests with exact steps every time. This ensures reliable, consistent, and repeatable results — ideal for maintaining quality.</p><h3>🔁 Seamless Regression Coverage</h3><p>As software evolves, new changes can break existing features. Automated regression tests protect against this by verifying that previous functionality still works correctly.</p><h3>🚀 Core Enabler of CI/CD</h3><p>Automated tests are the backbone of CI/CD pipelines. They validate every code change in real time, ensuring only stable and verified code reaches production.</p><h3>💸 Long-Term Cost Efficiency</h3><p>Although the initial setup requires investment, automation drastically reduces repetitive manual efforts, freeing up testers to focus on critical and exploratory testing.</p><h3>🧪 Concurrent Multi-Environment Testing</h3><p>Automation allows simultaneous execution across various environments, configurations, and devices — speeding up cycles and catching compatibility issues early.</p><h3>🧪 Introducing Selenium</h3><p>Selenium is a <strong>free and open-source</strong> framework for automating browser-based applications. It is widely used by QA engineers and developers for functional and regression testing.</p><h4>Why Selenium?</h4><ul><li>Multi-language support (Java, Python, C#, JavaScript)</li><li>Works with all major browsers (Chrome, Firefox, Safari, Edge)</li><li>Integrates with tools like TestNG, JUnit, Maven, Jenkins, etc.</li><li>Backed by a large global community and rich ecosystem</li></ul><h3>🧩 Components of Selenium</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SQ_7RFmso3AE1hCsqC2PlQ.png" /><figcaption>Key Components Of Selenium</figcaption></figure><h3>🔹 Selenium WebDriver</h3><p>If you need to create <strong>robust, browser-based regression automation suites and tests</strong>, and <strong>scale or distribute scripts</strong> across different environments, Selenium WebDriver is the tool to use.<br> It is a <strong>collection of language-specific bindings</strong> (Java, Python, C#, etc.) that drives browsers <strong>natively</strong>, providing precise control and flexibility for automation.</p><h3>🔹 Selenium IDE</h3><p>Perfect for <strong>quick bug reproduction</strong> and <strong>automation-assisted exploratory testing</strong>, Selenium IDE is a browser add-on (available for <strong>Chrome, Firefox, and Edge</strong>) that provides a <strong>simple record-and-playback</strong> feature.<br> It’s best suited for beginners or for creating fast, scriptless test cases.</p><h3>🔹 Selenium Grid</h3><p>To <strong>scale your testing</strong> by running tests on <strong>multiple machines in parallel</strong>, Selenium Grid is the ideal component.<br> It helps manage <strong>different browser and OS combinations</strong> from a <strong>central point</strong>, making it perfect for <strong>distributed testing</strong> and continuous integration setups.</p><h3>⚙️ Setting Up Selenium (Java Edition)</h3><p>Let’s walk through the basic setup required for writing Selenium automation using Java:</p><h4>Step 1: Install Java Development Kit (JDK)</h4><ul><li>Download from: <a href="https://www.oracle.com/java/technologies/javase-jdk11-downloads.html">Oracle JDK</a></li><li>Set JAVA_HOME environment variable</li><li>Verify: java -version</li></ul><h4>Step 2: Install Eclipse IDE</h4><ul><li>Download from: eclipse.org</li><li>Open and configure your workspace</li></ul><h4>Step 3: Configure Maven Dependencies</h4><pre>&lt;dependencies&gt;<br>    &lt;!-- Selenium Java library --&gt;<br>    &lt;dependency&gt;<br>        &lt;groupId&gt;org.seleniumhq.selenium&lt;/groupId&gt;<br>        &lt;artifactId&gt;selenium-java&lt;/artifactId&gt;<br>        &lt;version&gt;4.18.1&lt;/version&gt;<br>    &lt;/dependency&gt;<br><br>    &lt;!-- WebDriverManager for automatic driver management --&gt;<br>    &lt;dependency&gt;<br>        &lt;groupId&gt;io.github.bonigarcia&lt;/groupId&gt;<br>        &lt;artifactId&gt;webdrivermanager&lt;/artifactId&gt;<br>        &lt;version&gt;5.6.4&lt;/version&gt;<br>    &lt;/dependency&gt;<br>&lt;/dependencies&gt;</pre><h4>Why These Dependencies?</h4><ul><li>selenium-java: Gives access to WebDriver APIs to automate the browser.</li><li>webdrivermanager: Automatically downloads and configures the right browser driver.</li></ul><h3>Here’s how your project directory should look:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J-WQUoOL8DBftcH_wQUuUg.png" /></figure><h3>✍️ Your First Selenium Script — Ajio Website Test</h3><p>Let’s dive into a practical example that shows how Selenium can automate real user actions on Ajio’s website. This script navigates to the women’s section, searches for dresses, and opens the first product — all fully automated with just a few lines of Java code.</p><pre>package com.example.seleniumguide;<br><br>import org.openqa.selenium.By;<br>import org.openqa.selenium.WebDriver;<br>import org.openqa.selenium.WebElement;<br>import org.openqa.selenium.chrome.ChromeDriver;<br>import org.openqa.selenium.chrome.ChromeOptions;<br>import io.github.bonigarcia.wdm.WebDriverManager;<br>import org.openqa.selenium.support.ui.ExpectedConditions;<br>import org.openqa.selenium.support.ui.WebDriverWait;<br><br>import java.time.Duration;<br><br>public class AjioTest {<br>    public static void main(String[] args) {<br>        WebDriverManager.chromedriver().setup();<br><br>        ChromeOptions options = new ChromeOptions();<br>        options.addArguments(&quot;start-maximized&quot;);<br>        options.addArguments(&quot;user-agent=Mozilla/5.0&quot;);<br><br>        WebDriver driver = new ChromeDriver(options);<br><br>        try {<br>            WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(10));<br><br>            // Open Ajio homepage<br>            driver.get(&quot;https://www.ajio.com/&quot;);<br><br>            // Click on the &quot;WOMEN&quot; link<br>            WebElement womenLink = wait.until(ExpectedConditions.elementToBeClickable(By.linkText(&quot;WOMEN&quot;)));<br>            womenLink.click();<br><br>            // Wait for the search box to be visible on the WOMEN page<br>            WebElement searchBox = wait.until(ExpectedConditions.visibilityOfElementLocated(By.name(&quot;searchVal&quot;)));<br><br>            // Search for &quot;dresses&quot;<br>            searchBox.sendKeys(&quot;dresses&quot;);<br>            searchBox.submit(); // Submit the search form<br><br>            // Wait for the search results to load and show products<br>            wait.until(ExpectedConditions.visibilityOfElementLocated(By.cssSelector(&quot;div.listing&quot;)));<br><br>            // Click on the first product in the search results<br>            WebElement firstProduct = driver.findElement(By.cssSelector(&quot;div.listing div.item&quot;));<br>            firstProduct.click();<br><br>            // Wait a bit so user can see product page opened<br>            Thread.sleep(5000);<br><br>        } catch (Exception e) {<br>            e.printStackTrace();<br>        } finally {<br>            driver.quit();<br>        }<br>    }<br>}</pre><p><strong>Breaking Down the Key Components of Our Ajio Selenium Automation Script</strong></p><ol><li><strong>WebDriverManager Setup</strong></li></ol><pre>WebDriverManager.chromedriver().setup();</pre><p>This handle utility automatically downloads and sets up the correct ChromeDriver version for your browser. It saves you from manual driver management headaches.</p><p><strong>2. Browser Configuration with ChromeOptions</strong></p><pre>ChromeOptions options = new ChromeOptions();<br>options.addArguments(&quot;start-maximized&quot;);<br>options.addArguments(&quot;user-agent=Mozilla/5.0&quot;);</pre><p>Here, we customize the Chrome browser to open maximized and use a common user-agent string. This helps mimic real user behavior and sometimes avoids detection as a bot.</p><p><strong>3. Initializing WebDriver</strong></p><pre>WebDriver driver = new ChromeDriver(options);</pre><p>This launches a new Chrome browser instance using the options defined above. It’s your automation tool’s gateway to controlling the browser.</p><p><strong>4. Explicit Waits with WebDriverWait</strong></p><pre>WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(10));</pre><p>Using explicit waits is crucial in Selenium. This object pauses the script until certain elements appear or become clickable, preventing errors due to slow page loading</p><p><strong>5. Navigating and Interacting with Web Elements</strong></p><pre>driver.get(&quot;https://www.ajio.com/&quot;);<br>WebElement womenLink = wait.until(ExpectedConditions.elementToBeClickable(By.linkText(&quot;WOMEN&quot;)));<br>womenLink.click();</pre><p>We open Ajio’s homepage, wait for the “WOMEN” link to be clickable, then click it. Waiting ensures that the element is ready before interacting.</p><p><strong>6. Searching for Products</strong></p><pre>WebElement searchBox = wait.until(ExpectedConditions.visibilityOfElementLocated(By.name(&quot;searchVal&quot;)));<br>searchBox.sendKeys(&quot;dresses&quot;);<br>searchBox.submit();</pre><p>After navigating to the women’s section, we wait for the search box, type “dresses,” and submit the form to get search results.</p><p><strong>7. Selecting the First Product</strong></p><pre>wait.until(ExpectedConditions.visibilityOfElementLocated(By.cssSelector(&quot;div.listing&quot;)));<br>WebElement firstProduct = driver.findElement(By.cssSelector(&quot;div.listing div.item&quot;));<br>firstProduct.click();</pre><p>Once results load, we wait for the product listing, then click the first product to open its details page.</p><ol><li><strong>Clean-up</strong></li></ol><pre>driver.quit();</pre><p>Finally, we close the browser session, freeing up resources.</p><h4>🧾 View Full Code on GitHub</h4><p>You can find the complete project files and updates here:</p><p><a href="https://github.com/meenu155/seleniumguide">https://github.com/meenu155/seleniumguide</a></p><h3>📝 Summary</h3><p>In this guide, we explored the fundamentals of web automation testing with Selenium. From understanding why automation is crucial in modern development to setting up a Selenium project in Java, we walked through each step — culminating in a practical Ajio website test script. You learned how to launch browsers, wait for elements, interact with pages, and automate real-world user flows.</p><p>Whether you’re a beginner looking to break into test automation or a developer aiming to write more reliable tests, Selenium offers a flexible and powerful foundation to build on.</p><h3>🎯 Final Thoughts</h3><p>Selenium is more than just a testing tool — it’s a gateway to smarter, faster, and more consistent software development. With a bit of practice, you’ll be creating advanced test scenarios, integrating CI/CD pipelines, and boosting software quality across projects.</p><h3>🚀 What’s Next?</h3><p>Here are a few great next steps:</p><p>✅ Automate login and registration forms<br>✅ Explore TestNG or JUnit for structured testing<br>✅ Integrate with Jenkins to build CI/CD pipelines</p><h3>💬 Let’s Connect!</h3><p>Did this guide help you get started with Selenium?<br> Have questions or your own tips to share?<br> Drop a comment — I’d love to hear from you and help you grow on this exciting automation journey! 🚀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e653ac709a76" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Automating Java Application with code review with SonarCloud,CI/CD Pipeline with GitHub Actions &…]]></title>
            <link>https://medium.com/@2024sl93093/automating-java-application-with-code-review-with-sonarcloud-ci-cd-pipeline-with-github-actions-3ee91a0f48a5?source=rss-9d3ff9979a05------2</link>
            <guid isPermaLink="false">https://medium.com/p/3ee91a0f48a5</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[maven]]></category>
            <category><![CDATA[sonarcloud]]></category>
            <category><![CDATA[docker]]></category>
            <dc:creator><![CDATA[MEENU SINGH]]></dc:creator>
            <pubDate>Sat, 03 May 2025 04:33:03 GMT</pubDate>
            <atom:updated>2025-05-03T04:33:03.630Z</atom:updated>
            <content:encoded><![CDATA[<h3>Automating Java Application with code review with SonarCloud,CI/CD Pipeline with GitHub Actions &amp; Docker</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VkrTFw_iRmzy-_dCxi0stw.png" /><figcaption>DevOps Stages</figcaption></figure><p>What if every time you pushed code, it built itself?<br> What if every time you created a pull request, your application tested itself, packaged itself, and even deployed itself — without you lifting a finger?</p><p>Imagine a world where you no longer wait for manual builds, worry about missed tests, or stress over deployment steps. Instead, every change you make flows automatically from idea to production with precision, speed, and reliability.</p><p>That’s the magic of a well-built <strong>CI/CD pipeline</strong>.<br> And in this article, I’ll show you how you can bring that magic to your <strong>Java applications</strong> using <strong>GitHub Actions</strong>, <strong>Docker</strong>, and a clean, modern workflow — with code review automation built right in.</p><p>Let’s dive into how you can automate your entire Java delivery process, step-by-step! 🚀</p><h3>Why Automate the Java Application Workflow?</h3><p>Modern software delivery demands <strong>speed, reliability, and scalability</strong>. That’s where a <strong>DevOps pipeline</strong> comes in — a repeatable, automated system that builds, tests, packages, and deploys applications seamlessly.</p><p>By automating your CI/CD process, you can:</p><ul><li>Detect bugs early with automated testing</li><li>Deploy faster with fewer manual steps</li><li>Deliver a smoother, more reliable user experience</li></ul><h3>Prerequisites</h3><p>To proceed, you should be familiar with the following technologies and platforms:</p><h4>1. Core Technologies</h4><ul><li><strong>Kubernetes</strong>: Introductory tutorials are available here:<br> <a href="https://kubernetes.io/docs/tutorials">Kubernetes Tutorials</a></li><li><strong>Docker</strong>: Start learning here:<br> <a href="https://docs.docker.com/get-started">Docker Getting Started Guide</a></li></ul><h4>2. Cloud Platform</h4><ul><li><strong>SAP Business Technology Platform (SAP BTP)</strong>:<br> We will use SAP BTP for our cloud environment.</li></ul><h4>3. Kubernetes Runtime</h4><ul><li><strong>Kyma Runtime</strong>:<br> Kyma is used as the Kubernetes-based runtime for deploying services on SAP BTP.</li></ul><h3>Technologies Used</h3><ul><li><strong>GitHub Actions</strong>: To automate the CI/CD pipeline (build, test, Docker build, deployment</li><li><strong>Maven</strong>: For building the Java application and managing dependencies.</li><li><strong>Docker</strong>: For containerizing the Java application into deployable images.</li><li><strong>Kubernetes (Kyma)</strong>: For deploying and scaling the Dockerized application in a cloud-native environment.</li></ul><h3>CI/CD Pipeline Workflow Overview</h3><p>The pipeline is organized into four key stages:</p><h3>🛠 Build</h3><ul><li>Checkout code</li><li>Set up JDK</li><li>Build with Maven</li><li>Upload artifacts</li></ul><h3>🐳 Docker</h3><ul><li>Build and push Docker image</li></ul><h3>✅ Test</h3><ul><li>Run JUnit tests</li></ul><h3>🚀 Deployment</h3><ul><li>Deploy to a Kubernetes (Kyma) cluster using kubectl</li></ul><h3>Setup Steps</h3><h4>Step 1: Create an SAP BTP Trial Account</h4><ul><li>Follow this guide to create a trial account:<br> <a href="https://developers.sap.com/tutorials/hcp-create-trial-account.html">Create SAP BTP Trial Account</a></li></ul><h4>Step 2: Enable Kyma Runtime</h4><ul><li>Set up Kyma in your BTP account using this tutorial:<br> <a href="https://developers.sap.com/tutorials/cp-kyma-getting-started.html">Getting Started with Kyma</a></li></ul><h4>Step 3: Create a Service Account in Kyma</h4><ul><li>Learn how to create a service account here:<br> <a href="https://developers.sap.com/tutorials/kyma-create-service-account.html">Create Kyma Service Account</a></li></ul><h3>Project Folder Structure</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1004/1*d3jTwUu086NFXWDeZXcGaQ.png" /></figure><h3>🚀 CI/CD Pipeline with GitHub Actions</h3><p>This project uses GitHub Actions to automate the full CI/CD workflow — including <strong>build</strong>, <strong>test</strong>, <strong>Docker image creation</strong>, and <strong>deployment to a Kyma (SAP BTP) Kubernetes cluster</strong>.</p><h3>📝 Workflow File: .github/workflows/ci-cd.yml</h3><pre>name: ci/cd flow</pre><pre>on:<br>  push:<br>    branches: [ &quot;main&quot; ]<br>  pull_request:<br>    branches: [ &quot;main&quot; ]</pre><pre>jobs:<br>  build:<br>    runs-on: ubuntu-latest</pre><pre>    steps:<br>      - uses: actions/checkout@v4</pre><pre>      - name: Set up JDK 17<br>        uses: actions/setup-java@v4<br>        with:<br>          java-version: &#39;17&#39;<br>          distribution: &#39;temurin&#39;<br>          cache: maven</pre><pre>      - name: Build with Maven<br>        run: mvn clean install</pre><pre>      - name: Upload Build Artifacts<br>        uses: actions/upload-artifact@v4<br>        with:<br>          name: jar-artifact<br>          path: target/*.jar</pre><pre>  test:<br>    runs-on: ubuntu-latest<br>    needs: build  # Test only runs if Build is successful</pre><pre>    steps:<br>      - uses: actions/checkout@v4</pre><pre>      - name: Set up JDK 17<br>        uses: actions/setup-java@v4<br>        with:<br>          java-version: &#39;17&#39;<br>          distribution: &#39;temurin&#39;<br>          cache: maven</pre><pre>      - name: Run JUnit Tests with Maven<br>        run: mvn test</pre><pre>  docker:<br>    runs-on: ubuntu-latest<br>    needs: test  # Docker build only runs if Tests pass</pre><pre>    steps:<br>      - uses: actions/checkout@v4</pre><pre>      - name: Set up JDK 17<br>        uses: actions/setup-java@v4<br>        with:<br>          java-version: &#39;17&#39;<br>          distribution: &#39;temurin&#39;<br>          cache: maven</pre><pre>      - name: Build with Maven<br>        run: mvn clean install</pre><pre>      - name: Build and Push docker image<br>        uses: mr-smithers-excellent/docker-build-push@v5<br>        with:<br>          image: 2024sl93093/springbootimage<br>          tags: latest<br>          registry: docker.io<br>          dockerfile: Dockerfile<br>          username: ${{ secrets.DOCKER_USERNAME }}<br>          password: ${{ secrets.DOCKER_TOKEN }}<br>  deployment:<br>    runs-on: ubuntu-latest<br>    needs: docker<br>    steps:<br>      - uses: actions/checkout@v4<br>      - name: Set up kubectl<br>        uses: azure/setup-kubectl@v3<br>        with:<br>            version: &#39;latest&#39;<br>      - name: Deploy to Kyma Cluster<br>        run: |<br>          echo &quot;${{ secrets.KUBECONFIG }}&quot; &gt; kubeconfig.yaml<br>          export KUBECONFIG=$(pwd)/kubeconfig.yaml<br>          kubectl apply -f app.yaml<br>          kubectl rollout restart deployment palindromechecker</pre><h3>✅ GitHub Actions Pipeline Stages (from maven.yml)</h3><p>Your pipeline is triggered <strong>on push</strong>, and it follows this sequence:</p><h4>1. Build Stage</h4><ul><li><strong>What it does</strong>: Compiles the Java project using Maven.</li><li><strong>Files involved</strong>: pom.xml, src/main/java, and src/main/resources</li><li><strong>Tools used</strong>: Maven (mvn clean install)</li><li><strong>Purpose</strong>: To make sure the code compiles and produces a .jar or .war file in the target/ directory.</li></ul><h4>2. Test Stage</h4><ul><li><strong>What it does</strong>: Runs unit or integration tests defined under src/test/java.</li><li><strong>Tools used</strong>: Junit.</li><li><strong>Purpose</strong>: To verify the correctness of the code before proceeding to packaging or deployment.</li></ul><h4>3. Docker Stage</h4><ul><li><strong>What it does</strong>: Builds a Docker image using the Dockerfile.</li><li><strong>Files involved</strong>: Dockerfile, output from target/</li><li><strong>Commands likely used</strong>: docker build -t my-app .</li><li><strong>Purpose</strong>: Containerizes the application for deployment on Kubernetes (Kyma).</li></ul><h3>4. Deployment Stage</h3><p><strong>What it does</strong>:<br> Deploys the Dockerized application to a Kubernetes cluster on Kyma (SAP BTP runtime).</p><p><strong>Files involved</strong>:</p><ul><li>app.yaml – Contains Kubernetes deployment and service definitions.</li><li>pipeline-kubeconfig.yaml – Configures access to the Kyma cluster.</li><li>service-account.yaml – Defines necessary access permissions for the deployment.</li><li>create-kuber.sh – Shell script that applies Kubernetes manifests to the cluster.</li></ul><h3>🧾 Kubernetes Deployment Manifest (app.yaml)</h3><p>This manifest defines the Kubernetes resources needed to deploy the <strong>Palindrome Checker</strong> application to a Kyma cluster on SAP BTP.</p><h3>🔧 File: app.yaml</h3><pre>apiVersion: v1<br>kind: Service<br>metadata:<br>  name: palindromechecker<br>spec:<br>  type: ClusterIP<br>  selector:<br>    app: palindromechecker<br>  ports:<br>    - name: app<br>      port: 8080<br>      targetPort: 8080<br>---<br>apiVersion: apps/v1<br>kind: Deployment<br>metadata:<br>  name: palindromechecker<br>spec:<br>  selector:<br>    matchLabels:<br>      app: palindromechecker<br>  replicas: 1<br>  template:<br>    metadata:<br>      labels:<br>        app: palindromechecker<br>    spec:<br>      containers:<br>        - name: app<br>          image: 2024sl93093/springbootimage<br>          imagePullPolicy: Always<br>          ports:<br>            - containerPort: 8080<br>---<br>apiVersion: networking.k8s.io/v1<br>kind: Ingress<br>metadata:<br>  annotations:<br>    kubernetes.io/ingress.class: istio<br>  name: palindromechecker<br>spec:<br>  rules:<br>    - host: palindromechecker.c-03b621c.kyma.ondemand.com<br>      http:<br>        paths:<br>          - backend:<br>              service:<br>                name: palindromechecker<br>                port:<br>                  number: 8080<br>            path: /<br>            pathType: Prefix<br>  tls:<br>    - hosts:<br>        - palindromechecker.c-03b621c.kyma.ondemand.com<br>      secretName: kyma-gateway-certs</pre><h3>🧩 Breakdown of Each Section</h3><h4>✅ Service</h4><ul><li><strong>Type</strong>: ClusterIP (internal communication within the cluster)</li><li><strong>Name</strong>: palindromechecker</li><li>Routes traffic to pods with label app: palindromechecker on port 8080.</li></ul><h4>🚀 Deployment</h4><ul><li>Deploys <strong>1 replica</strong> of the container.</li><li>Pulls the Docker image: 2024sl93093/springbootimage.</li><li>Listens on port 8080.</li><li>Matches pods with label app: palindromechecker.</li></ul><h4>🌐 Ingress</h4><ul><li>Exposes the application externally via the domain:<br> palindromechecker.c-03b621c.kyma.ondemand.com</li><li>Uses <strong>Istio</strong> as the ingress class (as required by Kyma).</li><li>Applies TLS using a certificate referenced by kyma-gateway-cert.</li></ul><p>This file is applied during the <strong>deployment stage</strong> of the GitHub Actions CI/CD workflow using: <strong>kubectl apply -f app.yaml</strong></p><h4>Code For palindromeChecker</h4><pre>package com.devops.devopsproject;</pre><pre>import org.springframework.web.bind.annotation.GetMapping;<br>import org.springframework.web.bind.annotation.PathVariable;<br>import org.springframework.web.bind.annotation.RequestMapping;<br>import org.springframework.web.bind.annotation.RestController;</pre><pre>import java.util.HashMap;<br>import java.util.Map;<br></pre><pre>@RestController<br>@RequestMapping(&quot;/api&quot;)<br>public class PalindromeController {<br>    @GetMapping(&quot;/checkpalindrome/{input}&quot;)<br>    public Map&lt;String, Object&gt; checkPalindrome(@PathVariable(&quot;input&quot;) String input){<br>        String cleanedInput = input.replaceAll(&quot;\\s+&quot;, &quot;&quot;).toLowerCase();<br>        String reversed=new StringBuilder(cleanedInput).reverse().toString();<br>        boolean isPalindrome = cleanedInput.equals(reversed);<br>        Map&lt;String, Object&gt; response = new HashMap&lt;&gt;();<br>        response.put(&quot;input&quot;, input);<br>        response.put(&quot;isPalindrome&quot;, isPalindrome);</pre><pre>        return response;</pre><pre>    }<br>    @GetMapping<br>    public String checkPalindrome(){<br>        String ans=&quot;Hello from this side&quot;;<br>        return ans;</pre><pre>    }</pre><pre>}</pre><h4>Code For Testing</h4><pre>package com.devops.devopsproject; // Declares the package for this test class</pre><pre>// Import statements required for testing<br>import org.junit.jupiter.api.Test; // JUnit 5 annotation for test methods<br>import org.springframework.beans.factory.annotation.Autowired; // Used to inject dependencies<br>import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; // Specialized test for Spring MVC controllers<br>import org.springframework.test.web.servlet.MockMvc; // Main class for performing HTTP requests in tests<br>import org.springframework.test.web.servlet.request.MockMvcRequestBuilders; // Utility for building HTTP requests<br>import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; // Checks HTTP status codes<br>import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; // Checks JSON response body<br>import static org.hamcrest.Matchers.is; // Used to assert expected values in JSON<br></pre><pre>@WebMvcTest(PalindromeController.class)<br>public class PalindromeControllerTest {</pre><pre>    @Autowired<br>    private MockMvc mockMvc;</pre><pre>    @Test<br>    public void testPalindrome() throws Exception {<br>        mockMvc.perform(MockMvcRequestBuilders.get(&quot;/api/checkpalindrome/radar&quot;))<br>                .andExpect(status().isOk())<br>                .andExpect(jsonPath(&quot;$.input&quot;, is(&quot;radar&quot;)))<br>                .andExpect(jsonPath(&quot;$.isPalindrome&quot;, is(true)));<br>    }<br>    @Test<br>    public void testPalindromeHomePage() throws Exception {<br>        mockMvc.perform(MockMvcRequestBuilders.get(&quot;/api&quot;))<br>                .andExpect(status().isOk());<br>    }</pre><pre>}</pre><h4>Summary</h4><p>This article demonstrates automating the CI/CD pipeline for a Java application using GitHub Actions, Docker, and Kubernetes. The pipeline includes four main stages: building the app with Maven, running unit tests, creating a Docker image, and deploying the app to a Kubernetes cluster. By automating these steps, developers can speed up deployment, improve code quality, and ensure a more reliable process with minimal manual intervention. The use of Docker for containerization and Kubernetes for deployment ensures scalability and consistency across environments. This approach streamlines the entire software delivery lifecycle, from code commit to production.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3ee91a0f48a5" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>