Skip to content

Instantly share code, notes, and snippets.

View eliasnogueira's full-sized avatar
🇧🇷

Elias Nogueira eliasnogueira

🇧🇷
View GitHub Profile
@eliasnogueira
eliasnogueira / ReadProperties.java
Created December 20, 2020 16:06
Example of Properties file read in Java with the Singleton pattern
public class ReadProperties {
private static final Logger LOG = LoggerFactory.getLogger(ReadProperties.class);
private static ReadProperties instance = null;
private Properties properties = null;
private ReadProperties() {
properties = new Properties();
try {
@eliasnogueira
eliasnogueira / behind-unit-test.md
Created July 18, 2025 14:42
Beyond Unit Tests: Practical Tools for High-Quality Java Code

Beyond Unit Tests: Practical Tools for High-Quality Java Code

Description

Embarking on a Java project involves employing the best strategies, patterns, and architectural decisions, all geared towards a customer-centric approach.

Yet, there exists an often overlooked facet: quality assurance. While not entirely disregarded, we, as developers, sometimes limit ourselves to performing the basic unit and integration tests, which may leave room for bugs.

Fortunately, several straightforward approaches and tools can be implemented to deliver a bug-free project with minimal effort.

Test Smarter, Not Harder: Achieving Confidence in Complex Distributed Systems

Description

The presentation starts by addressing common testing pitfalls in distributed systems, like using in-memory databases, brittle mocks, and flaky async tests. It introduces a real-world fintech architecture with microservices, multiple databases, external APIs, and asynchronous workflows. The core strategy covers five areas: using real dependencies, avoiding in-memory DBs, virtualizing external systems, testing async flows properly, and establishing strong API governance. Through code examples and practical tips, the session shows how to build fast, reliable, and realistic test pipelines that boost confidence in complex systems.

Takeaways

  • Supporting multiple databases to speed up the CI process
  • Mock dependencies globally using the Service Virtualization approach
@eliasnogueira
eliasnogueira / pom.xml
Created January 23, 2018 21:36
Trecho de código das dependências do treinamento JUnit para Testadores
<properties>
<junit.version>4.12</junit.version>
<junit.params.version>1.1.1</junit.params.version>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
@eliasnogueira
eliasnogueira / Loan.java
Last active February 13, 2024 09:45
Model example for a loan form
public class Loan {
// private attributes
private String name;
private String email;
private BigDecimal amount;
private int installments;
// constructor
public LoanData(String name, String email, BigDecimal amount, int installments) {
@eliasnogueira
eliasnogueira / datafaker-talk.md
Last active December 22, 2023 08:24
DataFaker: the most powerful fake data generator library

Title

Datafaker: the most powerful fake data generator library

Description

Data generators in software testing play a critical role in creating realistic and diverse datasets for testing scenarios. However, they present challenges, such as ensuring data diversity, maintaining quality, facilitating validation, and ensuring long-term maintainability.

While many engineers are familiar with these challenges, they often resort to non-specialized tools like the RandomStringUtils class from Apache Commons or the Random class, concatenating fixed data with it. This approach lacks scalability and may not yield a valid dataset.

@eliasnogueira
eliasnogueira / enhancing_project_test.md
Last active December 22, 2023 07:22
Enhancing Project Integrity: A Test Modernization for Bug-Free Code

Title

Enhancing Project Integrity: A Test Modernization for Bug-Free Code

Description

Embarking on a Java project involves employing the best strategies, patterns, and architectural decisions, all geared towards a customer-centric.

Yet, there exists an often overlooked facet: quality assurance. While not entirely disregarded, we, as developers, sometimes limit ourselves to performing the basic unity and integration tests, which may leave room for bugs.

Fortunately, several straightforward approaches and tools can be implemented to deliver a bug-free project with minimal effort.