Skip to content

Instantly share code, notes, and snippets.

View thesurenk's full-sized avatar

Suren K thesurenk

View GitHub Profile
@thesurenk
thesurenk / TestsInPom.xml
Created April 27, 2019 00:20
Including Cucumber tests in pom.xml files
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.6.0</version>
<executions>
<execution>
<id>install-tester</id>
<phase>generate-sources</phase>
<goals>
<goal>exec</goal>
@thesurenk
thesurenk / AddTasksToRunCucumberFromPom.xml
Created April 27, 2019 00:25
Adding tasks to run cucumber tests from pom.xml
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.6.0</version>
<executions>
<execution>
<id>integration-test</id>
<phase>verify</phase>
<goals>
<goal>exec</goal>
@thesurenk
thesurenk / WebClient.java
Created March 26, 2020 21:18
WebClient for the REST API
package com.engg.java.reactive;
import org.springframework.http.MediaType;
import org.springframework.web.reactive.function.client.ClientResponse;
import org.springframework.web.reactive.function.client.WebClient;
import reactor.core.publisher.Mono;
import reactor.core.publisher.Flux;
import com.engg.java.reactive.reqres.User;
public class ReqResWebClient {
@thesurenk
thesurenk / ReactiveApplication.java
Created March 26, 2020 21:22
SpringBoot Application primary file
package com.engg.java.reactive;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class ReactiveApplication {
public static void main(String[] args) {
@thesurenk
thesurenk / TestController.java
Created March 26, 2020 21:36
Sample controller to print API values in browser
package com.engg.java.reactive;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.GetMapping;
@RestController
public class TestController {
@GetMapping
public String sample() {
ReqResWebClient webClient = new ReqResWebClient();
@thesurenk
thesurenk / AemTag.java
Created October 21, 2021 22:45
AEM - Read Tags and Children
import org.apache.sling.api.resource.NonExistingResource;
..
public class AemTag {
..
@Expose
private final String id;
@Expose
private final String title;
@thesurenk
thesurenk / ManipulateContentOnNodes.java
Last active January 17, 2022 20:05
Java Servlet to bulk update nodes
package com.web.core.servlets;
import com.day.cq.commons.jcr.JcrConstants;
import com.day.cq.search.PredicateGroup;
import com.day.cq.search.Query;
import com.day.cq.search.QueryBuilder;
import com.day.cq.search.result.Hit;
import com.day.cq.search.result.SearchResult;
import org.apache.commons.collections.CollectionUtils;
import org.apache.sling.api.SlingHttpServletRequest;