initializr
mockk
Our great sponsors
initializr | mockk | |
---|---|---|
257 | 17 | |
3,340 | 5,275 | |
0.7% | 0.5% | |
8.9 | 8.6 | |
4 days ago | 9 days ago | |
Java | Kotlin | |
Apache License 2.0 | Apache License 2.0 |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
initializr
-
Develop your Tomcat App with Docker Compose Watch
The best way, for generating a ready-to-run application in Java you can use the Spring Boot Initializr tool.
-
Consuming and Testing third party API's using Spring Webclient
curl --location 'https://start.spring.io/starter.zip?type=maven-project&language=java&bootVersion=3.2.2&baseDir=ms-xcoffee&groupId=com.xcoffee&artifactId=ms-xcoffee&name=ms-xcoffee&description=Demo%20project%20for%20Spring%20Boot&packageName=com.xcoffee.ms-xcoffee&packaging=jar&javaVersion=21&dependencies=webflux%2Clombok%2Cvalidation' | tar -xzvf -
-
Spring boot and PostgreSQL in Docker Compose
In this segment we will create a basic Spring boot app from Spring Initializer. Add the below dependencies:
-
Spring Data MongoDB โ CRUD, Aggregations, Views and Materialized Views
Add the following MongoDB dependencies in your pom.xml or use spring initializer and select the Spring Data MongoDB dependency:
- AWS SQS: Como publicar e consumir mensagens com Spring Cloud AWS
-
Java Microservices with Spring Boot and Spring Cloud
I created all of these applications using start.spring.io's REST API and HTTPie.
-
Run a java service serverless with ECS and Fargate
An easy way to create the skeleton project is to visit Spring Initializr, I set the Project to Gradle - Groovy, Language to Java, and add Spring Web dependency. Then it's just to generate the project and unpack it.
-
A Passwordless Future! Passkeys for Java Developers
Create a new Spring Boot application using the Spring Initializr. You can use the web version or the curl command below. Use the default for most of the options. For the dependencies, select web, and okta. For the build tool, select Gradle.
-
Spring Cloud Functions, Kafka | How to interact asynchronous
I will start with a simple example of a cloud function, which is the same as a rest endpoint in the classical spring boot web application. You can create a project from your favorite IDE or from Spring Initliazr.
-
Handling security vulnerabilities in Spring Boot
I would advise everyone to go the extra mile and update their entire spring boot version to the latest appropriate version. To find out what that is, simply go to https://start.spring.io.
mockk
-
For those DAO, Services, how about using static objects with mockk for test
The official suggests using dagger/hilt to inject them. However, they could be static based on the static ApplicationContext. Although Dagger/hilt aids in unit testing, mockk can accomplish this easily as well by modifying bytecode during run time. As for the stability, `mockk` has 5000+ stars on GitHub and keeps renewing.
-
Tests Everywhere - Kotlin
We can create it as a class as MockK is able to mock final classes.
-
๐งช **Demystifying Kotlin Unit Testing**: Your Odyssey to Code Confidence! ๐
Mockk Documentation
-
Best practices for Unit Testing Android Apps with Mockk, Kotest and others
Mockk is a rather new framework; it was originally designed for Kotlin, although it supports Java as well. Before mockito-kotlin was released, using Mockk was much easier and beneficial for Kotlin developers, but right now both these frameworks have nearly the same set of features and similar syntax. For example, assume that our function loadUsers is no longer synchronous, but rather suspended:
-
LocalDateTime.now() mockk
You can use mockkStatic for that, see docs. Also don't forget to unmockkStatic afterwards.
-
reflective-mockk: Stub methods programmatically using kotlin-reflect
WARNING: reflective-mockk is currently powered by a reflective โhackโ on mockK, and is thereby subject to removal/breakage by the mockK team at any time. If you enjoy this library & want it to be officially supported, post a comment saying so on this PR: https://github.com/mockk/mockk/pull/1005.
-
mockk VS mockative - a user suggested alternative
2 projects | 9 Nov 2022
- Are there any plans to make a better build system for Kotlin than Gradle?
-
Spring with java vs Spring with kotlin
https://mockk.io/ is great, too.
-
From Java to Kotlin. There and back again
Mockito does not work correctly with Kotlin types out of the box. Spring recommends using Mockk. There is also a special module for Mockito, which adds support for Kotlin - Mockito-Kotlin.
What are some alternatives?
JHipster - JHipster, much like Spring initializr, is a generator to create a boilerplate backend application, but also with an integrated front end implementation in React, Vue or Angular. In their own words, it "Is a development platform to quickly generate, develop, & deploy modern web applications & microservice architectures."
mockito-kotlin - Using Mockito with Kotlin
Spring Boot - Spring Boot
Kotest - Powerful, elegant and flexible test framework for Kotlin with additional assertions, property testing and data driven testing
Javet - Javet is Java + V8 (JAVa + V + EighT). It is an awesome way of embedding Node.js and V8 in Java.
spek - A specification framework for Kotlin
elastic-beanstalk-roadmap - AWS Elastic Beanstalk roadmap
mock-fuel - JUnit 5 extension to easily test with the http client Fuel for Kotlin
jhipster-sample-app - This is a sample application created with JHipster
Kluent - Fluent Assertion-Library for Kotlin
spring-petclinic - A sample Spring-based application
kotlin-logging - Lightweight Multiplatform logging framework for Kotlin. A convenient and performant logging facade.