TODO API Client Kata for Kotlin Developers. The main goal is to practice integration testing using MockWebServer

Overview

Karumi logo KataTODOApiClient for Kotlin Build Status

  • We are here to practice integration testsing using HTTP stubbing.
  • We are going to use MockWebServer to simulate a HTTP server.
  • We are going to use JUnit to perform assertions.
  • We are going to practice pair programming.

Getting started

This repository contains an API client to interact with a remote service we can use to implement a TODO application.

This API Client is based on one class with name TodoApiClient containing some methods to interact with the API. Using this class we can get all the tasks we have created before, get a task using the task id, add a new task, update a task or delete an already created task.

The API client has been implemented using a networking framework named Retrofit. Review the project documentation if needed.

Tasks

Your task as a Kotlin Developer is to write all the integration tests needed to check if the API Client is working as expected.

This repository is ready to build the application, pass the checkstyle and your tests in Travis-CI environments.

Our recommendation for this exercise is:

  • Before starting

    1. Fork this repository.
    2. Checkout kata-todo-api-client branch.
    3. Execute the repository playground and make yourself familiar with the code.
    4. Execute TodoApiClientTest and watch the only test it contains pass.
  • To help you get started, these are some tests already written at TodoApiClientTest class. Review it carefully before to start writing your own tests. Here you have the description of some tests you can write to start working on this Kata:

    1. Test that the Accept and ContentType headers are sent.
    2. Test that the list of TaskDto instances obtained invoking the getter method of the property allTasks contains the expected values.
    3. Test that the request is sent to the correct path using the correct HTTP method.
    4. Test that adding a task the body sent to the server is the correct one.

Considerations

  • If you get stuck, master branch contains all the tests already solved.

  • You will find some utilities to help you test the APIClient easily in: MockWebServerTest and the test resources directory.

Extra Tasks

If you've covered all the application functionality using integration tests you can continue with some extra tasks:

  • Replace some integration tests we have created with unit tests. A starting point could be the DefaultHeadersInterceptor class.
  • Create your own API client to consume one of the services described in this web: http://jsonplaceholder.typicode.com/

Documentation

There are some links which can be useful to finish these tasks:

Contributors

Thank you all for your work!


Igor Ganapolsky

License

Copyright 2017 Karumi

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Comments
  • Support latest java version exercises branch.

    Support latest java version exercises branch.

    As I've done with master, I've updated the TravisCI configuration to specify the java version we want to use when running our CI tasks. It doesn't really matter if jdk is 8, 9, 10 or 12 so I used the one the build is configured to target. Additionally, I've updated the gradle version 😃

    Closes #8

    opened by pedrovgs 0
  • Support latest java version

    Support latest java version

    I've updated the TravisCI configuration to specify the java version we want to use when running our CI tasks. It doesn't really matter if jdk is 8, 9, 10 or 12 so I used the one the build is configured to target. Additionally, I've updated the gradle version 😃

    Closes #8

    opened by pedrovgs 0
  • Recreate the project so it works with the latest gradle and java versions

    Recreate the project so it works with the latest gradle and java versions

    During the last training we noticed there were people who couldn't open the repository because of the gradle version and the java version they were using. We should ensure we can get the repository working with java 12 installed.

    We should also review Travis-CI configuration because the JDK is not forced to any version.

    opened by pedrovgs 0
  • Update master dependencies

    Update master dependencies

    • Update to kotlin 1.3
    • Update most dependencies to their most recent version
    • Remove Either implementation from funktionale now that it is now part of Arrow and use our own implementation instead.
    • Fix linting
    opened by Serchinastico 0
  • Add contributors section to the README

    Add contributors section to the README

    Add a new section listing the contributors for the project, in this repository, only Igor is included but we can try using the same format in other projects as well.

    opened by Serchinastico 0
  • Update gradle and dependencies to latest of everything

    Update gradle and dependencies to latest of everything

    This is meant to replace #2 to fix travis while keeping the original author :)

    Friendly reminder: After merging this branch I'll take care of introducing the same changes into the kata-todo-api-client branch.

    opened by Serchinastico 0
  • Add tests

    Add tests

    :cyclone: Git merge message

    • Add ktlint
    • Replace exception driven design with funktionale.Either + sealed classes
    • Replace TaskDTO with a data class
    • Make the code more kotlin friendly
    opened by Serchinastico 0
