3ap-ag / harvest-client Goto Github PK
View Code? Open in Web Editor NEWA Java client for the Harvest v2 REST api
License: MIT License
A Java client for the Harvest v2 REST api
License: MIT License
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
[INSERT LOGS HERE]
[INSERT OUTPUT HERE]
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
n/a
There's nothing specific to the environment that is affecting the issue.
[INSERT OUTPUT HERE]
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
https://snyk.io/test/github/3ap-ag/harvest-client?targetFile=build.gradle should be fixed by upgrading the gson dependency and updating the code if necessary
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.