This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import spock.lang.Specification | |
/** | |
* Unit tests for {@link Controller} | |
*/ | |
class ControllerTest extends Specification { | |
private static final String USERNAME = 'Duggie' | |
private static final String EMAIL = 'Duggie@test.com' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>com.cor</groupId> | |
<artifactId>spring-hateoas-demo</artifactId> | |
<version>0.0.1-SNAPSHOT</version> | |
<name>spring-hateoas-demo</name> | |
<parent> | |
<groupId>org.springframework.boot</groupId> | |
<artifactId>spring-boot-starter-parent</artifactId> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.cor.service; | |
import java.util.Collection; | |
import java.util.HashMap; | |
import java.util.Map; | |
import org.springframework.stereotype.Service; | |
import com.cor.domain.Album; | |
import com.cor.domain.Artist; | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.cor.domain; | |
/** | |
* Music Artist/Group. | |
* | |
*/ | |
public class Artist { | |
private final String id; | |
private final String name; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.cor.domain; | |
/** | |
* Album (available to purchase - hence 'stockLevel' attribute). | |
* | |
*/ | |
public class Album { | |
private final String id; | |
private final String title; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.cor.controller; | |
import static org.springframework.hateoas.mvc.ControllerLinkBuilder.linkTo; | |
import static org.springframework.hateoas.mvc.ControllerLinkBuilder.methodOn; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.hateoas.Resource; | |
import org.springframework.http.MediaType; | |
import org.springframework.stereotype.Controller; | |
import org.springframework.web.bind.annotation.PathVariable; | |
import org.springframework.web.bind.annotation.RequestMapping; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.cor.controller; | |
import static org.springframework.hateoas.mvc.ControllerLinkBuilder.linkTo; | |
import static org.springframework.hateoas.mvc.ControllerLinkBuilder.methodOn; | |
import java.util.ArrayList; | |
import java.util.Collection; | |
import java.util.List; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.hateoas.Resource; | |
import org.springframework.http.MediaType; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.cor; | |
import org.springframework.boot.SpringApplication; | |
import org.springframework.boot.autoconfigure.EnableAutoConfiguration; | |
import org.springframework.context.annotation.ComponentScan; | |
/** | |
* Spring Boot launch file. | |
*/ | |
@ComponentScan |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT ID, NAME | |
XMLTYPE(u.accountxml).EXTRACT('/person/account/sortCode/text()') as SORTCODE | |
FROM USER u; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print("Starting MongoDB Library Database Build Script") | |
print("Creating Libary Database") | |
var libraryDB = db.getSiblingDB("library") | |
print("Creating Book Collection") | |
libraryDB.createCollection("book") | |
print("Creating index on 'type' field") | |
libraryDB.book.ensureIndex({type:1}) |
NewerOlder