This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 Xunit; | |
| namespace Sample | |
| { | |
| public class PhoneNumberFormatterTest | |
| { | |
| [Theory] | |
| [InlineData( "44274499", "4427-4499")] | |
| [InlineData( "944274499", "9-4427-4499")] | |
| [InlineData( "1144274499", "11-4427-4499")] |
This file contains hidden or 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; | |
| using System.Linq; | |
| using System.Text; | |
| namespace Sample | |
| { | |
| public class PhoneNumberFormatter | |
| { | |
| private readonly string number; |
This file contains hidden or 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; | |
| using System.Threading; | |
| namespace Magicas { | |
| public static class IoC<TInterface> { | |
| private static ReaderWriterLockSlim syncLock = new ReaderWriterLockSlim(); | |
| private static TInterface singleton; | |
| public static TInterface Singleton => NewOrGetSingleton(); |
This file contains hidden or 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
| docker images | grep \<none\> | awk '{print $3}' | xargs docker rmi -f && \ | |
| docker ps -a | grep Exited | awk '{print $1}' | xargs docker rm -f |