Owner
Karumi
Karumi, the Rock Solid Code studio
Karumi
Screenshot Kata for Android Developers with Kotlin. The main goal is to practice UI Screenshot Testing.

KataScreenshot in Kotlin We are here to practice UI testing using screenshot tests for Android. We are going to use Espresso to interact with the Appl

Karumi 76 Nov 20, 2022
Super Heroes Kata for Android Developers in Kotlin. The main goal is to practice UI Testing.

KataSuperHeroes in Kotlin We are here to practice UI Testing. We are going to use Espresso to interact with the Application UI. We are going to use Ko

Karumi 86 Nov 20, 2022
KataContacts written in Kotlin. The main goal is to practice Clean Architecture Development

KataContacts written in Kotlin We are here to practice Clean Architecture Development. Clean Architecture is a way of structuring code. We are going t

Karumi 48 Oct 3, 2022
Todo List Application is an android app that allows building a todo list and basic todo items management functionality including adding new items, editing and deleting an existing item

Todo List Application is an android app that allows building a todo list and basic todo items management functionality including adding new items, editing and deleting an existing item

null 0 Jan 22, 2022
Kata to practice Clean Architecture & MVI by building TodoList Application

Mvi Todo Kata Application Features TODO specification Title Description Due Date Priority Supported Operations Create a new TODO Remove a TODO Select

seungmin shin 0 Nov 3, 2021
SimpleTodo - An android app that allows building a todo list and basic todo items management functionality

Pre-work - SimpleTodo SimpleTodo is an android app that allows building a todo l

null 0 Dec 31, 2021
Android-TODO-LIST-VIPER - Android TODO LIST VIPER

Android TODO List VIPER VIPER is an architectural approach for iOS mobile app de

Allan Nava 1 May 26, 2022
Todo-android - To-do App in Andriod that allows building a todo list

To-do App in Andriod todo-android is an android app that allows building a todo

Bernard Mulaw 0 Feb 10, 2022
SimpleToDo is an android app that allows building a todo list and basic todo items management functionality including adding new items, editing and deleting an existing item.

SimpleToDo is an android app that allows building a todo list and basic todo items management functionality including adding new items, editing and deleting an existing item.

null 0 Jan 3, 2022
Registration validation testing, Room database testing using JUnit4

Notes app Registration details validation testing, Room database testing using JUnit4 ✨ Screenshots Authors Tridev Deka - LinkedIn - Tridev Deka MIT L

Tridev Deka 0 Mar 30, 2022
MVVM + Kotlin + Jetpack Compose +Navigation Compose + Hilt + Retrofit + Unit Testing + Compose Testing + Coroutines + Kotlin Flow + Io mockK

MvvmKotlinJetpackCompose Why do we need an architecture even when you can make an app without it? let's say you created a project without any architec

Sayyed Rizwan 46 Nov 29, 2022
CoroutinesFlow and ViewModel Retrofit API - Practice with CoroutinesFlow, ViewModel and Retrofit API

Practice with Coroutines Flow, ViewModel and get data with Retrofit from two API

Komiljon Zokirov 3 Feb 6, 2022
Transport Tycoon Kata

Transport Tycoon Kata This is a kata proposed by SoftwarePark. You can find the original one here I modified some parts of it, to make it different, m

Albert Casanovas 0 Aug 30, 2022
Cody Engel 2 Apr 20, 2022
Akshaya Patra Donation App using Razorpay android integration

Akshaya Patra Donation App (razorpay-android-integration) Akshaya Patra Donation App using razorpay integration Dependency used : Razorpay : com.razor

Ayush Kumar Singh 1 Nov 25, 2021
A reliable android app that shows upcoming fixtures, updated league tables, and top goal scorers in a Premier League and French Ligue 1

RapidScore Screenshots Table of Contents Description Dependencies API Reference Lessons Learnt Contributing Roadmap Google Playstore License Author In

Breens Mbaka 12 Jul 7, 2022
Proyect with the goal to show my skills in android

ChipperMovie Es una aplicación de peliculas y sus detalles filtrados por categorias para demostrar el uso de mis habilidaedes en desarrollo movil. Ace

null 0 Nov 10, 2021
The goal of this assignment is to implement GameOfFifteen

Game of Fifteen Demo The board for the game of Fifteen is filled randomly with numbers from 1 to 15 and one empty space. You can move the neighboring

Josue Lubaki 0 Dec 6, 2021