Giter Site home page Giter Site logo

holiday-temps's Introduction

Build

Holiday temperatures

A small REST service that returns bank holidays for an input time period and location, and the corresponding max and min temperatures.

How to run

Make sure you have Gradle version 6.8 or later installed, or that you are able to download and run Gradle packages via the included wrapper.

To run the web service locally, execute gradle bootRun, you will then be able to query the webservice, for example:

curl -H "Accept: application/json" "http://localhost:8080/bank-holidays/London/temps?startDate=2020-01-01&endDate=2020-01-30"

Known issues

Please see the Issues tab on GitHub for a list of known issues and potential improvements.

holiday-temps's People

Contributors

ilcatania avatar

Watchers

 avatar  avatar

holiday-temps's Issues

Improve JSON parsing logic

currently JSON parsing from external web services is done into plain lists/maps. This is potentially unsafe and makes code much uglier. Migrate to ad hoc data model to be serialized/deserialized via jackson.

Holidays are not city dependent

current holiday retrieval goes straight to "England and Wales" holidays irrespective of the city being passed as input. It should at the very least check that the input city is indeed in England or Wales, or even better figure out where it is and load holidays accordingly.

Create integration test

Currently test suite only has WireMock based unit tests for the two service implementations consuming external REST services, and a Mockito based unit test for the REST service implementation. A full end to end integration test is missing.

Improve test coverage

Current unit test suite only covers one single happy flow per implementation. Should extend to cover bad input, bad output, corner cases, missing data, etc/

filtering by dates not implemented

Holiday filtering by date is not implemented, so all dates are currently returned.
This includes future dates, they should obviously be filtered out as there won't be any dates

handle multiple cities with same name

e.g. I tried Birmingham and two woeids are being returned. At the very least a warning should be logged. Right now, the service silently takes the first returned entry.

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.