🛠️ Testing, Tools & Ecosystem
14 Java concepts, each explained step by step with real code, a common trap and practice questions.
- Unit testing with JUnit 5@Test, assertions, assertThrows, lifecycle annotations, parameterized tests.
- Mocking with MockitoMocks vs stubs vs fakes, when/thenReturn, verify, not mocking what you don't own.
- Test-driven developmentRed, green, refactor; the test pyramid.
- Mavenpom.xml, coordinates, lifecycle phases, dependency scopes.
- GradleBuild scripts, tasks, configurations like implementation vs api.
- Dependencies & versionsTransitive dependencies, conflicts, semantic versioning, vulnerability scanning.
- Packaging & runningJAR, executable JAR, classpath, jlink custom runtimes, jpackage.
- LoggingSLF4J facade, log levels, parameterized messages vs string concatenation.
- JDBCConnection, PreparedStatement (prevents SQL injection), ResultSet, transactions, connection pools.
- JPA & Hibernate conceptsEntities, persistence context, lazy loading, the N+1 query problem.
- Spring Boot conceptsIoC container, beans, auto-configuration, REST controllers.
- Writing secure JavaInput validation, injection, unsafe deserialization, secrets handling.
- Performance & profilingMeasure first, JMH micro-benchmarks, boxing and allocation costs.
- GraalVM & native imagesAhead-of-time compilation, fast startup, reflection limitations.