Skip to content

Instantly share code, notes, and snippets.


Steve Todorov steve-todorov

  • Carlspring Consulting & Development Ltd.
  • Bulgaria
View GitHub Profile
steve-todorov /
Created Apr 28, 2021 — forked from itzg/
Using embedded Kafka in Spring Boot unit test
import static org.junit.Assert.assertThat;
import static org.springframework.kafka.test.hamcrest.KafkaMatchers.hasKey;
import static org.springframework.kafka.test.hamcrest.KafkaMatchers.hasValue;
import static org.springframework.kafka.test.utils.KafkaTestUtils.getSingleRecord;
import java.util.Map;
import org.apache.kafka.clients.consumer.Consumer;
import org.apache.kafka.clients.consumer.ConsumerConfig;
import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.apache.kafka.common.serialization.Deserializer;
View [Spring, JMH] Howto integrate JMH benchmarks with


Integrate JMH (Java Microbenchmarking Harness) with Spring (Boot) and make developing and running benchmarks as easy and convinent as writing tests.


Wrap the necessary JMH boilerplate code within JUnit to benefit from all the existing test infrastructure Spring (Boot) provides. It should be as easy and convinent to write benchmarks as it is to write tests.


View 01-custom-resource-definition-with-rbac.yaml
kind: CustomResourceDefinition
version: v1alpha1
kind: IngressRoute
steve-todorov /
Created Feb 12, 2020 — forked from phuonghuynh/
Spring Security - Multiple Authentication Providers
public class AuthenticationToken extends AbstractAuthenticationToken {
private String token;
public AuthenticationToken(String token) {
this.token = token;
steve-todorov / System
Created Feb 11, 2020 — forked from vasanthk/System
System Design Cheatsheet
View System

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
View MavenProxyRepositoryProviderTestIT-whenDownloadingArtifactMetadataFileShouldBeMergedWhenExist.txt
at org.carlspring.strongbox.providers.repository.MavenProxyRepositoryProviderTestIT.whenDownloadingArtifactMetadataFileShouldBeMergedWhenExist(
Standard Output
01:13:10.177 03-02-2020 | DEBUG | kJoinPool-1-worker-2 | | Artifact checksum matchings: artifact-[strongbox:/storage0/rmmcjtit-snapshots/org/carlspring/strongbox/strongbox-metadata-one/2.0-SNAPSHOT/strongbox-metadata-one-2.0-20190512.202015-1-javadoc.jar]; ext-[md5]; matched-[[MD5]]; unmatched-[null]; checksum-[3397bc670f840b92ee0d7326ac0f4633]
01:13:10.177 03-02-2020 | DEBUG | kJoinPool-1-worker-2 | | Removed [strongbox:/storage0/rmmcjtit-snapshots/org/carlspring/strongbox/strongbox-metadata-one/2.0-SNAPSHOT/strongbox-metadata
steve-todorov / .block
Created Dec 10, 2019 — forked from mbostock/.block
Drag & Zoom
View .block
license: gpl-3.0
steve-todorov /
Created Dec 10, 2019 — forked from jodyphelan/
Force layout on canvas with zoom/pan and drag
steve-todorov / Jenkinsfile.groovy
Created Oct 30, 2019 — forked from Faheetah/Jenkinsfile.groovy
Jenkinsfile idiosynchrasies with escaping and quotes
View Jenkinsfile.groovy
node {
echo 'Results included as an inline comment exactly how they are returned as of Jenkins 2.121, with $BUILD_NUMBER = 1'
echo 'No quotes, pipeline command in single quotes'
sh 'echo $BUILD_NUMBER' // 1
echo 'Double quotes are silently dropped'
sh 'echo "$BUILD_NUMBER"' // 1
echo 'Even escaped with a single backslash they are dropped'
sh 'echo \"$BUILD_NUMBER\"' // 1
echo 'Using two backslashes, the quotes are preserved'
sh 'echo \\"$BUILD_NUMBER\\"' // "1"