Code Monkey home page Code Monkey logo

harvest-client's People

Contributors

auricgoldfinger avatar dan-m avatar giovannifilannino avatar mnembrini avatar predragmpetrovic avatar primaproxima avatar sboldur avatar spiewok avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

harvest-client's Issues

Some tests are now failing

Some tests are currently failing:

Failures (6):
  JUnit Jupiter:UserAssignmentsApiCreateTest:createAllOptions()
    MethodSource [className = 'ch.aaap.harvestclient.impl.userAssignment.UserAssignmentsApiCreateTest', methodName = 'createAllOptions', methodParameterTypes = '']
    => java.lang.AssertionError:
Expecting value <220.0> in field <"hourlyRate"> but was <null> in <UserAssignment{user=UserReferenceDto{id=3097813, name=Marioanother Muster 71962}, active=false, projectManager=true, hourlyRate=null, budget=1111.0, id=228507658, createdAt=2020-01-14T15:41:37Z, updatedAt=2020-01-14T15:41:37Z}>.
Comparison was performed on all fields but <["id", "createdAt", "updatedAt"]>
       ch.aaap.harvestclient.impl.userAssignment.UserAssignmentsApiCreateTest.createAllOptions(UserAssignmentsApiCreateTest.java:67)
       sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
       sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
       java.lang.reflect.Method.invoke(Method.java:498)
       org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:436)
       org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:115)
       org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$6(TestMethodTestDescriptor.java:170)
       org.junit.jupiter.engine.execution.ThrowableCollector.execute(ThrowableCollector.java:40)
       org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(TestMethodTestDescriptor.java:166)
       [...]
  JUnit Jupiter:UserAssignmentsApiUpdateTest:changeAll()
    MethodSource [className = 'ch.aaap.harvestclient.impl.userAssignment.UserAssignmentsApiUpdateTest', methodName = 'changeAll', methodParameterTypes = '']
    => java.lang.AssertionError:
Expecting value <110.0> in field <"hourlyRate"> but was <null> in <UserAssignment{user=UserReferenceDto{id=3097813, name=Marioanother Muster 71962}, active=true, projectManager=true, hourlyRate=null, budget=1.1111111E7, id=228507672, createdAt=2020-01-14T15:41:43Z, updatedAt=2020-01-14T15:41:44Z}>
       ch.aaap.harvestclient.impl.userAssignment.UserAssignmentsApiUpdateTest.changeAll(UserAssignmentsApiUpdateTest.java:65)
       sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
       sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
       java.lang.reflect.Method.invoke(Method.java:498)
       org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:436)
       org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:115)
       org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$6(TestMethodTestDescriptor.java:170)
       org.junit.jupiter.engine.execution.ThrowableCollector.execute(ThrowableCollector.java:40)
       org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(TestMethodTestDescriptor.java:166)
       [...]
  JUnit Jupiter:ProjectsApiUpdateTest:changeBudgetByMinimal()
    MethodSource [className = 'ch.aaap.harvestclient.impl.project.ProjectsApiUpdateTest', methodName = 'changeBudgetByMinimal', methodParameterTypes = '']
    => ch.aaap.harvestclient.exception.RequestProcessingException: Name This project name is already used on another project.
       ch.aaap.harvestclient.impl.ExceptionHandler.callOrThrow(ExceptionHandler.java:56)
       ch.aaap.harvestclient.impl.ExceptionHandler.callOrThrow(ExceptionHandler.java:32)
       ch.aaap.harvestclient.impl.ProjectsApiImpl.create(ProjectsApiImpl.java:53)
       ch.aaap.harvestclient.impl.project.ProjectsApiUpdateTest.beforeEach(ProjectsApiUpdateTest.java:53)
       sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
       sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
       java.lang.reflect.Method.invoke(Method.java:498)
       org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:436)
       org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:115)
       [...]
  JUnit Jupiter:TimesheetsApiListTest:listPaginated()
    MethodSource [className = 'ch.aaap.harvestclient.impl.timesheet.TimesheetsApiListTest', methodName = 'listPaginated', methodParameterTypes = '']
    => java.lang.AssertionError:
Expecting:
 <1>
to be greater than or equal to:
 <2>
       ch.aaap.harvestclient.impl.timesheet.TimesheetsApiListTest.listPaginated(TimesheetsApiListTest.java:108)
       sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
       sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
       java.lang.reflect.Method.invoke(Method.java:498)
       org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:436)
       org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:115)
       org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$6(TestMethodTestDescriptor.java:170)
       org.junit.jupiter.engine.execution.ThrowableCollector.execute(ThrowableCollector.java:40)
       org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(TestMethodTestDescriptor.java:166)
       [...]
  JUnit Jupiter:ClientsApiCreateTest:createInvalidCurrency()
    MethodSource [className = 'ch.aaap.harvestclient.impl.client.ClientsApiCreateTest', methodName = 'createInvalidCurrency', methodParameterTypes = '']
    => org.junit.ComparisonFailure: expected:<"[USD]"> but was:<"[CHF]">
       sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
       sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
       sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
       ch.aaap.harvestclient.impl.client.ClientsApiCreateTest.createInvalidCurrency(ClientsApiCreateTest.java:79)
       sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
       sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
       java.lang.reflect.Method.invoke(Method.java:498)
       org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:436)
       org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:115)
       [...]
  JUnit Jupiter:InvoicesApiListTest:listByDateRange()
    MethodSource [className = 'ch.aaap.harvestclient.impl.invoice.InvoicesApiListTest', methodName = 'listByDateRange', methodParameterTypes = '']
    => ch.aaap.harvestclient.exception.RequestProcessingException: Issued at must be on or after 2000-01-14, Due at must be on or after 2000-01-14
       ch.aaap.harvestclient.impl.ExceptionHandler.callOrThrow(ExceptionHandler.java:56)
       ch.aaap.harvestclient.impl.ExceptionHandler.callOrThrow(ExceptionHandler.java:32)
       ch.aaap.harvestclient.impl.InvoicesApiImpl.create(InvoicesApiImpl.java:59)
       ch.aaap.harvestclient.impl.invoice.InvoicesApiListTest.listByDateRange(InvoicesApiListTest.java:157)
       sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
       sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
       java.lang.reflect.Method.invoke(Method.java:498)
       org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:436)
       org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:115)
       [...]

investigate why

New Issue Checklist

Issue Description

Complete output
[INSERT LOGS HERE]

Environment

[INSERT OUTPUT HERE]

Extend the harvest client configuration to allow API rate limiting for Harvest Report APIs

New Issue Checklist

Issue Description

Harvest API reporting endpoints (such expenses, invoices) have different rate limits, then the other API endpoints. Basically Harvest classifies the endpoints into two groups, each having its own API limits.

Currently, the harvest client does not distinguish these two API limit types. It only allows to configure one pair of time window and maximum request for that time window.

This introduces a risk to hit the API limits when using the library in production, or when running the integration tests.
One way around this is creating a dedicated request Interceptor (from okhttp library) and configuration, in order to instantiate the Report APIs using the rate limiting setting.

Find more about the Harvest API v2 rate limits here

Complete output
n/a

Environment

There's nothing specific to the environment that is affecting the issue.

[INSERT OUTPUT HERE]

Update ExistingData mechanism

The ExistingData class in the test folder is used to setup some initial data the integration test rely on.
This has a manual step that is tedious: Think about a better method for this.

One option is to create a file to store the ids of the created objects: this should speed up successive tests run on the same environment. This feature should be opt-in for the developer:
by default everything should run out of the box without requiring any manual changes

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.