<?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 Rasim Koseli on Medium]]></title>
        <description><![CDATA[Stories by Rasim Koseli on Medium]]></description>
        <link>https://medium.com/@rasim.koseli?source=rss-3990ecbe180c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*k6imgZ5Tv7HpQKrhX9wVtw@2x.jpeg</url>
            <title>Stories by Rasim Koseli on Medium</title>
            <link>https://medium.com/@rasim.koseli?source=rss-3990ecbe180c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 04:15:13 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@rasim.koseli/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[API Mocking and Testing with WireMock]]></title>
            <link>https://medium.com/@rasim.koseli/api-mocking-and-testing-with-wiremock-cbe6a2ba8de9?source=rss-3990ecbe180c------2</link>
            <guid isPermaLink="false">https://medium.com/p/cbe6a2ba8de9</guid>
            <dc:creator><![CDATA[Rasim Koseli]]></dc:creator>
            <pubDate>Mon, 19 Jun 2023 10:50:13 GMT</pubDate>
            <atom:updated>2023-09-26T12:13:54.834Z</atom:updated>
            <content:encoded><![CDATA[<p>We are in an era where <strong>microservice structures</strong> are frequently used. Microservices-based application offers a pluggable architectural style. This style enables fast, cost-efficient upgrades, making it easier and less expensive to scale one part of the application. Importantly, you can do this without affecting the rest of the application.</p><p>Microservice has many advantages as well as disadvantages. The most important of these is to be connected to another team in some cases.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/803/1*5RABw8-q_vusEL2P6CLvdQ.png" /><figcaption>Complex Service Structure</figcaption></figure><p>So what can we do to make these small and autonomous microservices work more efficiently among each other? The answer is <strong>mocking</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/827/1*tUMyr8XL-v06g29v6rYblw.png" /><figcaption>Dependencies Mocked</figcaption></figure><p>A summary of the reasons why API mocking is beneficial:</p><p><strong><em>Parallel Development:</em></strong><em> API mocking enables multiple teams or developers to work simultaneously without waiting for the real API to be fully developed.</em></p><p><strong><em>Test Independence: </em></strong><em>Mocking allows independent testing of components, providing specific scenarios and responses for thorough testing.</em></p><p><strong><em>Performance Testing: </em></strong><em>Mocking allows simulation of different response times and network conditions to test an application’s performance.</em></p><p><strong><em>Error Handling: </em></strong><em>Mocking helps simulate error responses to ensure proper handling of errors in the application.</em></p><p><strong><em>CI/CD Integration:</em></strong><em> API mocking can be seamlessly integrated into the CI/CD pipeline for automated testing and deployment processes.</em></p><p><strong><em>Cost and Availability:</em></strong><em> Mocking reduces costs associated with API usage and avoids limitations or availability issues during development.</em></p><p><strong><em>Iterative Development:</em></strong><em> API mocking supports an iterative development process by allowing quick adaptation and testing of new features or changes.</em></p><p>In summary, API mocking promotes faster development, independent testing, performance validation, error handling, CI/CD integration, cost savings, and flexibility for iterative development.</p><h4><strong>Now that we have created some ideas about API mocking, we can come to our main topic.</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nY1n7oV7MwtveFkbw9x7Eg.png" /></figure><p><strong>WireMock</strong> is a popular open-source tool for API mock testing. It can help you to create stable test and development environments, isolate yourself from flakey 3rd parties and simulate APIs that don’t exist yet.</p><p>Certainly! Here’s a summary of why WireMock is often preferred over other tools for API mocking and simulation:</p><ul><li><em>Rich feature set covering a wide range of use cases.</em></li><li><em>Standalone mock server compatible with various development environments.</em></li><li><em>Easy configuration through an intuitive API or JSON files.</em></li><li><em>Flexibility and customization options for dynamic and complex scenarios.</em></li><li><em>Seamless integration with popular testing frameworks.</em></li><li><em>Built-in request verification for ensuring correct interaction.</em></li><li><em>Active community and support with extensive resources and extensions.</em></li><li><em>Cross-platform compatibility with multiple programming languages</em></li></ul><h3><strong>Wiremock Server Creation</strong></h3><p>If you want to run WireMock as a standalone process you can <a href="https://repo1.maven.org/maven2/com/github/tomakehurst/wiremock-jre8-standalone/2.35.0/wiremock-jre8-standalone-2.35.0.jar"><strong>download the standalone JAR from here</strong></a><strong>.</strong></p><p>Once you have <a href="https://repo1.maven.org/maven2/com/github/tomakehurst/wiremock-jre8-standalone/2.35.0/wiremock-jre8-standalone-2.35.0.jar"><strong>downloaded the standalone JAR</strong></a> you can run it simply by doing this:</p><pre>$ java -jar wiremock-jre8-standalone-2.35.0.jar</pre><p><em>Not : If we want our server to stand constantly, we should apply this process.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Zmr-6_ge2NdjSdAh7an-4g.png" /></figure><p><em>Not: If you </em><strong><em>get java.lang.RuntimeException: java.io.IOException: Failed to bind to /0.0.0.0:8080 error</em></strong><em>, you can run the </em><strong><em>PID</em></strong><em> that comes with the </em><strong><em>lsof -i tcp:8080</em></strong><em> command as </em><strong><em>kill -9 yourPID</em></strong><em> and try again.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/541/1*wNl57j_YK_3ScoBTsFNtbQ.png" /></figure><p>After this step, you can create mock data on wiremock server with sample curl requests and query it with your requests.</p><pre>curl --location &#39;http://localhost:8080/__admin/mappings/new&#39; \<br>--header &#39;Content-Type: application/json&#39; \<br>--data &#39;{<br>    &quot;request&quot;: {<br>        &quot;url&quot;: &quot;/get/user/1&quot;,<br>        &quot;method&quot;: &quot;GET&quot;<br>        },<br>    &quot;response&quot;:{<br>        &quot;status&quot;: 200,<br>        &quot;body&quot;: &quot;Welcome to wiremock! \n&quot;<br>    }<br><br>}&#39; <br>//You can create mock data by posting this example curl via postman.</pre><pre>curl --location &#39;http://localhost:8080/get/user/1&#39;<br>//Now let&#39;s confirm the data we mocked with the get query.</pre><p><strong>To summarize, the process is very simple. You are sending a request and it contains information that will give you which response when you come with which request. Thus, you are not tied to the service you are associated with.</strong></p><p><strong>Let’s see how to add wiremock to our project</strong></p><p>If you already have a java project with maven, gradel or you want to create it, you can add the required dependency <a href="https://mvnrepository.com/artifact/com.github.tomakehurst/wiremock"><strong>here</strong></a><strong> .</strong></p><p>Let’s start by creating and configuring the wiremock server first.</p><p><em>To make WireMock available to your tests on its default port (8080):</em></p><pre>@Rule<br>public WireMockRule wireMockRule = new WireMockRule();</pre><p><em>If you want to configure the port</em></p><pre>@Rule<br>public WireMockRule wireMockRule = new WireMockRule(options().port(yourPort).httpsPort(httpsPort));</pre><p>There are many different ways of setting wiremock config. You can simply give the port number or you can request the default port to be selected.</p><pre> @Rule<br>  public WireMockRule wireMockRule = new WireMockRule(8080);<br><br>  @Before<br>  public void setUp(){<br>    wireMockRule.start();<br>    createStub();<br>  }<br><br>  public void createStub() {<br>    stubFor(<br>        post(urlEqualTo(&quot;/services&quot;))<br>            .willReturn(aResponse()<br>                    .withHeader(&quot;Content-Type&quot;, &quot;text/plain&quot;)<br>                    .withStatus(200)<br>                    .withBody(&quot;Hello world!&quot;)));<br>  }<br><br> @Test<br>  public void testStub(){<br>    RestAssured.baseURI = &quot;http://localhost:8080&quot;; <br>    Response response = RestAssured.given()<br>        .log()<br>        .all()<br>        .when()<br>        .body(&quot;&quot;)<br>        .post(&quot;/services&quot;);<br>    response.prettyPrint();<br>  }</pre><p><strong>As you can see, we define the request and the response properties we expect in the stubFor.</strong></p><p><strong>If you want, you can pull request and response from the mapping folder.</strong></p><pre><br>public void createStub() {<br>    stubFor(<br>        get(urlEqualTo(&quot;/services&quot;))<br>            .willReturn(aResponse()<br>                    .withHeader(&quot;Content-Type&quot;, &quot;text/plain&quot;)<br>                    .withStatus(200)<br>                    .withJsonBody(readJsonFile(&quot;Responses/SomeApi/file.json&quot;))));<br>  }</pre><p><strong>I’ve talked about mocking, wiremock and its installation so far. So, are there any disadvantages for wiremock users? The answer is YES.</strong></p><ul><li><em>Complexity: Setting up and configuring WireMock can be complex, especially for beginners.</em></li><li><em>Maintenance Overhead: Managing and updating WireMock stubs can be time-consuming, especially with a large number of endpoints or frequently changing APIs.</em></li><li><em>Performance Impact: WireMock can slow down test execution due to the additional overhead of intercepting and processing requests.</em></li><li><em>Limited Real-Time Behavior: WireMock may not fully replicate dynamic behaviors of real APIs in real time, making it less suitable for testing complex scenarios.</em></li><li><em>Integration Challenges: Integration with specific tools or environments may present compatibility issues or conflicts.</em></li><li><em>External Dependencies: WireMock relies on external services or libraries, introducing complexities and potential conflicts.</em></li><li><em>Limited Ecosystem: WireMock may have a smaller ecosystem compared to other API mocking tools, leading to fewer community resources and plugins.</em></li></ul><p>WireMock is a powerful tool to overcome API development and testing challenges. In this article, we learned the basics of WireMock. WireMock’s flexibility and features play an important role in improving the quality of API testing and application development.</p><p>Using WireMock, you can test your APIs in real-world scenarios and simulate situations such as incorrect responses and network problems. In addition, you can speed up the development process by emulating real APIs. With the potential offered by WireMock, you can increase the possibility of success in your software projects.</p><p>You can refer to the official documentation and various resources to learn more about WireMock. By making more in-depth explorations of this tool, you can make your API development and testing processes more effective. Keep exploring what WireMock has to offer and succeed in your API projects!”</p><p>Github Link : <a href="https://github.com/rasimkose/wiremock-example">https://github.com/rasimkose/wiremock-example</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/498/1*s4x-eKS3mDMrcjILnGZz6Q.gif" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cbe6a2ba8de9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Sonarqube Implementation Using Docker on Mac]]></title>
            <link>https://medium.com/@rasim.koseli/sonarqube-implementation-using-docker-on-mac-acb0d9c5f937?source=rss-3990ecbe180c------2</link>
            <guid isPermaLink="false">https://medium.com/p/acb0d9c5f937</guid>
            <dc:creator><![CDATA[Rasim Koseli]]></dc:creator>
            <pubDate>Thu, 08 Dec 2022 13:01:08 GMT</pubDate>
            <atom:updated>2022-12-08T16:37:58.695Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello dear readers, in today’s post I would like to explain to you how you can add SonarQube, the open source code quality platform, to your projects.</p><h4>Let’s look at the structure of SonarQube and see what advantages it gives us.</h4><p>SonarQube calculates your code according to a set of rules called quality profiles and displays these calculated metrics in a rich dashboard after storing them in a database.</p><p>Your code is graded by some criteria called <a href="https://docs.sonarqube.org/latest/user-guide/quality-gates/"><strong>Quality Gates</strong></a>.</p><p><strong>Sonar</strong> extracts software metrics using various static code analysis tools such as <a href="https://docs.sonarqube.org/latest/analyzing-source-code/languages/java/"><strong>Checkstyle, PMD, FindBugs, FxCop</strong></a> and uses them to improve the quality of the software.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kak_muUB1b_lfsUWe04f0A.jpeg" /></figure><h4><strong>Features of SonarQube</strong></h4><ul><li><strong>Supports languages:</strong> Java, C/C++, Objective-C, C#, PHP, Flex, Groovy, JavaScript, Python, PL/SQL, COBOL, etc.</li><li>Sustainability — Reduces complexity, possible vulnerabilities, and code duplications, optimising the life of applications.</li><li>Increase productivity — Reduces the scale, cost of maintenance, and risk of the application; as such, it removes the need to spend more time changing the code.</li><li>Easy to install and configure</li><li>Business scaling — No restriction on the number of projects to be evaluated</li><li>Increase consistency — Determines where the code criteria are breached and enhances the quality</li><li>Detect Errors — Detects errors in the code and alerts developers to fix them automatically before submitting them for output.</li></ul><h4>SonarQube Setup</h4><ul><li>Let’s first create a container with the SonarQube image. Then define which port we will run it in the command on terminal. Example(8084)</li></ul><pre>docker run -d -p 8084:9000 mwizner/sonarqube:8.7.1-community</pre><p><strong>Note: </strong>I recommend you to run it with the above command, especially if you are using M1. Compared to Macs with intel processors, you may get errors in other commands on m1 processor Macs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XktzVyB3azGFe-mkAUp4AA.png" /></figure><ul><li>You can open the address defined for the port you have given. You can open the address defined for the port you have given. (eg <strong>http://localhost:8084/</strong> for 8084)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xv8Kj9pmrpyTFhxkpsQMWQ.png" /></figure><pre>username = admin,<br>password = admin</pre><ul><li>You can login with the default <strong>username</strong> and <strong>password</strong> above.</li></ul><p>Continue by creating a new project on the sonarqube page with many features.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*baKwtDKcx2PyvZcKsFNaGg.png" /><figcaption>Sonar Page</figcaption></figure><ul><li>Add project &gt; manually &gt; <strong>Project key</strong>* and <strong>Display name</strong>* &gt; Setup</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/661/1*nWv3f-xsCjGX2B1BrB4i9w.png" /></figure><ul><li>After set up, we need to define a token name. (<em>If you want, you can use the token name you have already created</em>.)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/784/1*fQCPHKiKHjpKRAiwM6q9mA.png" /></figure><ul><li>You can configure it according to the system you want to work with.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lfqTochSWeDzAVVrwBYr3g.png" /></figure><ul><li>Now let’s do the final touch. Go to the project you want to add from your terminal and run the resulting command there.</li></ul><pre>rasim.koseli@QF3MVRH6G2 reactor-tests % mvn sonar:sonar \<br>  -Dsonar.projectKey=project-key \<br>  -Dsonar.host.url=http://localhost:8084 \<br>  -Dsonar.login=78882f5f1e13fbda41e21c614647183ad2c47302<br>[INFO] Scanning for projects...<br>Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-antrun-plugin/1.3/maven-antrun-plugin-1.3.pom<br>Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-antrun-plugin/1.3/maven-antrun-plugin-1.3.pom (4.7 kB at 11 kB/s)<br>Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-plugins/12/maven-plugins-12.pom<br>Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-plugins/12/maven-plugins-12.pom (12 kB at 93 kB/s)<br>....<br>...<br>..<br>.<br>[INFO] Analysis report uploaded in 87ms<br>[INFO] ANALYSIS SUCCESSFUL, you can browse http://localhost:8084/dashboard?id=rasim-koseli<br>[INFO] Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report<br>[INFO] More about the report processing at http://localhost:8084/api/ce/task?id=AYTt_NdNLQRqq8XQD3KU<br>[INFO] Analysis total time: 6.077 s<br>[INFO] ------------------------------------------------------------------------<br>[INFO] BUILD SUCCESS<br>[INFO] ------------------------------------------------------------------------<br>[INFO] Total time:  13.690 s<br>[INFO] Finished at: 2022-12-07T22:08:01+03:00</pre><ul><li>Now go to <strong>http://localhost:8084/</strong> and examine the metrics about our project.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I_jWD7zpgVov6G4I1Zbq4A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/498/1*s4x-eKS3mDMrcjILnGZz6Q.gif" /></figure><p>Thanks for reading, I hope you liked my post and I’ll be waiting for your questions and suggestions.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=acb0d9c5f937" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Test Processes in T-Desk]]></title>
            <link>https://medium.com/@rasim.koseli/test-processes-in-t-desk-8343212cd8dd?source=rss-3990ecbe180c------2</link>
            <guid isPermaLink="false">https://medium.com/p/8343212cd8dd</guid>
            <category><![CDATA[software-testing]]></category>
            <category><![CDATA[cucumber]]></category>
            <category><![CDATA[software-test-design]]></category>
            <category><![CDATA[test-process]]></category>
            <dc:creator><![CDATA[Rasim Koseli]]></dc:creator>
            <pubDate>Tue, 11 Jan 2022 12:19:25 GMT</pubDate>
            <atom:updated>2022-12-07T19:35:40.922Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello readers, My name is Rasim Köşeli and I am a QA Engineer at Trendyol. In this article I would like to explain how we manage end-to-end testing processes in T-Desk, but first I would like to talk a little bit about T-Desk.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3xCHZf6QHGpPY6V8OM6cqQ.png" /></figure><p><strong>TDesk</strong> basically a ticket application for managing the customer requests which are sellers, influencers etc. Before tdesk Trendyol was using an outsourced application for all the customer management and the ticket requests …. etc.</p><p><strong>Why did we create the TDESK?</strong></p><p>Previous external system;</p><p><strong>Why did we create the T-DESK ?</strong></p><ul><li>Create much Modern UI</li><li>Need to use easily all user</li><li>Faster Req-Response time.</li><li>Store data internally</li></ul><p><strong>T-Desk provides us with ;</strong></p><ul><li><em>Opportunity to make a flexible design according to the needs</em></li><li><em>Modern UI design</em></li><li><em>Fast and dynamic system</em></li><li><em>Since it is internal, different teams can be connected quickly</em></li><li><em>End of scale and performance problems</em></li><li><em>Ending data security and audit vulnerabilities</em></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eIbSK-F9oP0oQ6Hc_avx8g.png" /><figcaption>An example image from T-Desk</figcaption></figure><p>Let’s examine the technologies and architectural structure used to achieve these advantages.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*D1PiCt9inwoJukLgDBjVig.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P01a0cztmsA0gDfEG97-mw.png" /><figcaption>Overview Architecture</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/758/1*JP_6RPSLgo_V4zlmNE4RVA.png" /><figcaption>Technologies in T-Desk</figcaption></figure><p>You can see the high level architecture of the system in the image.In our project, we used the most up-to-date and current technologies suitable for our structure. We have achieved a dynamic structure with fast data writing, processing, multi-dc and many features.</p><h3><strong>So how do we test this dynamic structure?</strong></h3><p>First of all, I would like to give you a little information about which technologies we prefer on the test side and why we prefer them.</p><p><em>1-) The best part of </em><strong><em>Behavior-Driven Developments</em></strong><em> is that it allows you to write test scenarios that anyone, regardless of technical knowledge, can easily understand, and that’s why we chose</em><strong><em> Cucumber</em></strong><em> as the framework.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/929/1*ZgMmrGy9P8a1NnouR72WrA.png" /><figcaption>An Example Scenario</figcaption></figure><p><em>2-) In our project, we benefited from the functions obtained by generating the yaml file developed in Trendyol and the test feature. I want to explain in more detail.</em></p><ul><li><em>When we generate the operations (post, get, put…) that we have implemented in the Swagger structure from yaml, we can generate the payload created by the endpoint of the method in the form of models. In different requests, we can assign our requests by differentiating the parameters.(Note:You can convert your swagger.json file to yaml file via </em><a href="https://editor.swagger.io/"><em>https://editor.swagger.io/</em></a><em>.)</em></li><li><em>We can generate requests and responses by generating the yaml file using a test library used in Trendyol</em>.</li><li><em>When we run the project, we get the requests and responses that will be created in our target file.</em></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PTVTK7n-ANf3GM6dWqDZ7w.png" /><figcaption>An Example Method</figcaption></figure><p><em>3-) In addition to cucumber, we used rest assured in our project. We took advantage of some of its useful features (upload file, post json such as).</em></p><p><em>4-) We are testing all the processes starting from Kafka until writing to Cassandra. You can use these links to learn the Cassandra and Kafka link structure.</em></p><ul><li><em>Connection to Cassandra : </em><a href="https://www.baeldung.com/cassandra-with-java"><em>https://www.baeldung.com/cassandra-with-java</em></a></li><li><em>Connection to Kafka : </em><a href="https://developer.okta.com/blog/2019/11/19/java-kafka"><em>https://developer.okta.com/blog/2019/11/19/java-kafka</em></a></li></ul><p><em>5-) We print the log results of our running tests to the slack channel. We enable our teammates to follow the processes.</em></p><p>6-)<em>We use Selenium for UI automation</em></p><p>In my article, I tried to explain the techniques and ways we test the technologies used in our application. You can diversify and improve the techniques you use. It totally depends on the requirements of your system.</p><p>Thanks for reading, I hope you liked my post and I’ll be waiting for your questions and suggestions.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8343212cd8dd" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>