<?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 Ceren Çakır on Medium]]></title>
        <description><![CDATA[Stories by Ceren Çakır on Medium]]></description>
        <link>https://medium.com/@cerenmert?source=rss-592fd46bb2ea------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*3VntIyHInqJtLk73GJ8EAg.jpeg</url>
            <title>Stories by Ceren Çakır on Medium</title>
            <link>https://medium.com/@cerenmert?source=rss-592fd46bb2ea------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 01:39:18 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@cerenmert/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[Appium | Briefly visible Toast Message ]]></title>
            <link>https://cerenmert.medium.com/appium-briefly-visible-toast-message-a5a3703a9662?source=rss-592fd46bb2ea------2</link>
            <guid isPermaLink="false">https://medium.com/p/a5a3703a9662</guid>
            <category><![CDATA[selenium]]></category>
            <category><![CDATA[presenceofelementlocated]]></category>
            <category><![CDATA[mobile-app-testing]]></category>
            <category><![CDATA[appium]]></category>
            <category><![CDATA[toast-message]]></category>
            <dc:creator><![CDATA[Ceren Çakır]]></dc:creator>
            <pubDate>Wed, 25 Feb 2026 21:48:29 GMT</pubDate>
            <atom:updated>2026-02-25T21:48:29.023Z</atom:updated>
            <content:encoded><![CDATA[<h3>Appium|Briefly visible Toast Message!</h3><h4>presenceofelementlocated vs visibilityofelementlocated</h4><p>We have an app and we want to check the toast message <strong>“Please enter your name”</strong> when no name is entered and click the “Let’s Shop” button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/364/1*XF8hPrqGPQqCJR3ecqys2A.png" /></figure><p>Let’s check the locator of toast message in Appium Inspector.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0nESakm73A15n4a4AfzjBw.png" /></figure><p>Here as you can see in above, we can not get the selector of toaster. When we try to select the toaster message, all frame is selected not only the toaster. The generic class-based XPath //android.widget.Toast is the standard locator strategy for intercepting these system-level notifications. So we’ll use this.</p><pre>By toastLocator = By.xpath(&quot;(//android.widget.Toast)[1]&quot;);</pre><p>And we’ll use the Explicit wait method of “presenceOfElementLocated” instead of “visibilityOfElementLocated” We would use <strong><em>wait.until(ExpectedConditions.visibilityOfElementLocated(toastLocator));</em></strong></p><p><strong>But we don’t.</strong> Why? Check the below explanations.</p><pre>@Test<br>    public void checkTheToastMessageWhenNoNameEnteredInTheForm() {<br>        driver.findElement(By.xpath(&quot;//android.widget.RadioButton[@text=&#39;Female&#39;]&quot;)).click();<br>        driver.findElement(By.id(&quot;android:id/text1&quot;)).click();<br>        driver.findElement(AppiumBy.androidUIAutomator(&quot;new UiScrollable(new UiSelector()).scrollIntoView(text(\&quot;Bahamas\&quot;));&quot;));<br>        driver.findElement(AppiumBy.androidUIAutomator(&quot;new UiSelector().text(\&quot;Bahamas\&quot;)&quot;)).click();<br>        driver.findElement(By.id(&quot;com.androidsample.generalstore:id/btnLetsShop&quot;)).click();<br>        By toastLocator = By.xpath(&quot;(//android.widget.Toast)[1]&quot;);<br>        wait = new WebDriverWait(driver, Duration.ofSeconds(10));<br>        wait.until(ExpectedConditions.presenceOfElementLocated(toastLocator));<br>        String expectedToastMessage = &quot;Please enter your name&quot;.trim().toLowerCase();<br>        try {<br>            String actualToastMessage = driver.findElement(toastLocator).getDomAttribute(&quot;text&quot;);<br>            Assert.assertEquals(actualToastMessage.trim().toLowerCase(), expectedToastMessage, &quot;Expected and&quot; +<br>                    &quot;Actual toast messages are not the same !&quot;);<br>        } catch (NoSuchElementException e) {<br>            Assert.fail(&quot;No toast message appears! Expected toast message: &quot; + expectedToastMessage);<br>        }<br>    }</pre><blockquote><strong><em>visibilityOfElementLocated</em>:</strong> This method requires <strong>two conditions</strong> to be met for the test to proceed:</blockquote><ol><li>The element must exist in the DOM tree.</li><li>The element must be <strong>physically visible</strong> on the UI <strong>(it must have a height and width greater than 0, and its </strong><strong>visible property must be </strong><strong>true).</strong></li></ol><blockquote><strong><em>presenceOfElementLocated</em>:</strong> This method <strong>only checks</strong> if the element has been injected into the DOM tree (XML hierarchy). It is <strong>not concerned</strong> with whether the element is actually rendered, drawn, or visible on the screen.</blockquote><h3>Appium Inspector and Toast Message Behavior</h3><p>Unlike standard application Views (such as a TextView or Button), Android Toast messages are rendered at the <strong>System UI level</strong>. When a Toast message is triggered, Appium captures its content (the XML node) in the background. However, Appium Inspector (and the underlying UiAutomator2 engine)<strong> cannot identify</strong> this element as a &quot;visible&quot; object with defined physical coordinates and dimensions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c5KBPLLLjXno8br1iA0iQQ.jpeg" /></figure><h3>So, which one will be used?</h3><p>The code fragment that is generating the Toast message appears in the DOM (<strong>presence</strong>), but Appium cannot verify the visual status of this object on the screen (<strong>visibility</strong>).</p><p>Therefore, if you use visibilityOfElementLocated to catch a Toast message in your automation code, Appium will throw a <strong>TimeoutException</strong> because it will never receive the confirmation that the element is &quot;visible.&quot; To ensure the test runs stably and captures the element the moment it is injected into the DOM, it is emphasized that you must use <strong>presenceOfElementLocated</strong>. Using visibilityOfElementLocated would fail because the Appium UiAutomator2 driver cannot validate the physical rendering (dimensions and coordinates) of a Toast message.</p><h3>Why don’t we use standard .getText() method?</h3><p>String actualToastMessage= driver.findElement(...).getDomAttribute(&quot;text&quot;);</p><p>This is a critical implementation detail for Toast handling. Invoking the standard .getText() method on a Toast element frequently returns a null or empty string, as the W3C WebDriver specification may not evaluate the element as fully &quot;visible.&quot; By utilizing .getDomAttribute(&quot;text&quot;), you bypass the visibility check and extract the string value directly from the element&#39;s XML node property.</p><h3>Exception Handling and Controlled Failure</h3><pre>try {<br>            String actualToastMessage = driver.findElement(toastLocator).getDomAttribute(&quot;text&quot;);<br>            Assert.assertEquals(actualToastMessage.trim().toLowerCase(), expectedToastMessage, &quot;Expected and&quot; +<br>                    &quot;Actual toast messages are not the same !&quot;);<br>        } catch (NoSuchElementException e) {<br>            Assert.fail(&quot;No toast message appears! Expected toast message: &quot; + expectedToastMessage);<br>        }</pre><p>The lifecycle of Toast messages is asynchronous and they disappear very quickly. The “<strong>wait</strong>” condition might detect the element in the DOM and release the lock, <strong>but the element might disappear from the DOM in the milliseconds </strong>before the subsequent “<strong>findElement</strong>” command executes.</p><p>If this race condition occurs, the driver throws a NoSuchElementException. try-catch block prevents an unhandled exception from crashing the test driver. <strong>Instead, it gracefully catches the error and triggers a hard assertion failure (</strong><strong>Assert.fail())</strong>, which provides a clear and actionable log entry for TestNG execution reports.</p><p><em>Do not hesitate to give a comment and contact me on </em><a href="https://www.linkedin.com/in/cerencakirr/"><em>LinkedIn</em></a></p><p><em>Thanks, and keep learning! :)</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a5a3703a9662" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[White Box Testing Techniques]]></title>
            <link>https://cerenmert.medium.com/white-box-testing-techniques-c1f692e97435?source=rss-592fd46bb2ea------2</link>
            <guid isPermaLink="false">https://medium.com/p/c1f692e97435</guid>
            <category><![CDATA[istqb]]></category>
            <category><![CDATA[software-testing]]></category>
            <category><![CDATA[dynamic-testing]]></category>
            <category><![CDATA[white-box-testing]]></category>
            <category><![CDATA[black-box-testing]]></category>
            <dc:creator><![CDATA[Ceren Çakır]]></dc:creator>
            <pubDate>Sat, 07 Feb 2026 14:06:19 GMT</pubDate>
            <atom:updated>2026-02-07T14:06:19.395Z</atom:updated>
            <content:encoded><![CDATA[<p>Let&#39;s scenario-ize White Box Testing Techniques!</p><p>White Box Testing involves analyzing the system’s internal architecture and/or its implementation, in addition to its source code quality. White Box Testing Techniques (also called structural or structure-based techniques) are based on an analysis of the architecture, detailed design, internal structure, or code of the test object. WBTTs are:</p><p><strong>1. Static Analysis (Static Testing)</strong></p><p><strong>2. Structural Coverage Techniques (Dynamic Testing)</strong></p><blockquote>2.1. Statement Coverage</blockquote><blockquote>2.2. Branch(Decision) Coverage</blockquote><blockquote>2.3. Condition Coverage</blockquote><blockquote>2.4. Path Coverage</blockquote><p>The hierarchy of coverage strength helps prioritize testing efforts:</p><blockquote>Path Coverage &gt; Condition Coverage &gt; Branch Coverage &gt; Statement Coverage</blockquote><h3>The best way to understand White Box techniques is to “scenario-ize” a simple piece of code. Let’s put aside abstract definitions and look at how a developer (or a white-box tester) views the code structure.</h3><p>Let’s use the simple Java method, which calculates a discount for a store customer</p><pre>public int calculateDiscount(int age, boolean isMember) {<br>    int discount = 0;             // Line 1<br><br>    if (age &gt; 60) {               // Line 2 (Decision Point A)<br>        discount = 20;            // Line 3<br>    }<br><br>    if (isMember) {               // Line 4 (Decision Point B)<br>        discount = discount + 10; // Line 5<br>    }<br><br>    return discount;              // Line 6<br>}</pre><p>Here is how we apply the techniques to this code:</p><h3>1. Statement Coverage</h3><p><strong>The Logic:</strong> “Did every single line of my code execute at least once?”</p><p>This is the weakest form of coverage. Our goal is simply to “touch” every line from Line 1 to Line 6.</p><ul><li><strong>Test Scenario 1:</strong> age = 65, isMember = true</li><li>Code runs: age &gt; 60 (True) -&gt; discount = 20 executes.</li><li>Code continues: isMember (True) -&gt; discount + 10 executes.</li><li><strong>Result:</strong> We have touched 100% of the lines with just one test.</li></ul><p><strong>The Problem:</strong> We touched every line, but we never tested the <strong>False</strong> conditions. If there is a bug that causes the system to crash when age &lt; 60, this test will never find it. You can have 100% Statement Coverage and still have a buggy application.</p><h3>2. Branch Coverage (Decision Coverage)</h3><p><strong>The Logic:</strong> “Did I test every if, while, or case statement evaluating to both <strong>TRUE</strong> and <strong>FALSE</strong>?&quot;</p><p>This technique is more reliable because it checks not just the path taken, but also the path <em>not</em> taken.</p><p><strong>Test Scenario 1 (From above):</strong> age = 65, isMember = true</p><ul><li>if (age &gt; 60) -&gt; <strong>True</strong> is tested.</li><li>if (isMember) -&gt; <strong>True</strong> is tested.</li></ul><p><strong>Test Scenario 2:</strong> age = 30, isMember = false</p><ul><li>if (age &gt; 60) -&gt; <strong>False</strong> is tested (Line 3 is skipped).</li><li>if (isMember) -&gt; <strong>False</strong> is tested (Line 5 is skipped).</li></ul><p><strong>Result:</strong> With these 2 scenarios, we achieved 100% Branch Coverage. We are now confident that the code handles “Else” (or false) conditions correctly.</p><h3>3. Path Coverage</h3><p><strong>The Logic:</strong> “Did I test <strong>all possible paths</strong> (combinations) from start to finish?”</p><p>Branch coverage ensures every decision is toggled True/False, but it doesn’t necessarily test all <strong>combinations</strong> of those decisions. Path coverage is the most comprehensive (and expensive).</p><p>In the code above, there are 4 distinct paths through the logic:</p><ol><li><strong>Path 1:</strong> Elderly (&gt;60) AND Member (Decision A True, Decision B True)</li><li><strong>Path 2:</strong> Elderly (&gt;60) BUT Not Member (A True, B False)</li><li><strong>Path 3:</strong> Young (&lt;60) AND Member (A False, B True)</li><li><strong>Path 4:</strong> Young (&lt;60) AND Not Member (A False, B False)</li></ol><p>Branch coverage might look 100% complete using only Path 1 and Path 4, but Path Coverage requires you to write 4 separate test cases to cover every scenario.</p><p><strong>Branch Coverage</strong> is generally the industry standard. Path coverage is mandatory for critical algorithms (like financial calculations), but can be too costly for general logic.</p><p>The hierarchy of coverage strength helps prioritize testing efforts:</p><blockquote>Path Coverage &gt; Condition Coverage &gt; Branch Coverage &gt; Statement Coverage</blockquote><h3>Did you catch that I skipped <strong>Condition Coverage</strong> in the previous example?</h3><p>Because the code snippets used <strong>simple (atomic) conditions</strong>.</p><p>In the original code: if (age &gt; 60)</p><p>There is only <strong>one</strong> condition to check. In this specific case, <strong>Branch Coverage</strong> and <strong>Condition Coverage</strong> are effectively the same thing.</p><p>However, Condition Coverage becomes critical (and distinct) when you have <strong>Compound Conditions</strong> (logic using AND / OR).</p><p>Let’s modify the example slightly to show exactly how Condition Coverage works.</p><h3>Modified Scenario: Compound Logic</h3><p>Imagine the store changes its rule: <strong>“You get a discount ONLY if you are over 60 AND you are a Member.”</strong></p><pre>public int calculateDiscount(int age, boolean isMember) {<br>    int discount = 0;<br><br>    // Compound Condition: (A &amp;&amp; B)<br>    if (age &gt; 60 &amp;&amp; isMember) {    <br>        discount = 20;<br>    }<br><br>    return discount;<br>}</pre><p>Now we have one decision statement, but it contains <strong>two atomic conditions</strong>:</p><ol><li><strong>Condition A:</strong> age &gt; 60</li><li><strong>Condition B:</strong> isMember</li></ol><h3>Why Branch Coverage is NOT Enough Here</h3><p>For <strong>Branch Coverage</strong>, we just need the whole if statement to evaluate to <strong>TRUE</strong> once and <strong>FALSE</strong> once.</p><p><strong>Test 1:</strong> age = 65, isMember = true</p><ul><li>True &amp;&amp; True = <strong>Result: TRUE</strong> (We entered the if)</li></ul><p><strong>Test 2:</strong> age = 30, isMember = true</p><ul><li>False &amp;&amp; True = <strong>Result: FALSE</strong> (We skipped the if)</li></ul><p><strong>Status:</strong> We have achieved 100% Branch Coverage. <strong>The Risk:</strong> We never tested what happens if isMember is <strong>False</strong>. If there is a bug specifically related to non-members processing, we missed it.</p><h3>Applying Condition Coverage</h3><p><strong>Condition Coverage</strong> requires that <strong>each atomic condition</strong> (A and B) must independently evaluate to <strong>TRUE</strong> and <strong>FALSE</strong> at least once during testing. It doesn’t care about the final result of the if; it cares about the parts inside.</p><p>We need to verify:</p><ol><li>age &gt; 60 is tested as True and False.</li><li>isMember is tested as True and False.</li></ol><p><strong>Let’s build the test set:</strong></p><p><strong>Test 1:</strong> age = 65, isMember = true</p><ul><li>age &gt; 60 -&gt; <strong>True</strong> (Check)</li><li>isMember -&gt; <strong>True</strong> (Check)</li></ul><p><strong>Test 2:</strong> age = 30, isMember = false</p><ul><li>age &gt; 60 -&gt; <strong>False</strong> (Check)</li><li>isMember -&gt; <strong>False</strong> (Check)</li></ul><p><strong>Result:</strong> With these two tests, we have achieved <strong>100% Condition Coverage</strong>. We have seen every variable toggle its state.</p><h3>The “Trap” of Condition Coverage</h3><p>Notice something interesting in the example above? In <strong>Test 2</strong> (False &amp;&amp; False), the result of the if is <strong>FALSE</strong>. In <strong>Test 1</strong> (True &amp;&amp; True), the result of the if is <strong>TRUE</strong>.</p><p>However, depending on how you pick your tests, it is mathematically possible to have 100% Condition Coverage <strong>without</strong> having 100% Branch Coverage (though rare in simple cases).</p><p>This leads to the “Gold Standard” in safety-critical testing (like avionics or medical software): <strong>MC/DC (Modified Condition/Decision Coverage)</strong>. This is a strict technique that requires:</p><ol><li>Every condition has been True and False.</li><li>The decision has been True and False.</li><li>Every condition is shown to <strong>independently affect</strong> the decision’s outcome.</li></ol><p>Here is the detailed comparison using a Truth Table for the logic if (A &amp;&amp; B).</p><p><strong>The Scenario:</strong></p><p>if (age &gt; 60 &amp;&amp; isMember)</p><p><strong>Condition A:</strong> age &gt; 60</p><p><strong>Condition B:</strong> isMember</p><p><strong>Logic:</strong> AND (&amp;&amp;)</p><h3>The Truth Table</h3><p>There are 4 possible combinations of inputs (2²).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/744/1*YvrnWsZ17K5l_Gwiyr_HWg.png" /></figure><h3>1. Branch (Decision) Coverage</h3><p><strong>Goal:</strong> Ensure the if statement evaluates to <strong>TRUE</strong> at least once and <strong>FALSE</strong> at least once.</p><p><strong>Selected Tests:</strong> Case <strong>1</strong> and Case <strong>2</strong>.</p><ul><li>Case 1 Result: <strong>TRUE</strong></li><li>Case 2 Result: <strong>FALSE</strong></li></ul><p><strong>Verdict:</strong> 100% Branch Coverage Achieved.</p><p><strong>The Flaw:</strong> Look at <strong>Condition B</strong> (isMember). In Test 2, B is False. In Test 1, B is True. However, look at <strong>Condition A</strong>. In both tests (1 and 2), <strong>A is always TRUE</strong>. We never tested what happens if age &lt;= 60 (A is False).</p><h3>2. Condition Coverage (The Tricky One)</h3><p><strong>Goal:</strong> Ensure <strong>Condition A</strong> is True/False at least once, and <strong>Condition B</strong> is True/False at least once. The final result doesn’t matter.</p><p><strong>Selected Tests:</strong> Case <strong>2</strong> and Case <strong>3</strong>.</p><ul><li><strong>Case 2 (T, F):</strong> A is True, B is False.</li><li><strong>Case 3 (F, T):</strong> A is False, B is True.</li></ul><p><strong>Verdict: 100% Condition Coverage Achieved.</strong></p><ul><li>Did A toggle? Yes (T -&gt; F).</li><li>Did B toggle? Yes (F -&gt; T).</li></ul><p><strong>The Major Flaw:</strong> Look at the <strong>Result</strong> column for cases 2 and 3. Both are <strong>FALSE</strong>. We achieved 100% Condition Coverage, but the code <strong>never entered the </strong><strong>if block</strong> (Result was never True). We missed the most important path!</p><h3>3. MC/DC (Modified Condition/Decision Coverage)</h3><p><strong>Goal:</strong> Prove that <strong>each condition independently affects</strong> the result.</p><ul><li>To prove <strong>A</strong> matters: We need a pair of tests where <strong>B stays constant</strong>, A flips, and the Result flips.</li><li>To prove <strong>B</strong> matters: We need a pair of tests where <strong>A stays constant</strong>, B flips, and the Result flips.</li></ul><p><strong>Pair for A:</strong> Case <strong>1</strong> (T, T) vs Case <strong>3</strong> (F, T).</p><ul><li>B is constant (True).</li><li>A flips (True -&gt; False).</li><li>Result flips (True -&gt; False). -&gt; <strong>Proven: A affects the outcome.</strong></li></ul><p><strong>Pair for B:</strong> Case <strong>1</strong> (T, T) vs Case <strong>2</strong> (T, F).</p><ul><li>A is constant (True).</li><li>B flips (True -&gt; False).</li><li>Result flips (True -&gt; False). -&gt; <strong>Proven: B affects the outcome.</strong></li></ul><p><strong>Minimum Test Set for MC/DC:</strong> Case 1, Case 2, and Case 3. (3 Tests).</p><h4>Summary :</h4><p><strong>Branch Coverage:</strong> Checks the “End Result” (Pass/Fail). Good enough for most commercial software.</p><p><strong>Condition Coverage:</strong> Checks the “Ingredients” (Inputs), but ignores the “Cake” (Result). Dangerous on its own.</p><p><strong>MC/DC:</strong> Checks that every ingredient actually changes the flavor of the cake. Required for <strong>safety-critical systems</strong> (Avionics, Automotive, Medical Devices)</p><h3>Did you catch that Path coverage and Condition coverage seem to be the same thing?</h3><p>But they don’t theoretically!</p><p>If we are talking about a <strong>single, simple </strong><strong>if block</strong> (e.g., just if (x &gt; 0)), then yes, mathematically they result in the same test cases.</p><p>However, as soon as the code becomes slightly more complex — specifically when you have <strong>sequential (independent) </strong><strong>if statements</strong>—their paths diverge significantly.</p><p>The best way to see the difference is with a “Two Doors” scenario.</p><h3>The Scenario: “Two Sequential Doors”</h3><p>Imagine entering a building. First, there is an <strong>Outer Door</strong>, and then there is an <strong>Inner Door</strong>. They are independent of each other.</p><pre>public void enterBuilding(boolean outerDoorOpen, boolean innerDoorOpen) {<br>    <br>    // Decision Point A<br>    if (outerDoorOpen) {<br>        System.out.println(&quot;Passed outer door&quot;);<br>    }<br><br>    // Decision Point B (Independent from A)<br>    if (innerDoorOpen) {<br>        System.out.println(&quot;Passed inner door&quot;);<br>    }<br>}</pre><p>In this code, there are <strong>4 Possible Paths</strong>:</p><p><strong>Path 1:</strong> Outer Open, Inner Open (Pass both)</p><p><strong>Path 2:</strong> Outer Closed, Inner Closed (Pass neither)</p><p><strong>Path 3:</strong> Outer Open, Inner Closed (Pass only the first)</p><p><strong>Path 4:</strong> Outer Closed, Inner Open (Pass only the second)</p><p>Now, let’s apply the two techniques and see <strong>how they produce different results</strong>.</p><h4>1. Applying Condition Coverage (The “Lazy” Approach)</h4><p><strong>The Goal:</strong> Ensure outerDoorOpen evaluates to True/False, and innerDoorOpen evaluates to True/False. That&#39;s it. We don&#39;t care about combinations.</p><p><strong>Test 1:</strong> outerDoorOpen = TRUE, innerDoorOpen = TRUE</p><p><strong>Test 2:</strong> outerDoorOpen = FALSE, innerDoorOpen = FALSE</p><p><strong>Status Check:</strong></p><p>Did Outer Door toggle True and False? <strong>Yes.</strong></p><p>Did Inner Door toggle True and False? <strong>Yes.</strong></p><p><strong>Result:</strong> We achieved <strong>100% Condition Coverage</strong> with just <strong>2 Tests</strong>.</p><h4>2. Applying Path Coverage (The “Thorough” Approach)</h4><p><strong>The Goal:</strong> Ensure <strong>every possible route</strong> through the code is executed.</p><p>Let’s look at the 2 tests we just wrote above:</p><ul><li>We covered <strong>Path 1</strong> (Both Open).</li><li>We covered <strong>Path 2</strong> (Both Closed).</li><li><strong>BUT:</strong> We completely missed <strong>Path 3</strong> (Open/Closed) and <strong>Path 4</strong> (Closed/Open).</li></ul><p><strong>Result:</strong> Even though Condition Coverage is 100%, our <strong>Path Coverage is only 50%</strong>. To get 100% Path Coverage, we are forced to write 4 separate test cases.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Qm9ISSqNpURBaTPhrGZ86Q.png" /></figure><h3>Where is the Critical Difference?</h3><p>If there is a bug in the system where <em>“Opening the outer door causes the inner door to lock”</em> (an interaction bug between the two conditions), <strong>Condition Coverage will not find it</strong>, because it never tests the “crossed” scenarios (True-False / False-True). But <strong>Path Coverage</strong> forces you to test every combination, so it would catch that bug.</p><blockquote>Condition Coverage may be insufficient when testing independent conditions (Sequential Ifs). As stated in ISTQB standards and the principles of Myers’ <em>The Art of Software Testing</em>, the Path Coverage technique must be applied to ensure that all possible combinations are tested (ISTQB, 2024; Myers, 2011).</blockquote><p><em>Reference: </em><a href="https://istqb.org/"><em>https://istqb.org</em></a><em>/</em></p><blockquote><em>Do not hesitate to give a comment and contact me on </em><a href="https://www.linkedin.com/in/cerencakirr/"><em>LinkedIn</em></a></blockquote><p><em>Thanks, and keep learning! :)</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c1f692e97435" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Let’s write cleaner and more readable API tests for the OMDb API]]></title>
            <link>https://cerenmert.medium.com/write-a-cleaner-and-more-readable-api-test-for-omdb-api-8f38f8848629?source=rss-592fd46bb2ea------2</link>
            <guid isPermaLink="false">https://medium.com/p/8f38f8848629</guid>
            <category><![CDATA[restassured]]></category>
            <category><![CDATA[rest-api]]></category>
            <category><![CDATA[api-testing]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[testng]]></category>
            <dc:creator><![CDATA[Ceren Çakır]]></dc:creator>
            <pubDate>Thu, 05 Feb 2026 18:42:02 GMT</pubDate>
            <atom:updated>2026-02-05T19:43:35.460Z</atom:updated>
            <content:encoded><![CDATA[<p><em>This project contains automated tests for the </em><a href="http://www.omdbapi.com/"><em>OMDB API</em></a><em> using Java, TestNG, and RestAssured.</em></p><p><a href="https://github.com/cerenmert/tests-omdb-api">This project </a>was developed to test the <a href="http://www.omdbapi.com/">OMDB API</a>, a database of movies and series. The project automatically tests the accuracy of functions such as movie search, detailed viewing, and season/episode querying provided by the API. Here, I’ll show you how we can create a high-quality and well-organized API test project.</p><p>First, go to this <a href="https://www.omdbapi.com/apikey.aspx">URL</a> and get an API key for free for your tests, because we need an API key to test the OMDb API.</p><p>Let’s write some values and go to the request url, so we can see that we’re getting an error because of the lack of an API key.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zy1hYRuF0tiaM9Oxpu-gZQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/986/1*PEt8FWKVHQnuEZsZCXytNw.png" /></figure><p>So, I added my API key to the URL and checked the response. We are definitely getting a response based on our request. <strong>Please get an API key for yourself to test all these APIs.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0h5rryI1AAsAaa2FQxJwTQ.png" /></figure><p>Let’s start writing our API tests. I will show you 4 versions of the same test. This is the standard writing using Rest-Assured. “t”, “y”, and “apiKey” are our query parameters. I didn’t write apiKey and url directly like “Batman” or “1989”, because <strong>these are the same for all tests</strong>, and they do not change throughout the process. But for example, in some tests I use “Shrek” as a title, or I use different years. So they can change based on your test. But our baseURL and API key is same for all tests.</p><pre> public class TestsByIdOrTitle extends BaseServiceTest {<br>    @Test<br>    public void shouldSearchByTitleAndYearVersion0() {<br>        Response response = RestAssured.given()<br>                .queryParam(&quot;t&quot;, &quot;Batman&quot;)<br>                .queryParam(&quot;y&quot;, &quot;1989&quot;)<br>                .queryParam(&quot;apikey&quot;, apiKey)<br>                .get(url)<br>                .then()<br>                .statusCode(200)<br>                .extract().response();<br>        String title = response.getBody().jsonPath().getString(&quot;Title&quot;);<br>        assertThat(title, Matchers.equalTo(&quot;Batman&quot;));<br>    }<br>}</pre><p><strong><em>extract().response(); </em></strong>allows us to capture the entire API response into a variable (in this case, it is the <strong><em>response</em></strong> variable ) after performing validations. Here is the breakdown for this specific block:</p><p><strong><em>.then().statusCode(200): </em></strong>Validates that the status code is 200</p><p><strong><em>.extract().response(): </em></strong>Returns the full <strong><em>Response</em></strong> object instead of just ending the validation chain.</p><p><strong>Why it’s needed here</strong>: we need the response object so that on <strong>line </strong>(String title = response.getBody()….) we can parse the JSON body and extract the “Title” field to verify it in the assertion at the last line.</p><h3><strong>Let’s go to the second version.</strong></h3><pre>public class TestsByIdOrTitle extends BaseServiceTest {<br>    @Test<br>    public void shouldSearchByTitleAndYearVersion1() {<br>        Map&lt;String, Object&gt; params = new HashMap&lt;&gt;();<br>        params.put(&quot;t&quot;, &quot;Batman&quot;);<br>        params.put(&quot;y&quot;, &quot;1989&quot;);<br>        params.put(&quot;apikey&quot;, apiKey);<br>        Response response = byIdOrTitleService.getByIdOrTitle(params, ResponseSpec.checkStatusCodeOK());<br>        String title = response.getBody().jsonPath().getString(&quot;Title&quot;);<br>        assertThat(title, Matchers.equalTo(&quot;Batman&quot;));<br>    }<br>}</pre><p>This test method (shouldSearchByTitleAndYearVersion1) performs the same search as shouldSearchByTitleAndYearVersion0 (just above it), but it cleans up the code by using a Map for parameters and a Service object (byIdOrTitleService) to send the request, rather than writing out the full RestAssured chain manually.</p><h4>1. Map&lt;String, Object&gt; params = new HashMap&lt;&gt;();</h4><p><strong>What it does:</strong> Creates an empty Java HashMap named params.</p><p><strong>Why:</strong> Instead of adding query parameters one by one to the request (like .queryParam(“t”, …)), we are preparing a collection of key-value pairs to send all at once.</p><h4>2. params.put(“t”, “Batman”);</h4><p><strong>What it does:</strong> Adds the movie title “Batman” to the map with the key “t”. The OMDb API expects “t” for title searches.</p><h4>3. params.put(“y”, “1989”);</h4><p><strong>What it does:</strong> Adds the release year “1989” to the map with the key “y”.</p><h4>4. params.put(“apikey”, apiKey);</h4><p><strong>What it does:</strong> Adds your successful authentication key. Without this, the API would return a 401 Unauthorized error.</p><h4>5. Response response = byIdOrTitleService.getByIdOrTitle(params, ResponseSpec.checkStatusCodeOK());</h4><p><strong>What it does:</strong> This is the core action.</p><ul><li>It calls a helper method <strong><em>getByIdOrTitle</em></strong> from the service class.</li><li>It passes the params<strong> map</strong> (containing t, y, and apiKey).</li><li>It passes a <strong>Response Specification</strong> (ResponseSpec.checkStatusCodeOK()), which likely contains the rule “expect HTTP Status 200”.</li><li>It captures the result in the response variable.</li></ul><p><strong>Benefit:</strong> This hides the ugly RestAssured details (given().queryParam().get()…) inside the service method, making the test easier to read.</p><h4>6. String title = response.getBody().jsonPath().getString(“Title”);</h4><p><strong>What it does:</strong> It parses the JSON response received from the API and extracts the value of the parameter named “Title”.</p><p><strong>Example Response:</strong> {“Title”:”Batman”, “Year”:”1989&quot;, …} -&gt; Extracts “Batman”.</p><h4>7. assertThat(title, Matchers.equalTo(“Batman”));</h4><p><strong>What it does:</strong> Verifies the test result using Hamcrest assertions.</p><p>It checks if the title extracted in the previous line is exactly equal to “Batman”. If not, the test fails.</p><h3><strong><em>Let’s look at the getByIdOrTitle method. I’ve explained what it does at the 5th item above.</em></strong></h3><pre>package service;<br><br>import io.restassured.RestAssured;<br>import io.restassured.response.Response;<br>import io.restassured.specification.ResponseSpecification;<br>import spec.RequestSpec;<br><br>import java.util.Map;<br>import helper.ApiResource;<br><br>public class ByIdOrTitleService extends RequestSpec {<br><br>    public ByIdOrTitleService() {<br>        super(ApiResource.get(&quot;URL&quot;));<br>    }<br><br>    public Response getByIdOrTitle(Map&lt;String, Object&gt; params, ResponseSpecification responseSpecification) {<br>        return RestAssured<br>                .given()<br>                .spec(super.getRequestSpecification())<br>                .queryParams(params)<br>                .get()<br>                .then()<br>                .spec(responseSpecification)<br>                .extract().response();<br>    }<br>}</pre><h3>What if?</h3><p>If we didn’t have the RequestSpec class and its inheritance structure, we would have to manually type the baseUri into each request.</p><p>Our code would look like this:</p><pre>public Response getByIdOrTitle(Map&lt;String, Object&gt; params, ResponseSpecification responseSpecification) {<br>    return RestAssured<br>            .given()<br>            .baseUri(&quot;https://www.omdbapi.com/&quot;) <br>            .queryParams(params)<br>            .get()<br>            .then()<br>            .spec(responseSpecification)<br>            .extract().response();<br>}</pre><p><em>To help you see the difference clearly, let’s imagine we’ve added a second service to our project, called PosterService, in addition to ByIdOrTitleService.</em></p><pre><br>public class PosterService {<br>    public Response getPoster(String posterId) {<br>        return RestAssured.given()<br>                .baseUri(&quot;https://www.omdbapi.com/&quot;) <br>                .queryParam(&quot;i&quot;, posterId)<br>                .get();<br>    }<br>}</pre><p><em>What’s the problem? If your API address changes to </em><a href="https://api.omdb.com/v2/"><em>https://api.omdb.com/v2/</em></a><em> tomorrow, you’ll need to open and correct both the ByIdOrTitleService and PosterService files individually. If you had 100 service files, you’d need to correct all 100.</em></p><blockquote><em>This increases the risk of errors and creates code repetition (boilerplate).</em></blockquote><p><strong>In the correct structure,</strong> I define the Base URL once (in the ByIdOrTitleService constructor) by saying “super(helper.ApiResource.get(“URL”));”. If our project grows and we have 50 different service methods, we only need to change one place (the Constructor or RequestSpec class) when the URL changes.</p><p>We manage the URL in the super(“…”) part from a single location by reading it from the <strong><em>ApiResource</em></strong> helper. The goal is <strong>to avoid repeating</strong> the “RestAssured.given().baseUri(…)” code hundreds of times.</p><pre>package helper;<br><br>import java.util.ResourceBundle;<br><br>public class ApiResource {<br><br>    private static ResourceBundle bundle = ResourceBundle.getBundle(&quot;api&quot;);<br><br>    public static String get(String key) {<br>        return bundle.getString(key);<br>    }<br>}</pre><p>These code blocks establish a structure that allows you to read the API URL from an external configuration file <strong><em>(api.properties</em></strong>) instead of having it hardcoded inside the Java code.</p><p><strong>What it does:</strong> It uses Java’s standard ResourceBundle class to look for and load a properties file named <strong>“api.properties”</strong> located in my project’s resources folder (e.g., src/test/resources).</p><p><strong>Result:</strong> The bundle variable now holds all the data from that file (like URL=…, API_KEY=…), allowing us to access them by their keys.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/346/1*_4AOonnsc9mMoaJ0_Epgjw.png" /></figure><pre>public ByIdOrTitleService() {<br>    super(ApiResource.get(&quot;URL&quot;));<br>}</pre><p>ApiResource.get(“URL”)<strong>:</strong> This reads the value associated with the key <strong>“URL”</strong> from the loaded api.properties file (which is <a href="https://www.omdbapi.com)./">https://www.omdbapi.com).</a></p><p>super(…)<strong>:</strong> It passes this retrieved URL to the parent class (<strong>RequestSpec</strong>), which sets up the base configuration for your API requests.</p><p><strong>Result:</strong> The Base URL is dynamically loaded. If the URL changes in the future, <strong><em>we only need to update the .properties file,</em></strong><em> </em>without touching the actual Java code.</p><p>So, ByIdOrTitleService extends the <strong>RequestSpec</strong> class. So let’s look at the RequestSpec class.</p><pre>package spec;<br><br>import io.restassured.builder.RequestSpecBuilder;<br>import io.restassured.specification.RequestSpecification;<br><br>public class RequestSpec {<br>    RequestSpecification requestSpecification;<br><br>    public RequestSpec(String baseUri) {<br>        requestSpecification = new RequestSpecBuilder()<br>                .setBaseUri(baseUri)<br>                .build();<br>    }<br><br>    public RequestSpecification getRequestSpecification() {<br>        return requestSpecification;<br>    }<br><br>}</pre><p><strong><em>RequestSpecification</em></strong>: This variable is the RestAssured object that will hold all the settings (Base URL, headers, etc.) of our API request.</p><p><strong><em>public RequestSpec(String baseUri):</em></strong> This constructor method runs whenever the class is created.</p><p><strong><em>getRequestSpecification: This is Getter. </em></strong>This prepared configuration package is made available for other classes to use (e.g., ByIdOrTitleService)</p><blockquote>In summary: This class is a helper that says, “I don’t want to bother setting the URL every time; just give me the URL, and I’ll give you a pre-configured settings package.” And the ByIdOrTitleService class takes this package and uses it in its own requests.</blockquote><p>Also, the getByIdOrTitle method gets a parameter <strong>responseSpecification of ResponseSpecification type. </strong>Check below</p><pre>public Response getByIdOrTitle(Map&lt;String, Object&gt; params, ResponseSpecification responseSpecification) {<br>        return RestAssured<br>                .given()<br>                .spec(super.getRequestSpecification())<br>                .queryParams(params)<br>                .get()<br>                .then()<br>                .spec(responseSpecification)<br>                .extract().response();<br>    }</pre><p>Let’s check the <strong><em>ResponseSpec</em></strong> class too.</p><p>The ResponseSpec.java class contains specifications used to validate API responses.</p><pre>package spec;<br><br>import io.restassured.builder.ResponseSpecBuilder;<br>import io.restassured.specification.ResponseSpecification;<br>import org.apache.http.HttpStatus;<br><br>public class ResponseSpec {<br><br>    public static ResponseSpecification checkStatusCodeOK() {<br>        return new ResponseSpecBuilder()<br>                .expectStatusCode(HttpStatus.SC_OK)<br>                .build();<br>    }<br><br>    public static ResponseSpecification checkStatusCodeUnauthorized() {<br>        return new ResponseSpecBuilder()<br>                .expectStatusCode(HttpStatus.SC_UNAUTHORIZED)<br>                .build();<br>    }<br><br>    public static ResponseSpecification checkStatusCodeNotFound() {<br>        return new ResponseSpecBuilder()<br>                .expectStatusCode(HttpStatus.SC_NOT_FOUND)<br>                .build();<br>    }<br><br>}</pre><p><strong><em>checkStatusCodeOK(): </em></strong>Creates a rule set that checks if the status code of the response returned from the API is 200 (OK). When we use .spec(ResponseSpec.checkStatusCodeOK()) in our tests, RestAssured automatically checks “Is the response 200?”</p><p>*********************</p><h3>As you can realize, we have a byIdOrTitleService object, but where did we initialize that?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/854/1*EmkcrFQIdQWhrWaOQiBehg.png" /></figure><p>I carried object initialization under the BaseServiceTest class. I can carry them there, my test is under the <strong><em>TestsByIdOrTitle </em></strong>class,<strong><em> </em></strong>and<strong><em> </em></strong>“<strong><em>public class TestsByIdOrTitle extends BaseServiceTest”</em></strong></p><blockquote>Inheritance!</blockquote><p>I don’t want to repeat it in each test case; I want my test case to look simple, readable, and not too crowded. And here is our BaseServiceTest class:</p><pre>import helper.ApiResource;<br>import service.ByIdOrTitleService;<br><br>public class BaseServiceTest {<br>    String url = ApiResource.get(&quot;URL&quot;);<br>    String apiKey = ApiResource.get(&quot;API_KEY&quot;);<br><br>    ByIdOrTitleService byIdOrTitleService = new ByIdOrTitleService();<br>    RequestMaps requestMaps = new RequestMaps();<br>}</pre><h3>Let’s go to the third version of the same test</h3><pre> @Test<br>    public void shouldSearchByTitleAndYearVersion2() {<br>        Map&lt;String, Object&gt; params = requestMaps.titleAndYearMap(&quot;Batman&quot;, &quot;1989&quot;, apiKey);<br>        Response response = byIdOrTitleService.getByIdOrTitle(params, ResponseSpec.checkStatusCodeOK());<br>        assertThat(response.getBody().jsonPath().getString(&quot;Title&quot;),<br>                Matchers.equalToIgnoringCase(&quot;Batman&quot;));<br>    }</pre><h3>As you can realize, we have a requestMaps object, but where did we initialize that?</h3><p>It is also under the BaseServiceTest class. Because I don’t want to write it (object initialization) again and again in each test case.</p><p><em>ByIdOrTitleService byIdOrTitleService = new ByIdOrTitleService();</em></p><p>The line <strong><em>Map&lt;String, Object&gt; params = requestMaps.titleAndYearMap(“Batman”, “1989”, apiKey)</em></strong>; creates a map of query parameters for your API request by calling a helper method.</p><p>Let’s check the <strong><em>RequestMaps</em></strong> class.</p><pre>import java.util.HashMap;<br>import java.util.Map;<br><br>public class RequestMaps {<br>    public Map&lt;String, Object&gt; titleMap(String title, String apiKey) {<br>        Map&lt;String, Object&gt; params = new HashMap&lt;&gt;();<br>        params.put(&quot;t&quot;, title);<br>        params.put(&quot;apikey&quot;, apiKey);<br>        return params;<br>    }<br>    public Map&lt;String, Object&gt; titleAndYearMap(String title, String year, String apiKey) {<br>        Map&lt;String, Object&gt; params = new HashMap&lt;&gt;();<br>        params.put(&quot;t&quot;, title);<br>        params.put(&quot;y&quot;, year);<br>        params.put(&quot;apikey&quot;, apiKey);<br>        return params;<br>    }<br>    public Map&lt;String, Object&gt; imdbIDMap(String apiKey) {<br>        Map&lt;String, Object&gt; params = new HashMap&lt;&gt;();<br>        params.put(&quot;i&quot;, &quot;tt0096895&quot;);<br>        params.put(&quot;apikey&quot;, apiKey);<br>        return params;<br>    }<br>    public Map&lt;String, Object&gt; imdbIDAndYearMap(String apiKey) {<br>        Map&lt;String, Object&gt; params = new HashMap&lt;&gt;();<br>        params.put(&quot;i&quot;, &quot;tt0096895&quot;);<br>        params.put(&quot;y&quot;, &quot;1989&quot;);<br>        params.put(&quot;apikey&quot;, apiKey);<br>        return params;<br>    }<br>    public Map&lt;String, Object&gt; noApiKeyMap(String title) {<br>        Map&lt;String, Object&gt; params = new HashMap&lt;&gt;();<br>        params.put(&quot;t&quot;, title);<br>        return params;<br>    }<br>}</pre><p>Here is the detailed breakdown:</p><ol><li><strong>Helper Method (</strong>requestMaps.titleAndYearMap(…)<strong>)</strong></li></ol><p>This calls the method <strong><em>titleAndYearMap</em></strong> inside our <strong><em>RequestMaps</em></strong> class. That method internally creates a HashMap and puts the following key-value pairs into it:</p><ul><li>“t” (Title) -&gt; “Batman”</li><li>“y” (Year) -&gt; “1989”</li><li>“apikey” -&gt; Your API key</li></ul><p><strong>2. Purpose</strong>: Instead of manually creating a HashMap and calling .put() three times in our test method (like we did in Version1), this one line does all the preparation work for us.</p><p>It prepares the data package needed to tell the OMDb API: “I want to search for the movie ‘Batman’ released in ‘1989’”.</p><p><strong>3. Result</strong>: The <strong><em>params</em></strong> variable now holds this data, ready to be sent to the byIdOrTitleService in the next line.</p><h3>Let’s go to the fourth version of the same test</h3><pre>  @Test(dataProvider = &quot;titleAndYear&quot;, dataProviderClass = DataProviderHelper.class)<br>    public void shouldSearchByTitleAndYearVersion3(String title, String year) {<br>        Map&lt;String, Object&gt; titledAndYear = requestMaps.titleAndYearMap(title, year, apiKey);<br>        Response response = byIdOrTitleService.getByIdOrTitle(titledAndYear, ResponseSpec.checkStatusCodeOK());<br>        assertThat(response.getBody().jsonPath().getString(&quot;Title&quot;), Matchers.equalTo(title));<br>    }</pre><p>This code performs a Data-Driven Test. Instead of writing 5 separate tests for 5 different movies, it runs the <em>same</em> test 5 times with different data.</p><p><strong><em>dataProvider = “titleAndYear” :</em></strong> Tells TestNG to look for a data provider named “titleAndYear”.</p><p><strong><em>dataProviderClass = DataProviderHelper.class : </em></strong>Tells TestNG <em>where</em> to find that provider (in the <strong><em>DataProviderHelper</em></strong> class).</p><pre>package helper;<br><br>import org.testng.annotations.DataProvider;<br><br>public class DataProviderHelper {<br><br>    @DataProvider(name = &quot;titleAndYear&quot;)<br>    public Object[][] getData() {<br>        return new Object[][]{<br>                {&quot;Batman&quot;, &quot;1989&quot;},<br>                {&quot;Inception&quot;, &quot;2010&quot;},<br>                {&quot;The Matrix&quot;, &quot;1999&quot;},<br>                {&quot;Interstellar&quot;, &quot;2014&quot;},<br>                {&quot;The Dark Knight&quot;, &quot;2008&quot;}<br>        };<br>    }<br>}</pre><p><strong>What it is:</strong> A class dedicated to supplying test data.</p><p><strong>What it does:</strong> It stores a list of movie titles and their release years (e.g., “Batman” &amp; “1989”, “Inception” &amp; “2010”).</p><p><strong>Benefit:</strong> It keeps our test data separate from our test logic. If we want to test 50 more movies, we just add them to this list, without touching the test code.</p><p><strong>How it works:</strong></p><ol><li>TestNG goes to DataProviderHelper.</li><li>It picks the first pair: title=”Batman”, year=”1989&quot;.</li><li>It runs the test method passing these values as arguments.</li><li>Then it picks the next pair (“Inception”, “2010”) and runs the test again.</li><li>It repeats this for every row in the data array.</li></ol><p><strong>*</strong> This setup allows us to verify that our “Search by Title and Year” functionality works correctly for <em>multiple</em> different movies automatically, using just one block of test code.</p><blockquote>So, reduce repetition, write clean and well-organized code, and make code maintenance easier.</blockquote><p><strong><em>(Service Layer) ByIdOrTitleService</em></strong><em>:</em> API requests are abstracted under the `service` package. This ensures test codes are cleaner and more readable. Wraps RestAssured codes to prevent repetition.</p><p><strong><em>RequestMaps:</em></strong> That method internally creates a HashMap and puts the following key-value pairs into it. Instead of manually creating a HashMap and calling .put() three times in our test method (like we did in Version1), this class’s methods do all the preparation work for us.</p><blockquote>Well.. Here, we’ve covered how to write an api test! I hope you like it.</blockquote><p><em>For further information, you can examine </em><a href="https://github.com/cerenmert/tests-omdb-api"><em>my GitHub project.</em></a></p><p><em>Do not hesitate to give a comment and contact me on </em><a href="https://www.linkedin.com/in/cerencakirr/"><em>LinkedIn</em></a></p><p><em>Thanks, and keep learning!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8f38f8848629" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[When do we use the static keyword in Java? And what is a constructor?]]></title>
            <link>https://cerenmert.medium.com/when-do-we-use-the-static-keyword-in-java-and-what-is-a-constructor-9bb237e39222?source=rss-592fd46bb2ea------2</link>
            <guid isPermaLink="false">https://medium.com/p/9bb237e39222</guid>
            <category><![CDATA[objects]]></category>
            <category><![CDATA[static]]></category>
            <category><![CDATA[constructor]]></category>
            <category><![CDATA[java]]></category>
            <dc:creator><![CDATA[Ceren Çakır]]></dc:creator>
            <pubDate>Tue, 03 Feb 2026 16:58:08 GMT</pubDate>
            <atom:updated>2026-02-03T16:58:08.964Z</atom:updated>
            <content:encoded><![CDATA[<p>Let’s learn what a <strong><em>constructor</em></strong> is and how we use the <strong><em>static</em></strong> keyword.</p><p>A constructor is a special method that is automatically called when an object is instantiated.</p><p>We can initialize our variables in the constructor. Its name must be the same as the class name. And the constructor does not have a return type.</p><p>You can have multiple constructors in a class (Constructor Overloading)</p><blockquote>Instance variable = Non-static variable</blockquote><blockquote>Static variable = Class variable</blockquote><pre>package org.example.StaticAndNonStatic;<br><br>public class StaticVar {<br>    String name;   // Instance variable <br>    String address;   // Instance variable <br>    static String city = &quot;İzmir&quot;;   // Static variable <br>    static int i = 0;   // Static variable<br><br>    public StaticVar() {<br>        System.out.println(&quot;This is a default constructor&quot;);<br>    }<br><br>    // nameOf and addressOf are local variables. They are only accessible within this constructor<br>    // We use &quot;this&quot; keyword to refer to the instance variables of the class<br>    public StaticVar(String nameOf, String addressOf) {<br>        this.name = nameOf;<br>        this.address = addressOf;<br>        i++;<br>        System.out.println(i); <br>     // &quot;i&quot; is static var. first it will be printed as 1, then 2, then 3 when each object is created.       <br>     // if &quot;i&quot; was non-static, it would be printed as 1 each time when each object is created<br>        System.out.println(&quot;This is a parameterized constructor.&quot;);<br>        System.out.println(&quot;Name: &quot; + name + &quot;, Address: &quot; + address + &quot;, City: &quot; + city);<br>    }<br><br>    public void getName() {<br>        System.out.println(&quot;Name is: &quot; + name);<br>    }<br><br>    public void getAddress() {<br>        System.out.println(&quot;Address is: &quot; + address + &quot;, City is: &quot; + city);<br>    }<br><br>    public void getCity() {<br>        System.out.println(&quot;City is: &quot; + city);<br>    }<br><br>    public static void main(String[] args) {<br>        StaticVar staticVar = new StaticVar();<br>        StaticVar person1 = new StaticVar(&quot;Ceren&quot;, &quot;123 Main St&quot;);<br>        StaticVar person2 = new StaticVar(&quot;Elif&quot;, &quot;456 Apple St&quot;);<br>        person1.getName();<br>        person1.getAddress();<br>        person2.getName();<br>        person2.getAddress();<br>        StaticVar.city = &quot;Adana&quot;; // Modifying static variable by using className.<br>        person1.getCity();<br>    }<br>}</pre><p><em>StaticVar staticVar = new StaticVar();</em></p><p>With the above line, we are creating objects of the StaticVar class. When we create an object, the constructor is called. Creating an object means creating an instance of the class. While creating person1 and person2 objects, the constructor is called each time, and the instance variables are initialized with different values for each object. And this is allocated in heap memory.<br>But if we had static variables, they would be shared among all instances of the class and allocated in the method area.</p><h4><em>Static</em> methods can access all <em>static</em> variables and other S<em>tatic</em> methods. <em>Static</em> methods can’t access instance variables and instance methods directly. They need some object reference to do so.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1006/1*4GOhnhPofivY3eRMrVfC0Q.png" /></figure><p>Static variables are not tied to any specific object/instance of the class. Static variables belong to the class itself. So, static variables can be accessed directly using the class name without creating an object/instance of the class.</p><h3><strong><em>Static variables are initialized only once when the class is loaded into memory. So we save memory by using static variables.</em></strong></h3><p>Static variables are often used for constants or shared data that should be the same across all instances of a class. Example of a static variable: static int pi = 3.14; Here, pi is a static variable that can be accessed using StaticVar.pi without creating an instance of the StaticVar class.</p><p>When there is a requirement to share a method or a variable between multiple objects of a class, instead of creating separate copies for each object, we use the static keyword to make a method or variable shared for all objects.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/465/1*NwBwVbDQ_F8RBCPjauSOoA.png" /></figure><blockquote>If you look closely, you’ll realize that both people have the same city name “İzmir”. What if we had to create 100 people instead of 2 people? That means we’d be initializing a variable with the same value 100 times — allocating new memory every time!</blockquote><p>While this may not appear to be an issue, in a much larger codebase, it could become a flaw and unnecessarily slow your program down. To fix this problem, we are using the static keyword to create the city variable. After that, all instances of the class can make use of that variable.</p><h3>Why is there not an abstract static method?</h3><p>In Java, you cannot define a method as both abstract and static. There is a very logical reason for this.</p><p><strong>Abstract </strong>said<strong>:</strong> “There is no body to this method, the subclasses should override it.”<br><strong>Static </strong>said<strong>:</strong> “This method belongs to the class, not the object; it cannot be overridden”.</p><p>These two concepts are opposite to each other. You cannot abstract something that cannot be overridden.</p><pre>class Shape {<br>    public static void makeNoise() {<br>        System.out.println(&quot;Shape is making noise&quot;);<br>    }<br>}<br><br>class Triangle extends Shape {<br>    // You will get an error, if you write @Override here.<br>    public static void makeNoise() { <br>        System.out.println(&quot;Triangle is making noise&quot;);<br>    }<br>}<br><br>public class Main {<br>    public static void main(String[] args) {<br>        Shape s = new Triangle();<br>        s.makeNoise(); // Output: &quot;Shape is making noise&quot; (Because referans type is Shape)<br>    }<br>}</pre><h3><strong>The Purpose of Static Variables</strong></h3><p><strong><em>1. Common Data Sharing:</em></strong> To keep common information that all objects need to know (for example, <em>the name of a company, the difficulty level of a game, the total number of produced cars</em>)</p><p><strong><em>2 . Memory Efficiency:</em></strong> If the data is the same for each object, we keep it in a single point by identifying it repeatedly within each object and making it static rather than wasting memory.</p><pre>package org.example;<br><br>public class Car {<br>    String model;  // Model of each car is different so it is Instance Variable<br>    static int totalProduction = 0; // total production is same for each car so it is Static Variable<br><br>    public Car(String model) {<br>        this.model = model;<br>        totalProduction++; // increase the total production count whenever a new car is created<br>    }<br><br>    public static void productionReport() {<br>        System.out.println(&quot;Total produced car count until now: &quot; + totalProduction);<br>    }<br><br>    public static void main(String[] args) {<br>        Car a1 = new Car(&quot;Tesla&quot;); <br>        Car a2 = new Car(&quot;Volvo&quot;);<br>        Car a3 = new Car(&quot;Audi&quot;);<br>        Car.productionReport(); // Output: Total produced car count until now: 3<br>    }<br>}</pre><p>In a static method, this and super can not be used!</p><p>Because these keywords reference the object, the static method has no object/instance.</p><h3>Why is the starting point of Java applications “public static void main” static?</h3><p>The reason is that the JVM has not yet created any objects when starting the program!</p><p><em>Thanks, and keep learning!</em></p><p><em>You can follow me for more on </em><a href="https://github.com/cerenmert"><em>GitHub</em></a><em>, </em><a href="https://www.linkedin.com/in/cerencakirr/"><em>LinkedIn</em></a><em>, and </em><a href="https://cerenmert.medium.com/"><em>Medium</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9bb237e39222" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Jenkins Configurations for Postman Collections]]></title>
            <link>https://cerenmert.medium.com/ci-cd-with-jenkins-and-postman-762744d01d65?source=rss-592fd46bb2ea------2</link>
            <guid isPermaLink="false">https://medium.com/p/762744d01d65</guid>
            <category><![CDATA[testing]]></category>
            <category><![CDATA[ci-cd-pipeline]]></category>
            <category><![CDATA[postman]]></category>
            <category><![CDATA[jenkins]]></category>
            <dc:creator><![CDATA[Ceren Çakır]]></dc:creator>
            <pubDate>Mon, 02 Feb 2026 18:01:11 GMT</pubDate>
            <atom:updated>2026-02-02T20:30:07.839Z</atom:updated>
            <content:encoded><![CDATA[<p>Using the Postman CLI, you can run Postman collections with your API tests as part of a Jenkins pipeline. <a href="https://www.jenkins.io/">Jenkins</a> is an open-source automation server that can act as a continuous integration (CI) server or a continuous delivery (CD) hub. You can run a Postman Collection and its API tests from Jenkins. You can also specify the frequency at which Jenkins runs a collection.</p><p>Use <a href="https://learning.postman.com/docs/postman-cli/postman-cli-overview">Postman CLI</a> or <a href="https://learning.postman.com/docs/collections/using-newman-cli/continuous-integration">Newman</a> to integrate Postman with your CI/CD workflow. The Postman API and <a href="https://learning.postman.com/docs/postman-cli/postman-cli-overview">Postman CLI</a> use API keys for authentication. A Postman API key tells the server that the request came from you.</p><p>Click your avatar in the Postman header, then click Settings. In the <a href="https://go.postman.co/settings/me/account/">account settings</a> page, click <a href="https://go.postman.co/settings/me/api-keys">API keys</a>. First, if you already have an API key, use it. If not, create a new one.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OK642nF33iuqUSmOxjlcCw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g9h8Suf1MgAooRIKOljRCQ.png" /></figure><h3><strong>Trello API — Postman CLI — freestyle</strong></h3><p>Ensure that Postman CLI is installed on the Jenkins server (or agent machine)</p><p>Select “New Item” -&gt; “Freestyle project”</p><p>The Postman CLI typically requires logging in with an API Key to function.</p><p>API Key must be stored in Jenkins Credentials</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ceg8IvnLbXunf7v419j-Ig.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T8xtNVo-bn6u3bHuOnvixA.png" /></figure><p>You can get the collection ID and environment ID from Postman</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/860/1*mnMrKblxNMbriJhFPfnHUg.png" /></figure><p><strong>Build Steps :</strong></p><ul><li>Click “Add build step”</li><li><strong>Select Execute Shell</strong> (Mac/Linux) or <strong>Execute Windows batch command</strong> (Windows) option.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GlWWqv1tLjhojYVnFWY_8g.png" /></figure><p><strong>Do not use an unencrypted api key directly.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TME73b8-89y0mpLZ5p5b4Q.png" /></figure><p>You can see the results in the Console in Jenkins, as well as in the Postman Run section.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yqsNaLC71L-O42rxwLCB0w.png" /></figure><h3><strong>Trello API — Postman CLI — Pipeline</strong></h3><p>You can get a CLI command from Postman, and then you can use it while creating a pipeline in Jenkins</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/946/1*NbL3ryeSuh6e6e7UXHjc_w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qzMWPX43HQwk1U7S2t6i0Q.png" /></figure><p>Go to Jenkins, create a new job selecting Pipeline.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/876/1*XRetl9QBiCWSXKoT-HTmGg.png" /></figure><p>Paste a script that you copied from Postman</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5bITXpb6AVoZBgAbFyVNtg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/911/1*xbx2lX7Pg5oxY5F700ARHA.png" /></figure><h3><strong>Trello API —Newman— freestyle</strong></h3><p>Node.js and Newman (npm install -g newman) must be installed on the Jenkins server.</p><p><a href="https://learning.postman.com/docs/collections/using-newman-cli/integration-with-jenkins">To install Newman in Jenkins, do the following:</a></p><ol><li>Click Manage Jenkins.</li><li>Under System Configuration, select Tools.</li><li>Under NodeJS installations, select Add NodeJS.</li><li>Enter a name for the NodeJS installation.</li><li>In Global npm packages to install, enter “Newman”.</li><li>Click Save.</li></ol><p>Definitely, you can run in the terminal. Let’s run in our local first</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sz0jmlsEZ9bvQ0-kIiuW8g.png" /></figure><p>Now, let’s create a job in Jenkins to run via Newman</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OzJGFUbUcX4wnEvx9D9e_Q.png" /></figure><p><strong>Build Steps:</strong></p><ul><li>Click Build Steps, then select Add build step &gt; Execute shell to run a shell command. Enter a shell command to <a href="https://learning.postman.com/docs/collections/using-newman-cli/installing-running-newman#run-a-collection-with-newman">run the collection using Newman</a>, for example:</li><li>If you select “Publish JUnit test result report” in the “Post-build actions” section and provide the path to newman/report.xml, you can view the test graphs in the Jenkins interface.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wwQeosOmQo8RMo4XRelcbg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/979/1*9IgwLQ--kQLJL4xMPpHMSg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jihDz7pFbawXfNh38AVBUg.png" /></figure><p>Thank you for your time :)</p><p>You can follow me for more on <a href="https://github.com/cerenmert">GitHub</a>, <a href="https://www.linkedin.com/in/cerencakirr/">LinkedIn</a>, and <a href="https://cerenmert.medium.com/">Medium</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=762744d01d65" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Java — Understanding Map with example (2)]]></title>
            <link>https://cerenmert.medium.com/java-understanding-map-with-example-2-0378167b7024?source=rss-592fd46bb2ea------2</link>
            <guid isPermaLink="false">https://medium.com/p/0378167b7024</guid>
            <category><![CDATA[maps]]></category>
            <category><![CDATA[arrays]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[mapping]]></category>
            <dc:creator><![CDATA[Ceren Çakır]]></dc:creator>
            <pubDate>Wed, 21 Jan 2026 22:01:40 GMT</pubDate>
            <atom:updated>2026-01-21T22:02:31.621Z</atom:updated>
            <content:encoded><![CDATA[<h3>Java — Understanding Map with example (2)</h3><p><a href="https://codingbat.com/prob/p103593">Example 2:</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fzlevdfwAi8ZixXshevL1Q.png" /></figure><h3>Örnek 2 (En açıklayıcı örnek)</h3><p><strong>Input:</strong> [&quot;a&quot;, &quot;b&quot;, &quot;a&quot;, &quot;c&quot;, &quot;a&quot;, &quot;d&quot;, &quot;a&quot;] -&gt; &quot;aa&quot;</p><p>Adım adım takip et:</p><ol><li><strong>“a”</strong> (Kaçıncı görüşümüz? 1. kez) -&gt; Tek sayı, geç.</li><li><strong>“b”</strong> (Kaçıncı görüşümüz? 1. kez) -&gt; Tek sayı, geç.</li><li><strong>“a”</strong> (Kaçıncı görüşümüz? 2. kez) -&gt; <strong>BİNGO!</strong> Sonuca “a” ekle. (Sonuç şu an: &quot;a&quot;)</li><li><strong>“c”</strong> (Kaçıncı görüşümüz? 1. kez) -&gt; Tek sayı, geç.</li><li><strong>“a”</strong> (Kaçıncı görüşümüz? 3. kez) -&gt; Tek sayı, geç. (Burası önemli, 3. gelişte eklemiyoruz!)</li><li><strong>“d”</strong> (Kaçıncı görüşümüz? 1. kez) -&gt; Tek sayı, geç.</li><li><strong>“a”</strong> (Kaçıncı görüşümüz? 4. kez) -&gt; <strong>BİNGO!</strong> Çift sayı. Sonuca “a” ekle. (Sonuç şu an: &quot;aa&quot;)</li></ol><p><strong>Output:</strong> &quot;aa&quot;</p><p>Kodun iskeletini oluşturman için sana 3 maddelik bir yol haritası vereyim:</p><p><strong>1. Hafızanı Oluştur (Map)</strong> Hangi kelimenin kaçıncı kez geldiğini takip etmek için bir Map&lt;String, Integer&gt; tanımlamalısın.</p><ul><li>Anahtar (Key): Kelimenin kendisi (“a”, “b” vb.)</li><li>Değer (Value): O ana kadar kaç kere görüldüğü (1, 2, 3…)</li></ul><p><strong>2. Döngü İçindeki Sıralama (Çok Önemli!)</strong> Döngünün içinde yapacağın işlemlerin sırası hayati önem taşıyor. Şu sırayı izle:</p><ol><li>Önce kelimenin şu anki sayısını haritadan öğren (yoksa 0&#39;dır).</li><li>Bu sayıyı <strong>1 artır</strong> ve haritaya <strong>geri koy (put)</strong>. (Yani sayacı güncelle).</li><li><strong>Hemen ardından</strong> bu yeni sayıyı kontrol et:</li></ol><ul><li>Eğer bu yeni sayı <strong>çift ise</strong> (sayi % 2 == 0), kelimeyi sonuç stringine ekle.</li><li>Tek ise hiçbir şey yapma, döngü devam etsin.</li></ul><p><strong>3. Küçük Bir Taktik</strong> Haritadan değer okurken ve artırırken işini kolaylaştırmak için şöyle bir yapı kurabilirsin:</p><pre>// Önce kelime var mı diye bak<br>if (map.containsKey(s)) {<br>    int sayi = map.get(s);<br>    // Sayıyı artırıp geri koy...<br>    // Çift mi diye bak...<br>} else {<br>    // İlk kez geldiyse, haritaya 1 olarak ekle.<br>}</pre><p>Yapman gereken şey şu: Map’i <strong>sadece saymak için</strong> kullan, sonucu ise <strong>ayrı bir String değişkende</strong> biriktir.</p><p>İşte kodumuz:</p><pre>public class WordAppend extends BaseClass {<br>    public static void main(String[] args) {<br>        String[] strings = {&quot;a&quot;, &quot;b&quot;, &quot;b&quot;, &quot;a&quot;, &quot;a&quot;};<br>        String actual = wordAppend(strings);<br>        String expected = &quot;ba&quot;;<br>        isTestPassed(actual, expected);<br><br>        String[] strings1 = {&quot;not&quot;, &quot;and&quot;, &quot;or&quot;, &quot;and&quot;, &quot;this&quot;, &quot;and&quot;, &quot;or&quot;, &quot;that&quot;, &quot;not&quot;};<br>        String actual1 = wordAppend(strings1);<br>        String expected1 = &quot;andornot&quot;;<br>        isTestPassed(actual1, expected1);<br><br>        String[] strings2 = {&quot;a&quot;, &quot;b&quot;, &quot;a&quot;};<br>        String actual2 = wordAppend(strings2);<br>        String expected2 = &quot;a&quot;;<br>        isTestPassed(actual2, expected2);<br>    }<br><br>    public static String wordAppend(String[] strings) {<br>        Map&lt;String, Integer&gt; map = new HashMap&lt;&gt;();<br>        String result = &quot;&quot;;<br>        for (String str : strings) {<br>            int count = 0;<br>            if (map.containsKey(str)) { <br>                count = map.get(str); <br>            }<br>            count++;<br>            map.put(str, count); <br>            if (count % 2 == 0) {<br>                result = result + str; <br>            }<br>        }<br>        return result;<br>    }<br>}</pre><pre>public class BaseClass {<br>    public static void isTestPassed(Object actual, Object expected) {<br>        System.out.println(actual.equals(expected) ? &quot;PASSED&quot; : &quot;FAILED&quot;);<br>    }<br>}</pre><p>You can find this example and more in this repository:</p><p><a href="https://github.com/cerenmert/javaCodingBat">https://github.com/cerenmert/javaCodingBat</a></p><h4>Thanks!</h4><blockquote>We often think that great achievements require great actions. However, it is surprising the difference a small improvement can make over time. If you improve by 1 percent every day for 1 year, you will be 37 times better by the end of the year. So, keep working!</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0378167b7024" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Java — Understanding Map with an example]]></title>
            <link>https://cerenmert.medium.com/java-understanding-map-with-an-example-cec50ec67bc2?source=rss-592fd46bb2ea------2</link>
            <guid isPermaLink="false">https://medium.com/p/cec50ec67bc2</guid>
            <category><![CDATA[mapping]]></category>
            <category><![CDATA[maps]]></category>
            <category><![CDATA[arrays]]></category>
            <category><![CDATA[java]]></category>
            <dc:creator><![CDATA[Ceren Çakır]]></dc:creator>
            <pubDate>Wed, 21 Jan 2026 21:20:59 GMT</pubDate>
            <atom:updated>2026-01-21T22:02:35.081Z</atom:updated>
            <content:encoded><![CDATA[<h3>Java — Understanding Map with an example (1)</h3><h4>Use map.get(<em>key</em>) to make a new empty map, use map.get(<em>key</em>) to retrieve the stored value for a key, or null if that key is not present in the map, use map.put(<em>key</em>, <em>value</em>) to store a new key/value pair in the map. Overwrites any existing value for that key, use map.containsKey(<em>key</em>) to return true if the key is in the map, false otherwise.</h4><p><a href="https://codingbat.com/prob/p168493">Example 1:</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zHblseOnL2EAa1P15Z7tWg.png" /></figure><pre>public class FirstChar extends BaseClass {<br>    public static void main(String[] args) {<br>        FirstChar firstChar = new FirstChar();<br>        String[] strings = {&quot;salt&quot;, &quot;tea&quot;, &quot;soda&quot;, &quot;toast&quot;};<br>        Map&lt;String, String&gt; actual = firstChar.firstChar(strings);<br>        Map&lt;String, String&gt; expected = new HashMap&lt;&gt;();<br>        expected.put(&quot;s&quot;, &quot;saltsoda&quot;);<br>        expected.put(&quot;t&quot;, &quot;teatoast&quot;);<br>        isTestPassed(actual, expected);<br>    }<br><br>    public Map&lt;String, String&gt; firstChar(String[] strings) {<br>        Map&lt;String, String&gt; map = new HashMap&lt;&gt;();<br>        for (String s : strings) {<br>            String firstChar = s.substring(0, 1);<br>            if (map.containsKey(firstChar)) { <br>                String newWord = map.get(firstChar) + s;<br>                map.put(firstChar, newWord);<br>            } else {<br>                map.put(firstChar, s); <br>            }<br>        }<br>        return map;<br>    }<br>}</pre><pre>public class BaseClass {<br>    public static void isTestPassed(Object actual, Object expected) {<br>        System.out.println(actual.equals(expected) ? &quot;PASSED&quot; : &quot;FAILED&quot;);<br>    }<br>}</pre><h3>Kodun çalışma mantığı:</h3><p>Kodun şu kısmı her turda çalışıyor: String firstChar = s.substring(0, 1);</p><h4>1. Tur: Kelime “salt”</h4><ol><li>s = &quot;salt&quot;</li><li>firstChar = <strong>&quot;s&quot;</strong> (Sadece baş harf)</li><li>map.containsKey(&quot;s&quot;) diye bakıyor. Harita boş, cevap <strong>Hayır</strong>.</li><li>else kısmına giriyor: map.put(firstChar, s);</li></ol><ul><li>Burada map’e şunu diyor: “Etiketi <strong>‘s’</strong> olan kutuya, <strong>‘salt’</strong> kelimesini koy.”</li><li><strong>map:</strong> {&quot;s&quot;: &quot;salt&quot;}</li></ul><h4>2. Tur: Kelime “tea”</h4><ol><li>s = &quot;tea&quot;</li><li>firstChar = <strong>&quot;t&quot;</strong></li><li>if(map.containsKey(firstChar)) satırı çalışıyor.</li><li>map.containsKey(&quot;t&quot;) diye bakıyor. Harita boş, cevap <strong>Hayır</strong>.</li><li>else kısmına giriyor: map.put(firstChar, s);</li></ol><ul><li>Burada map’e şunu diyor: “Etiketi <strong>‘t’</strong> olan kutuya, <strong>‘tea’</strong> kelimesini koy.”</li><li><strong>map:</strong> {“s”: “salt”, “t”: “tea”}</li></ul><h4>3. Tur: Kelime “soda”</h4><ol><li>s = &quot;soda&quot;</li><li>firstChar = <strong>&quot;s&quot;</strong> (Yine sadece baş harf hesaplandı)</li><li>if(map.containsKey(firstChar)) satırı çalışıyor.</li></ol><p>Şuna bakıyoruz: map.containsKey(&quot;s&quot;)</p><ol><li>Haritada “s” etiketi var mı? <strong>Evet</strong> (Az önce “salt” koyarken oluşturduk).</li><li>O zaman if içine giriyor.</li></ol><pre>String newWord = map.get(firstChar) + s; // map.get(&quot;s&quot;)=salt , s=soda, newWord=saltsoda<br>map.put(firstChar, newWord); // map.put(s, saltsoda);</pre><ul><li><strong>map:</strong> {“s”: “saltsoda”, “t”: “tea”}</li></ul><h4>4. Tur: Kelime “toast”</h4><ol><li>s = &quot;toast&quot;</li><li>firstChar = <strong>&quot;t&quot;</strong></li><li>if(map.containsKey(firstChar)) satırı çalışıyor.</li></ol><p>Şuna bakıyoruz: map.containsKey(&quot;t&quot;)</p><ol><li>Haritada “t” etiketi var mı? <strong>Evet</strong> (Az önce “tea” koyarken oluşturduk).</li><li>O zaman if içine giriyor.</li></ol><pre>String newWord = map.get(firstChar) + s; // map.get(&quot;t&quot;)=tea , s=toast, newWord=teatoast<br>map.put(firstChar, newWord); // map.put(t, teatoast);</pre><ul><li><strong>map:</strong> {&quot;s&quot;: &quot;saltsoda&quot;, &quot;t&quot;:&quot;teatoast&quot;}</li></ul><pre>return map;  // {&quot;s&quot;: &quot;saltsoda&quot;, &quot;t&quot;:&quot;teatoast&quot;}</pre><p>You can find this example and more in this repository:</p><p><a href="https://github.com/cerenmert/javaCodingBat">https://github.com/cerenmert/javaCodingBat</a></p><h4>Thanks!</h4><blockquote>We often think that great achievements require great actions. However, it is surprising the difference a small improvement can make over time. If you improve by 1 percent every day for 1 year, you will be 37 times better by the end of the year. So, keep working!</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cec50ec67bc2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What was the day on the 10th of November in 1938?]]></title>
            <link>https://cerenmert.medium.com/what-was-the-day-on-the-10th-of-november-in-1938-b4690de45533?source=rss-592fd46bb2ea------2</link>
            <guid isPermaLink="false">https://medium.com/p/b4690de45533</guid>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[getdate]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[testing]]></category>
            <category><![CDATA[calendar]]></category>
            <dc:creator><![CDATA[Ceren Çakır]]></dc:creator>
            <pubDate>Tue, 12 Nov 2024 16:52:08 GMT</pubDate>
            <atom:updated>2024-11-12T16:52:08.493Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Return the day on a specific date</strong></h3><p>The <a href="https://docs.oracle.com/javase/7/docs/api/java/util/Calendar.html">Calendar class</a> is an abstract class that provides methods for converting between a specific instant in time and a set of calendar fields such as YEAR, MONTH, DAY_OF_MONTH, HOUR, and so on, and for manipulating the calendar fields, such as getting the date of the next week.</p><p>You are given a date. You just need to write the method, getDay, which returns the day on that date.</p><pre>import java.util.*;<br><br>public class Result {<br>    public static String findDay(int month, int day, int year) {<br>        // Create a Calendar instance<br>        Calendar calendar = Calendar.getInstance();<br><br>        // Set the calendar to the given date <br>        //(month-1) because Calendar months are 0-indexed<br>        // (i.e., January is 0, February is 1, etc.)<br>        calendar.set(year, month - 1, day);<br><br>        // Get the day of the week<br>        int dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK);<br>        System.out.println(&quot;dayOfWeek: &quot; + dayOfWeek);<br><br>        // Convert the day of the week to a String (1 = Sunday, 2 = Monday, etc.)<br>        String[] days = { &quot;SUNDAY&quot;, &quot;MONDAY&quot;, &quot;TUESDAY&quot;, &quot;WEDNESDAY&quot;, &quot;THURSDAY&quot;, &quot;FRIDAY&quot;, &quot;SATURDAY&quot; };<br><br>        // Return the day of the week in uppercase<br>        // Calendar.DAY_OF_WEEK is 1-based (Sunday=1, Monday=2, etc.)<br>        return days[dayOfWeek - 1];  <br>    }<br><br>    public static void main(String[] args) {<br>        int month = 11;<br>        int day = 10;<br>        int year = 1938; <br>        System.out.println(findDay(month, day, year));<br>    }<br>}</pre><p><strong><em>The 10th of November in 1938 was Thursday.</em></strong></p><p>Let’s run and check the result.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/742/1*E4jG8rWiLqVbcbWiy3SRvw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b4690de45533" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to share the Postman collection and changes made in the collection by using GitHub?]]></title>
            <link>https://cerenmert.medium.com/how-to-share-the-postman-collection-and-changes-made-in-the-collection-by-using-github-47028eecdcab?source=rss-592fd46bb2ea------2</link>
            <guid isPermaLink="false">https://medium.com/p/47028eecdcab</guid>
            <category><![CDATA[postman-collections]]></category>
            <category><![CDATA[intellij-idea]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[test-automation]]></category>
            <category><![CDATA[postman]]></category>
            <dc:creator><![CDATA[Ceren Çakır]]></dc:creator>
            <pubDate>Mon, 26 Feb 2024 12:33:43 GMT</pubDate>
            <atom:updated>2024-02-26T12:33:43.317Z</atom:updated>
            <content:encoded><![CDATA[<p>I’m using here: Postman, IntelliJ IDEA, GitHub</p><p>Before starting, you need to have a Postman collection, you need to know Git to understand what I did here, and you need to have a tool like IntelliJ IDEA.</p><p>At first, we need a Git repository. Let’s create a repository.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WdTBGf02wLMmaC-5s_MyQg.png" /></figure><p>Once this has been created, all I have to do is go to clone and download, and I have to get the address where this is located. So I can easily copy this. And I’m gonna use IntelliJ IDEA to manage this repository. But you can use any other tools that you like.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*smR0GoTjf3Wr5YHEhvhmGA.png" /></figure><p>Now, I open IntelliJ IDEA then I click on <strong>Get from VCS</strong> and paste the URL, then Clone it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E2bHUnWMOGmCL28wvQ2RPg.png" /></figure><p>After cloning the project, it’s displayed as empty at first. Because we have not done anything yet.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I_slM8R0TevverFVSIo8sw.png" /></figure><p>Let’s go to Postman. So what I will do with this collection is I will click these three dots and I’ll click the Export option from the menu that appeared here.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1002/1*ZSaI8-7_jpKRKLfHxID4iA.png" /></figure><p>And I export the collection with the latest version that is being recommended.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/954/1*ExCGbKbyMpZ11obTxSUYQg.png" /></figure><p>Now, all I have to do is to locate the folder that we have checked out previously.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zbgkg6PIyyzUudLgRDRKaA.png" /></figure><p>Then go to Postman collection, this is the first version of my requests and let’s say we want to make minor changes to the name of the first request. It’s now <strong><em>Get member’s all boards * (map)</em> </strong>and we’ll change it to <strong><em>Get member’s all boards * (map1)</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/726/1*AZOeaTGed0hCyF7tUy_SNg.png" /></figure><p>Then go to IntelliJ IDEA, and change the name of it as you can see below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AXoUexK58LxroQnCqyi9kg.png" /></figure><p>Then commit and push by adding a comment below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IkT0RTxpK2e1fsKB3-yuEQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Bh-Bu14kPlrYr-6OCYy0yw.png" /></figure><p>After pushing, you need to see the info at the bottom of the page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/844/1*q8UHXR19eXRmCZo9AvpTow.png" /></figure><p>Go to GitHub, and refresh the page. You need to see the JSON file with the comment anymore.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*D5p3jKiJp-cUDCzTrl7fjg.png" /></figure><p>Then go to Postman, click import button, and select the file from where we saved it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-wcQWw2MKugAxdQhTuVmIA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g3roJu0KFYKEvhdrsUeBMw.png" /></figure><p>I will select import as Copy to see the differences clearly</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*IbPbSKPcCmzX7hfE-sek_Q.png" /><figcaption>2s</figcaption></figure><p>So that’s it. We can see the initial name of the request and the last version of the name after we change it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*iKjfDDrtRr5iLCrdgZazhg.png" /></figure><p>Now, let’s imagine that somebody else made a change to this file, and I’ll simulate it by directly changing it inside GitHub. You will be able to easily make a change here. So you’ll see here that the name of a request is</p><p><strong><em>Get member’s all boards * (map1)</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8wFPY6IOTNpVdZviVhwN7w.png" /></figure><p>So let’s call this <strong><em>Get member’s all boards * (map2)</em></strong>. Then click the commit changes button</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/899/1*_h6NPPjPJdbGuv67pqKPEg.png" /></figure><p>Now, it doesn’t matter who has to do it. Any user who now wants to have the latest version or to make changes to this collection should do the following steps.</p><p>And the first step would be to pull the latest changes from the repository. So I will pull the latest changes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1urWHVtSjc85Un4n4WE7Vg.png" /></figure><p>And now if I look at the differences by clicking “show diff” which I signed below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DU49WrRiz2gFHkIBT_Pa3w.png" /></figure><p>So left was the first version, and the right one is just a minor change that we did by using GitHub.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0ctDMzAe2P2nfQHslqtJzw.png" /></figure><p>Now, we can see the last version of the request name.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2b5HKBbG0bVr0BWbbNmswg.png" /></figure><p>Now, if I go back to Postman. We have pulled these changes and still don’t have the latest version here in Postman. So what we need to do is to hit this Import button and we are gonna import a file. <strong>Then follow the same steps as I explained step by step above.</strong></p><p>So finally, we can see the latest version of the request name in Postman.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/636/1*IV9rsidpCr8u9EVigzNjSg.png" /></figure><p>As soon as you make another change, you’ll be able to go through the same process again. So you’ll export the collection as a file, you will commit it, you’ll have to push it, and everybody else will have to pull these changes and manually import them again.</p><p><strong>So this is how you can use Git with your Postman collections.</strong></p><p>Thanks!</p><p>You can follow me for more on <a href="https://github.com/cerenmert">GitHub</a>, <a href="https://www.linkedin.com/in/cerencakirr/">LinkedIn</a>, and <a href="https://cerenmert.medium.com/">Medium</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=47028eecdcab" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Running Postman collection in a CI/CD server with Jenkins and CLI tools (Newman, Postman CLI)]]></title>
            <link>https://cerenmert.medium.com/running-postman-collection-in-a-ci-cd-server-with-jenkins-and-cli-tools-newman-postman-cli-9b516213923f?source=rss-592fd46bb2ea------2</link>
            <guid isPermaLink="false">https://medium.com/p/9b516213923f</guid>
            <category><![CDATA[postman-cli]]></category>
            <category><![CDATA[newman]]></category>
            <category><![CDATA[postman]]></category>
            <category><![CDATA[jenkins]]></category>
            <category><![CDATA[postman-collections]]></category>
            <dc:creator><![CDATA[Ceren Çakır]]></dc:creator>
            <pubDate>Sat, 24 Feb 2024 10:59:33 GMT</pubDate>
            <atom:updated>2024-02-24T10:59:33.064Z</atom:updated>
            <content:encoded><![CDATA[<ul><li>Run with Postman Runner, Newman, Postman CLI, and Jenkins</li></ul><p>If we have a Postman collection and we don’t want to run this collection manually for each test, we can run this collection in CI/CD server by using CLI tools such as Postman CLI and Newman, also we can run the collection with Jenkins.</p><p>I have a collection based on <a href="https://developer.atlassian.com/cloud/trello/rest/api-group-actions/#api-group-actions">Trello</a>. Click three dot and select “Run collection” option, then Runner screen is opened. Select “run manually” option at first. And click “Run Trello API” button</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6gRNz46_b_vEsWXUyGNtTg.png" /></figure><p>Click three dot and select “Edit” option. Then select “Runs” from the titles. This run is shown as “Ran locally using Collection Runner” in the Runs part. Its source should be shown as Runner.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8FKVzSgs3f-8LJL1qObQug.png" /></figure><p>We can get more details about requests and tests after running when you click on it. Details are shown below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/692/1*divm8aCHhRIDTy1wbmbP4A.png" /></figure><p>After clicking the “View Summary”, we can see the results as a summary below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UKf---Fkptk2z7ZiaAdM3g.png" /></figure><ul><li>There is an ID under the Collection details. This ID is used while running via Postman CLI.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H76YxnK8hfLwlXIwI-cy8Q.png" /></figure><p>And now, we are selecting “Automate runs via CLI” option. We need to configure CLI command to run on our build pipeline after <a href="https://learning.postman.com/docs/postman-cli/postman-cli-installation/#mac-apple-chip-installation">downloading Postman CLI</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aVoUii1Q47Tmn3lkU_8R7g.png" /></figure><p>Then copy this command and run it in your local terminal. Before doing that, we need an API key, you can generate your own API key or if you have already an API key, you can use it. Then insert this key to the command.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/682/1*ZgnY0BpOCbCQXdnAwERY3A.png" /></figure><p>I have already the API keys as you see below, then I inserted this key into the command. You can create your own API keys for each CLI tool. I have created different API keys for Postman CLI, Newman and Jenkins.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YJpu9asG7jnoaizMkZTTeQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/930/1*ecktPTTu6Eq4x71-5jA08Q.png" /></figure><p>Then paste this command and run it in your local terminal. And then the collection starts to run.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/596/1*reBdYm5lTlhxYCAcqEKnjw.png" /></figure><p>At the end of the terminal, you can view the executed results.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6lFhBKjRonzrntoAJEdXjQ.png" /></figure><p>Also, we can view the results under the Runs part.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/694/1*hKGYlq-iw5wbOav93OBc0w.png" /></figure><ul><li>Let’s keep going with Newman</li></ul><p>To run Newman, ensure you have Node.js. The easiest way to Install Newman is using npm(node package manager)</p><p><a href="https://nodejs.org/en">Check here to install Node.js</a></p><p><a href="https://github.com/postmanlabs/newman#installation">Check here to install Newman</a></p><p>To check the versions, use the below command.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/474/1*2WXr6ebyKg3P0fDHrqYEEw.png" /></figure><p>Newman is much more advanced compared to Postman CLI. As I said before, I already have the API key for Newman.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YJpu9asG7jnoaizMkZTTeQ.png" /></figure><p>So now, click three dot and select “Share” option.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*LpLvWhebb84AVWbQCprKiw.png" /></figure><p>Click “Via API” tab in the opened “Share Trello API” screen. Then copy and paste the command to your terminal. access_key is the collection access key. It is displayed at the bottom of the API keys screen which I added a little above.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bKZdZKWA-kf1Z6wbldCZAA.png" /></figure><p>Then the collection starts to run.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/810/1*Dh3WI6t__Qqxu_nVk_RveQ.png" /><figcaption>ü,üthen the collection starts to run.</figcaption></figure><p>At the end of the terminal, you can view the executed results.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/526/1*mH-p2W5xAjpXM2G095_xwA.png" /></figure><ul><li>Let’s pass to the <strong>Jenkins</strong></li></ul><p>I run Jenkins with Docker. To install Docker Desktop, use <a href="https://www.docker.com/products/docker-desktop/">this link.</a> After installing Docker, run the necessary commands from a terminal window to run Jenkins. To learn more you may read<a href="https://octopus.com/blog/jenkins-docker-install-guide"> this article</a>. I do not detailed information about Docker, here I just want to show simple steps to run Jenkins with Docker. I’m only expressing what I’ve learned during this process</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v3Sy_KjTBd5SA9-pT7BiiA.png" /></figure><p>After Jenkins is opened and you logged in, click “new item”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/322/1*liHkmtgrrAMn6r7mlCfQYw.png" /></figure><p>Then write the item name and select freestyle project and click OK button</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Eyg-7E2UaD7N2n_guIBX8g.png" /></figure><p>Select “run Shell” under the “Build steps” part.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/921/1*fUxRpMgFCbXL0045OrVwvA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/896/1*CQZbOXruKeS30gO_tp08fA.png" /></figure><p>Then build it and it starts running.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uFoAA5QTackg6mXEJkLDsQ.png" /></figure><p>You can see the results in the console output.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vpWQOvUngjnESFrw0p9UDA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/808/1*BHA20jCcwxgnQS947CfXFQ.png" /></figure><p>You can view the results under the Runs part.</p><p>It’s displayed as “Ran in Jenkins build 11 using Newman” and the build count is shown there too.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XjW9Bqbxdfdm3XT0EIMfYg.png" /></figure><p>If we have done anything wrong, we can see this as an error as below. For example, I’ve forgotten console.clear in prerequest-script parts and these are displayed as TypeError in the Console Output.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VT4q24z2J8W9twXz_xi8LQ.png" /></figure><p>As a summary, if we have a Postman collection and we don’t want to run this collection manually for each test, we can run this collection in CI/CD server by using CLI tools such as Postman CLI and Newman, also we can run the collection with Jenkins.</p><p>I hope this article will be a little bit useful for anyone who needs it.</p><p><a href="https://addyosmani.com/blog/write-learn/"><em>Write about what you learn. It pushes you to understand topics better. Sometimes the gaps in our knowledge only become clear when explaining things to others.</em></a></p><p>Thanks! :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9b516213923f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>