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
using System.Text.RegularExpressions; | |
namespace Sample | |
{ | |
public class PhoneNumberFormatter | |
{ | |
private readonly string number; | |
public PhoneNumberFormatter(string number) | |
{ |
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
{ | |
"version": "1.0.0-*", | |
"buildOptions": { | |
"debugType": "portable" | |
}, | |
"dependencies": { | |
"System.Runtime.Serialization.Primitives": "4.3.0", | |
"xunit": "2.1.0", | |
"dotnet-test-xunit": "1.0.0-rc2-build10015" | |
}, |
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.hudsonmendes.microservice1; | |
import static org.hamcrest.Matchers.hasSize; | |
import static org.mockito.Matchers.any; | |
import static org.mockito.Mockito.doAnswer; | |
import static org.mockito.Mockito.mock; | |
import static org.springframework.http.MediaType.APPLICATION_JSON; | |
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; | |
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; | |
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; |
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
spring: | |
application: | |
name: belfastjug-sample-01 | |
data: | |
mongodb: | |
uri : ${MONGO_URL} | |
database: ${MONGO_DBNAME} |
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.hudsonmendes.microservice1; | |
import org.springframework.data.repository.CrudRepository; | |
public interface VisitorRepository extends CrudRepository<VisitorEntity, String> { | |
} |
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.hudsonmendes.microservice1; | |
import org.springframework.data.annotation.Id; | |
public class VisitorEntity { | |
@Id | |
private String id; | |
private 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.hudsonmendes.microservice1; | |
import static org.springframework.http.ResponseEntity.badRequest; | |
import static org.springframework.http.ResponseEntity.ok; | |
import static org.springframework.web.bind.annotation.RequestMethod.POST; | |
import java.util.ArrayList; | |
import java.util.List; | |
import java.util.Map; | |
import java.util.UUID; |
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.hudsonmendes.microservice1; | |
import org.springframework.boot.SpringApplication; | |
import org.springframework.boot.autoconfigure.SpringBootApplication; | |
import org.springframework.data.mongodb.repository.config.EnableMongoRepositories; | |
@SpringBootApplication | |
@EnableMongoRepositories | |
public class AppEntry { | |
public static void main(final String[] args) { |
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
buildscript { | |
ext { | |
springBootVersion = "1.5.2.RELEASE" | |
gradleDockerVersion = "1.2" | |
} | |
repositories { | |
mavenCentral() | |
} | |
dependencies { | |
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}") |
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
FROM frolvlad/alpine-oraclejdk8:slim | |
ENV MONGO_URL mongodb://localhost/belfastjug_sample_01 | |
EXPOSE 8080 | |
RUN mkdir -p /app/ | |
ADD build/libs/belfastjug-sample-01-0.0.1-SNAPSHOT.jar /app/belfastjug-sample-01.jar | |
ENTRYPOINT ["java", "-jar", "/app/belfastjug-sample-01.jar"] |