GithubHelp home page GithubHelp logo

wcc_postalcode's Introduction

Run

requires JDK 11

mvn spring-boot:run

mvn test

auth

/list EP is open to all

curl -v -X GET "http://localhost:8080/list"

distance calc /postcodedistance is open to any auth user

curl -v -u user1:user1Pass -X GET "http://localhost:8080/postcodedistance?pc1=AB16%206SZ&pc2=AB21%200AL"

curl -v -u admin1:admin1Pass -X GET "http://localhost:8080/postcodedistance?pc1=AB16%206SZ&pc2=AB21%200AL"

pass a unit ('km' 'm' 'cm' 'mm') param to get different values

curl -v -u user1:user1Pass -X GET "http://localhost:8080/postcodedistance?pc1=AB16%206SZ&pc2=AB21%200AL&unit=cm"

POST and PUT /updatepostcode /addpostcode is only open to admin user

curl -v -u admin1:admin1Pass -H "Content-Type: application/json" -X PUT "localhost:8080/updatepostcode" -d '{"postcode":"AB21 0AL", "coordinate":{"longitude":1.01, "latitude":2.01} }'

curl -v -u admin1:admin1Pass -H "Content-Type: application/json" -X POST "localhost:8080/addpostcode" -d '{"postcode":"TEST TEST", "coordinate":{"longitude":1.01, "latitude":2.01} }'

i18n

try other locales. Messages only seen with errors currently

non-existent postcode

curl -v -H 'Accept-Language: nl' -u user1:user1Pass -X GET "http://localhost:8080/postcodedistance?pc1=AB16%206SZ&pc2=DEADBEEF"

empty coordinates

curl -v -H 'Accept-Language: nl' -u admin1:admin1Pass -H "Content-Type: application/json" -X PUT "localhost:8080/updatepostcode" -d '{"postcode":"AB21 0AL" }'

curl -v -H 'Accept-Language: nl' -u admin1:admin1Pass -H "Content-Type: application/json" -X POST "localhost:8080/addpostcode" -d '{"postcode":"TEST TEST" }'

didnt manage to integrate load test

wcc_postalcode's People

Contributors

abdulazizali77 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.