<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Test &#8211; Pauls Blog</title>
	<atom:link href="https://sterl.org/tag/test/feed/" rel="self" type="application/rss+xml" />
	<link>https://sterl.org</link>
	<description></description>
	<lastBuildDate>Tue, 30 Dec 2025 15:18:26 +0000</lastBuildDate>
	<language>de</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.3</generator>
	<item>
		<title>A Bounded, Thread-Safe In-Memory Store for Java</title>
		<link>https://sterl.org/2025/12/java-simple-bound-memory-store/</link>
					<comments>https://sterl.org/2025/12/java-simple-bound-memory-store/#respond</comments>
		
		<dc:creator><![CDATA[Paul Sterl]]></dc:creator>
		<pubDate>Tue, 30 Dec 2025 14:55:43 +0000</pubDate>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[java test]]></category>
		<category><![CDATA[memory store]]></category>
		<category><![CDATA[Test]]></category>
		<category><![CDATA[Unit Test]]></category>
		<guid isPermaLink="false">https://sterl.org/?p=1149</guid>

					<description><![CDATA[Problem In test scenarios or lightweight application components, there is a need for a simple, thread-safe, in-memory data store that can temporarily hold a limited number of objects. The store should be easy to use, avoid external dependencies (e.g., databases), support generation and use of unique identifiers as keys, and automatically evict the oldest entries&#8230;]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading">Problem</h2>



<p>In test scenarios or lightweight application components, there is a need for a simple, thread-safe, in-memory data store that can temporarily hold a limited number of objects. The store should be easy to use, avoid external dependencies (e.g., databases), support generation and use of unique identifiers as keys, and automatically evict the oldest entries when a predefined capacity is exceeded. This enables predictable memory usage while providing fast access to recently stored data.</p>



<h2 class="wp-block-heading">Solution</h2>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text/x-java&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;Java&quot;,&quot;language&quot;:&quot;Java&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;java&quot;}">import java.util.LinkedHashMap;
import java.util.Map;
import java.util.UUID;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;

public class MemoryStore&lt;T&gt; {

    private final Lock lock = new ReentrantLock();
    private final int maxElements;

    private final Map&lt;String, T&gt; data = new LinkedHashMap&lt;&gt;() {
        // called during put and ensures the map doesn't grow
        @Override
        protected boolean removeEldestEntry(Map.Entry&lt;String, T&gt; eldest) {
            return size() &gt; maxElements;
        }
    };

    public MemoryStore(int maxElements) {
        if (maxElements &lt; 1) {
            throw new IllegalArgumentException(&quot;maxElements must be &gt; 1&quot;);
        }
        this.maxElements = maxElements;
    }
    
    public void store(T value) {
        this.store(UUID.randomUUID().toString(), value);
    }

    public void store(String key, T value) {
        lock.lock();
        try {
            data.put(key, value);
        } finally {
            lock.unlock();
        }
    }

    public T get(String key) {
        lock.lock();
        try {
            return data.get(key);
        } finally {
            lock.unlock();
        }
    }
    
    public int size() {
        lock.lock();
        try {
            return data.size();
        } finally {
            lock.unlock();
        }
    }
    
    public LinkedHashMap&lt;String, T&gt; data() {
        lock.lock();
        try {
            return new LinkedHashMap&lt;&gt;(this.data);
        } finally {
            lock.unlock();
        }
    }
}</pre></div>



<p></p>
]]></content:encoded>
					
					<wfw:commentRss>https://sterl.org/2025/12/java-simple-bound-memory-store/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>REST SOAP API Client</title>
		<link>https://sterl.org/2025/08/rest-soap-api-client/</link>
					<comments>https://sterl.org/2025/08/rest-soap-api-client/#respond</comments>
		
		<dc:creator><![CDATA[Paul Sterl]]></dc:creator>
		<pubDate>Tue, 05 Aug 2025 06:49:31 +0000</pubDate>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[Client]]></category>
		<category><![CDATA[REST]]></category>
		<category><![CDATA[SOAP]]></category>
		<category><![CDATA[Test]]></category>
		<category><![CDATA[Testing]]></category>
		<guid isPermaLink="false">https://sterl.org/?p=1129</guid>

					<description><![CDATA[REST SOAP]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading">REST</h2>



<ul class="wp-block-list">
<li><a href="https://insomnia.rest/">Insomnia</a> &#8212; offline possible</li>



<li><a href="https://www.postman.com/">Postman</a> &#8212; needs Login / data in the cloud</li>



<li><a href="https://scalar.com/">Scalar</a></li>



<li><a href="https://marketplace.visualstudio.com/items?itemName=humao.rest-client">REST Client &#8211; Visual Studio</a></li>



<li><a href="https://chromewebstore.google.com/detail/talend-api-tester-free-ed/aejoelaoggembcahagimdiliamlcdmfm">Talend API Tester</a> &#8212; Chrome Plugin</li>
</ul>



<h2 class="wp-block-heading">SOAP</h2>



<ul class="wp-block-list">
<li><a href="https://www.soapui.org/">SoapUI</a></li>
</ul>



<p></p>
]]></content:encoded>
					
					<wfw:commentRss>https://sterl.org/2025/08/rest-soap-api-client/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Test REST Services with Curl</title>
		<link>https://sterl.org/2016/06/test-rest-services-with-curl/</link>
					<comments>https://sterl.org/2016/06/test-rest-services-with-curl/#respond</comments>
		
		<dc:creator><![CDATA[Paul Sterl]]></dc:creator>
		<pubDate>Tue, 07 Jun 2016 08:32:04 +0000</pubDate>
				<category><![CDATA[Testing]]></category>
		<category><![CDATA[REST]]></category>
		<category><![CDATA[Test]]></category>
		<guid isPermaLink="false">http://sterl.org/?p=163</guid>

					<description><![CDATA[Problem Often we want an easy way to test our REST services. Even if where are many tools around e.g. Chrome Plugins etc. it is maybe easier on servers to juts use curl to do the job. Basic PUT command curl -X PUT -H "&#60;Header-Name&#62;: &#60;Header-Value&#62;" "https://&#60;url&#62;" -v Add basic Authorization Curl already supports basic auth&#8230;]]></description>
										<content:encoded><![CDATA[<h2>Problem</h2>
<p>Often we want an easy way to test our REST services. Even if where are many tools around e.g. Chrome Plugins etc. it is maybe easier on servers to juts use <code>curl</code> to do the job.</p>
<h3>Basic PUT command</h3>
<pre class="lang:sh decode:true" title="REST / HTTP PUT">curl -X PUT -H "&lt;Header-Name&gt;: &lt;Header-Value&gt;" "https://&lt;url&gt;" -v</pre>
<h3>Add basic Authorization</h3>
<p>Curl already supports basic auth out of the box just adding the <code>-u</code> parameter.</p>
<pre class="lang:sh decode:true ">curl -u &lt;user&gt;:&lt;password&gt; -X PUT "http://&lt;url&gt;" -v</pre>
<h3>Create a basic Authorization Base64 token</h3>
<pre class="lang:sh decode:true ">echo -e "&lt;user&gt;:&lt;password&gt;" | base64</pre>
<h3>Post or Put JSON data</h3>
<pre class="lang:sh decode:true " title="Add JSON Data">curl -X PUT "http://&lt;url&gt;" -H "Content-Type: application/json" -d '{"foo": "bar"}'  -v</pre>
<p>&nbsp;</p>
]]></content:encoded>
					
					<wfw:commentRss>https://sterl.org/2016/06/test-rest-services-with-curl/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
