Skip to content

Spring Boot multi-thread scheduling

Spring Boot provides impressive scheduling functionality out-of-the-box. To install it all you need to do is include the Spring Boot Starter dependency in your Maven project: <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter</artifactId> </dependency> Configuration By default Spring Boot will use just a single thread for all scheduled tasks…

Continue reading Spring Boot multi-thread scheduling

Create OkHttp3 Response for testing

Use a variation of the following code to create a Response to test with: private Response createResponse() { HttpUrl mHttpUrl = new HttpUrl.Builder() .scheme(“https”) .host(“example.com”) .build(); Request mRequest = new Request.Builder() .url(mHttpUrl) .build(); Response.Builder builder = new Response.Builder() .request(mRequest) .protocol(Protocol.HTTP_1_1) .message(“message”) .code(302); return builder.build(); }…

Continue reading Create OkHttp3 Response for testing

How to programmatically add and remove elements from Ehcache

Pre-requisites This guide assumes that you have already configured Ehcache, and is specifically concerned with programmatic addition and removal of elements. Adding an element to a cache @Autowired private CacheManager cacheManager; […] public Ehcache getCache(String name) { return cacheManager.getCache(name); } In the above example we…

Continue reading How to programmatically add and remove elements from Ehcache

Checkout a Git branch

If you are using GitFlow you will typically need to create a branch from ‘Develop’ to do your development work. To create the branch follow these steps: Clone the respository git clone git@bitbucket.org:example/example-repo.git Create the branch in the remote repository. Identify the repo with git branch  (optional)…

Continue reading Checkout a Git branch