Skip to content

Instantly share code, notes, and snippets.

View GurdeepSS's full-sized avatar

Gurdeep Singh Sabarwal GurdeepSS

  • san jose ,CA,USA
View GitHub Profile
@GurdeepSS
GurdeepSS / ApiController.java
Created July 13, 2017 08:13 — forked from itzg/ApiController.java
Bare bones unit test of RestController methods in a Spring Boot application.
package com.example;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.HashMap;
import java.util.Map;
@RestController
@RequestMapping("/api")
@GurdeepSS
GurdeepSS / ApiController.java
Created July 13, 2017 08:13 — forked from itzg/ApiController.java
Bare bones unit test of RestController methods in a Spring Boot application.
package com.example;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.HashMap;
import java.util.Map;
@RestController
@RequestMapping("/api")
import codemasters.lambda.domain.Car;
import codemasters.lambda.domain.Person;
import codemasters.lambda.domain.Sale;
import java.util.*;
import java.util.Map.Entry;
import java.util.function.ToIntFunction;
import java.util.function.ToDoubleFunction;
import java.util.function.Function;
import java.util.function.Supplier;
curl -XPUT 'http://localhost:9200/us/user/1?pretty=1' -d '
{
"email" : "john@smith.com",
"name" : "John Smith",
"username" : "@john"
}
'
curl -XPUT 'http://localhost:9200/gb/user/2?pretty=1' -d '
{
# Transactions with parent-child relationships.
# Delete the index, just in case it still exists.
DELETE /myindex
# Create the index with a mapping for the actual documents and a mapping for the parent transaction type.
PUT /myindex
{
"mappings": {
"transaction": {