Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
12 changes: 6 additions & 6 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
version: 2
updates:
- package-ecosystem: maven
directory: "/"
schedule:
interval: daily
time: "09:00"
open-pull-requests-limit: 10
- package-ecosystem: maven
directory: "/"
schedule:
interval: daily
time: "09:00"
open-pull-requests-limit: 10
2 changes: 1 addition & 1 deletion CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Contributor Code of Conduct

This project adheres to No Code of Conduct. We are all adults. We accept anyone's contributions. Nothing else matters.
This project adheres to No Code of Conduct. We are all adults. We accept anyone's contributions. Nothing else matters.

For more information please visit the [No Code of Conduct](https://github.com/domgetter/NCoC) homepage.
80 changes: 47 additions & 33 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,78 +5,92 @@ Below are few **rules, recommendations and best practices** we try to follow whe
## Paperwork

### Committer

* The **commit message**:
* must be written in the **imperative mood**
* must clearly **explain rationale** behind this change (describe _why_ you are doing the change rather than _what_ you are changing)
* must be written in the **imperative mood**
* must clearly **explain rationale** behind this change (describe _why_ you are doing the change rather than _what_
you are changing)
* The **pull request**:
* with non-trivial, non-dependencies change must be **[associated with an issue](https://help.github.com/articles/closing-issues-via-commit-messages/)**
* with non-trivial, non-dependencies change must be *
*[associated with an issue](https://help.github.com/articles/closing-issues-via-commit-messages/)**
* Add usage examples of new high level functionality to
[documentation](https://github.com/gooddata/gooddata-java/wiki/Code-Examples).
[documentation](https://github.com/gooddata/gooddata-java/wiki/Code-Examples).

### Reviewer

Ensure pull request and issues are
* **properly labeled** (trivial/bug/enhancement/backward incompatible/...)
* marked with exactly one **milestone version**

* **properly labeled** (trivial/bug/enhancement/backward incompatible/...)
* marked with exactly one **milestone version**

## Design

### Structure

* **Package names** for DTOs and services should be named in the same manner as REST API.
* Don't create single implementation interfaces for services.

### DTOs

* All DTOs which can be updated should be **mutable**. Please keep mutable only the fields which are subject of change,
the rest should be immutable.
the rest should be immutable.
* Create method named `String getUri()` to provide **URI string to self**.
* Introduce **constant** with URI:
* ```java
* ```java
public static final String URI = "/gdc/someresource/{resource-id}";
```
* If you need also constants with `UriTemplate`, do not put them into DTOs not to drag Spring dependency into model module.
* If you need also constants with `UriTemplate`, do not put them into DTOs not to drag Spring dependency into model
module.
* Put _Jackson_ annotations on getters rather then on fields.
* Consider the **visibility** - use `package protected` when DTO is not intended for SDK user, but is needed
in related service.
in related service.
* Test all DTOs using _[JsonUnit](https://github.com/lukas-krecan/JsonUnit)_.
* **Naming**:
* `Uri` for _URI string_ of some resource
* `Link` for structure containing at least _category_ (e.g. "self") and _URI string_
(can contain also others like _title_, _summary_, etc.)
* `Uri` for _URI string_ of some resource
* `Link` for structure containing at least _category_ (e.g. "self") and _URI string_
(can contain also others like _title_, _summary_, etc.)

### Enums

* Use enums sparingly, because they don't work with REST API changes (eg. new value added on the backend) **never use
them when deserializing**.
them when deserializing**.
* Where make sense, use overloaded methods with an enum argument as well as `String` argument.

### Services

* When programming client for some polling return [`FutureResult`](src/main/java/com/gooddata/FutureResult.java)
to enable user asynchronous call.
to enable user asynchronous call.
* Create custom [`GoodDataException`](src/main/java/com/gooddata/GoodDataException.java) when you feel the case
is specific enough.
is specific enough.
* Prefer DTOs to `String` or primitive arguments.
* **Method naming**:
* `get*()` when searching form single object (throw exception when no or multiple objects are found,
never return `null`)
* `find*()` when searching for multiple objects (collection of objects, never return `null`)
* `list*()` when listing whole or paged collection of objects (return collection or collection wrapped by DTO)
* `remove*()` (i.e. `remove(Project project)`) instead od `delete*()`
* In addition to unit tests, write also **integration tests** and **acceptance tests** if possible. See "What to test where" in "Best practices" below.
* `get*()` when searching form single object (throw exception when no or multiple objects are found,
never return `null`)
* `find*()` when searching for multiple objects (collection of objects, never return `null`)
* `list*()` when listing whole or paged collection of objects (return collection or collection wrapped by DTO)
* `remove*()` (i.e. `remove(Project project)`) instead od `delete*()`
* In addition to unit tests, write also **integration tests** and **acceptance tests** if possible. See "What to test
where" in "Best practices" below.
* Update [documentation](https://github.com/gooddata/gooddata-java/wiki/Code-Examples) with usage examples.

## Best practices

* **What to test where**:
* `*Test` = unit tests
* focus on verifying bussiness logic, corner cases, various input combinations, etc.
* avoid service tests using mocked `RestTemplate` - use integration tests with mocked API responses instead
* `*IT` = integration tests
* focus on verifying all possible outcomes of API calls
* see common ancestor [`AbstractGoodDataIT`](src/test/java/com/gooddata/AbstractGoodDataIT.java) setting up [Jadler](https://github.com/jadler-mocking/jadler/wiki) for API mocking
* `*AT` = acceptance tests
* focus on verifying the happy path against the real backend (so we're sure mocks in ITs are correct)
* see common ancestor [`AbstractGoodDataAT`](src/test/java/com/gooddata/AbstractGoodDataAT.java) setting up GoodData endpoint based on passed environment variables
* `*Test` = unit tests
* focus on verifying bussiness logic, corner cases, various input combinations, etc.
* avoid service tests using mocked `RestTemplate` - use integration tests with mocked API responses instead
* `*IT` = integration tests
* focus on verifying all possible outcomes of API calls
* see common ancestor [`AbstractGoodDataIT`](src/test/java/com/gooddata/AbstractGoodDataIT.java) setting
up [Jadler](https://github.com/jadler-mocking/jadler/wiki) for API mocking
* `*AT` = acceptance tests
* focus on verifying the happy path against the real backend (so we're sure mocks in ITs are correct)
* see common ancestor [`AbstractGoodDataAT`](src/test/java/com/gooddata/AbstractGoodDataAT.java) setting up
GoodData endpoint based on passed environment variables
* Everything public should be **documented** using _javadoc_.
* When you need some **utility code**, look for handy utilities in used libraries first (e.g. _Spring_ has
its `StreamUtils`, `FileCopyUtils`, ...). When you decide to create new utility class,
use _abstract utility class pattern_.
its `StreamUtils`, `FileCopyUtils`, ...). When you decide to create new utility class,
use _abstract utility class pattern_.

## Release candidates

Expand Down
70 changes: 22 additions & 48 deletions LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ GoodData Java SDK

BSD License

Copyright (c) 2014-2023, GoodData Corporation
Copyright (c) 2014-2025, GoodData Corporation

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Expand Down Expand Up @@ -41,67 +41,41 @@ PART 1: SUBCOMPONENTS
- AOP alliance (1.0) [public-domain]
- Apache Ant Core (1.10.3) [Apache-2.0]
- Apache Ant Launcher (1.10.3) [Apache-2.0]
- Apache Commons IO (2.11.0) [Apache-2.0]
- Apache Commons Lang (3.12.0) [Apache-2.0]
- Apache Groovy (3.0.11) [Apache-2.0]
- Apache Groovy (2.5.7) [Apache-2.0]
- Apache Groovy (2.5.4) [Apache-2.0]
- Apache Groovy (2.5.4) [Apache-2.0]
- Apache Groovy (2.5.4) [Apache-2.0]
- Apache Groovy (2.5.4) [Apache-2.0]
- Apache Groovy (2.5.4) [Apache-2.0]
- Apache Groovy (2.5.4) [Apache-2.0]
- Apache Groovy (2.5.4) [Apache-2.0]
- Apache HttpClient (4.5.13) [Apache-2.0]
- Apache HttpCore (4.4.15) [Apache-2.0]
- Byte Buddy (without dependencies) (1.12.1) [BSD-3-Clause, Apache-2.0]
- Byte Buddy agent (1.12.1) [Apache-2.0]
- cglib-nodep (3.3.0) [Apache-2.0]
- EqualsVerifier | release normal jar (3.7.2) [Apache-2.0]
- EqualsVerifier | release normal jar (3.10) [Apache-2.0]
- gooddata-http-client (1.0.0) [BSD-3-Clause]
- gooddata-http-client (1.0.0+java7.fix1) [BSD-3-Clause]
- gooddata-rest-common (2.0.0) [BSD-3-Clause]
- Apache Commons IO (2.21.0) [Apache-2.0]
- Apache Commons Lang (3.20.0) [Apache-2.0]
- Apache Groovy (4.0.28) [Apache-2.0]
- gooddata-http-client (3.0.0-SNAPSHOT) [BSD-3-Clause]
- gooddata-rest-common (3.0.0) [BSD-3-Clause]
- Gson (2.3.1) [Apache-2.0]
- Guava: Google Core Libraries for Java (17.0) [Apache-2.0, CC0-1.0]
- Hamcrest (2.2) [BSD-3-Clause]
- Hamcrest Core (2.2) [BSD-3-Clause]
- Jackson-annotations (2.13.0) [Apache-2.0]
- Jackson-core (2.13.0) [Apache-2.0]
- jackson-databind (2.13.0) [Apache-2.0]
- jackson-databind (2.13.3) [Apache-2.0]
- jackson-databind (2.13.4) [Apache-2.0]
- jadler-all (1.3.1) [MIT, Apache-2.0]
- jadler-core (1.3.1) [MIT, Apache-2.0]
- javax.inject (1) [Apache-2.0]
- jakarta.inject (1) [Apache-2.0]
- jcommander (1.78) [Apache-2.0]
- JSON in Java (20090211) [JSON]
- json-unit (2.28.0) [Apache-2.0]
- json-unit (2.35.0) [Apache-2.0]
- json-unit-core (2.28.0) [Apache-2.0]
- json-unit-core (2.35.0) [Apache-2.0]
- json-unit (2.36.0) [Apache-2.0]
- json-unit-core (2.36.0) [Apache-2.0]
- JSONassert (1.2.3) [Apache-2.0]
- JUnit (4.12) [CPL-1.0]
- Mockito (4.6.1) [MIT, Apache-2.0]
- Mockito (4.1.0) [MIT, Apache-2.0]
- Mockito (5.14.2) [MIT, Apache-2.0]
- Objenesis (3.2) [MIT]
- Sardine WebDAV client (5.10) [Apache-2.0]
- Sardine WebDAV client (5.13) [Apache-2.0]
- Shazamcrest (0.11) [Apache-2.0]
- SLF4J API Module (2.0.0-alpha7) [MIT]
- SLF4J Simple Binding (2.0.0-alpha7) [MIT]
- SLF4J API Module (2.0.17) [MIT]
- SLF4J Simple Binding (2.0.17) [MIT]
- SnakeYAML (1.21) [Apache-2.0, Multi-license: LGPL-2.1-or-later OR GPL-2.0-or-later OR EPL-1.0 OR BSD-3-Clause OR Apache-2.0]
- Spock Framework - Core Module (2.2-M1-groovy-4.0) [Apache-2.0]
- Spock Framework - Core Module (1.3-groovy-2.5) [Apache-2.0]
- Spring Beans (5.3.20) [Apache-2.0]
- Spring Beans (5.3.13) [Apache-2.0]
- Spring Commons Logging Bridge (5.3.13) [Apache-2.0]
- Spring Context (5.3.20) [Apache-2.0]
- Spring Core (5.3.20) [BSD-3-Clause, Apache-2.0]
- Spring Core (5.3.13) [BSD-3-Clause, Apache-2.0]
- Spring Retry (1.3.1) [Apache-2.0]
- Spring Web (5.3.20) [Apache-2.0]
- Spring Web (5.3.13) [Apache-2.0]
- testng (7.3.0) [Apache-2.0, AML]
- testng (7.6.0) [Apache-2.0]
- Spock Framework - Core Module (2.4-M1-groovy-4.0) [Apache-2.0]
- Spring Beans (6.0.15) [Apache-2.0]
- Spring Context (6.0.15) [Apache-2.0]
- Spring Core (6.0.15) [BSD-3-Clause, Apache-2.0]
- Spring Retry (2.0.12) [Apache-2.0]
- Spring Web (6.0.15) [Apache-2.0]
- testng (7.11.0) [Apache-2.0, AML]

PART 2: LICENSES APPENDIX
Apache 2.0
Expand Down Expand Up @@ -2814,7 +2788,7 @@ This program is made available under the terms of the MIT License.


--------------------------------------------------------------------------------
javax.inject (1)
jakarta.inject (1)
--------------------------------------------------------------------------------

* Declared Licenses *
Expand Down
Loading
Loading