Skip to content

Instantly share code, notes, and snippets.

Avatar
🏝️
Working remotely

Philip Riecks rieckpil

🏝️
Working remotely
View GitHub Profile
@rieckpil
rieckpil / pom.xml
Created Mar 19, 2022
Selenide Maven Pom Include
View pom.xml
<dependency>
<groupId>com.codeborne</groupId>
<artifactId>selenide</artifactId>
<version>5.22.0</version>
<scope>test</scope>
</dependency>
@rieckpil
rieckpil / SpringBootIT.java
Created Mar 19, 2022
Sample Spring Boot Testcontainers Integration Test
View SpringBootIT.java
@Testcontainers
class SpringBootIT {
@Container
static PostgreSQLContainer<?> postgreSQLContainer =
new PostgreSQLContainer<>(DockerImageName.parse("postgres:13"))
.withPassword("inmemory")
.withUsername("inmemory");
}
@rieckpil
rieckpil / pom.xml
Created Mar 19, 2022
Spring Boot Starter Test Maven Include
View pom.xml
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
@rieckpil
rieckpil / create.sh
Created Mar 19, 2022
Create Spring Boot Project Skeleton
View create.sh
curl https://start.spring.io/starter.zip \
-d dependencies=web,actuator,data-jpa,h2 \
-d javaVersion=11 \
-d name=spring-boot-testing-primer \
-d artifactId=spring-boot-testing-primer \
-d groupId=de.rieckpil.blog \
-d packageName=de.rieckpil.blog \
-d type=maven-project \
-o spring-boot-testing-primer.zip
@rieckpil
rieckpil / idea-live-template-examples.md
Last active Apr 30, 2022
Intellij IDEA Live Template Examples
View idea-live-template-examples.md

Live Template Examples for Testing Java Applications

Create new Live Templates within your IDEA's Preferences -> Editor -> Live Templates

mockMvcGET: Peform a MockMvc HTTP GET request.

org.springframework.test.web.servlet.MvcResult result = this.mockMvc
  .perform(org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get($url$)
 .header(org.springframework.http.HttpHeaders.ACCEPT, org.springframework.http.MediaType.APPLICATION_JSON))
@rieckpil
rieckpil / rieckpil.css
Last active Oct 14, 2021
Custom Crayon Theme (Inspired by the IntelliJ IDEA Light Theme)
View rieckpil.css
.crayon-theme-rieckpil {
border-width: 0px !important;
border-color: #999 !important;
border-style: solid !important;
text-shadow: none !important;
background: #fdfdfd !important;
}
.crayon-theme-rieckpil-inline {
border-width: 1px !important;
border-color: #ddd !important;
@rieckpil
rieckpil / sendowl.js
Created Dec 30, 2020
Trigger Cart Abandonment when Email is pre-filled on SendOwl's Checkout Page
View sendowl.js
<script>
Page.checkoutCallback = function () {
var email = document.getElementById("order_buyer_email").value;
if (email) {
$("#order_buyer_email").blur();
}
}
</script>
@rieckpil
rieckpil / application.yml
Created Apr 15, 2020
Debugging Hibernate - Settings for Spring application
View application.yml
spring:
jpa:
show-sql: false
hibernate:
ddl-auto: none
properties:
hibernate.generate_statistics: true
logging:
level:
@rieckpil
rieckpil / WpClient.java
Created Oct 3, 2019
WP API get all posts
View WpClient.java
@ApplicationScoped
public class WpClient {
public void getListOfBlogPosts(@Observes @Initialized(ApplicationScoped.class) Object object) {
Client client = ClientBuilder.newBuilder().build();
WebTarget webTarget = client.target("https://rieckpil.de/wp-json/wp/v2/posts");
JsonArray result = webTarget
.queryParam("per_page", 100)
@rieckpil
rieckpil / ToXHTML.java
Created Apr 8, 2018
Transfer .html to .xhtml with java
View ToXHTML.java
public class ToXHTML {
/**
* <dependency>
* <groupId>net.sf.jtidy</groupId>
* <artifactId>jtidy</artifactId>
* <version>r938</version>
* </dependency>
*/