DataCater / datacater

The developer-friendly ETL platform for transforming data in real-time. Based on Apache Kafka® and Kubernetes®.
https://datacater.io
Other
82 stars 4 forks source link

Feature/introduce config resource #78

Closed olis1996 closed 1 year ago

olis1996 commented 1 year ago

@HknLof @ChrisRousey I created an initial version of the config endpoint and started implementing some tests. However, I have a few questions regarding the implementation:

1.) Should i log if a config is created, deleted, updated etc? 2.) Do we accept the creation of a config if another one with the exact same properties already exists? (same name, kind, config) 3.) If the user tries to update/delete a not-existing config the API should return 404, right? 4.) In "ConfigEndpointTest.java, why is my setUp method executed after my endpoint test methods, although it is annotated with "@Before"?

ChrisRousey commented 1 year ago

3.) If the user tries to update/delete a not-existing config the API should return 404, right?

Yeah, 404. Your ExceptionMapper looks correct.

4.) In "ConfigEndpointTest.java, why is my setUp method executed after my endpoint test methods, although it is annotated with "https://github.com/before"?

You are using Junit.Jupiter (which is part of junit5) to annotate your tests, but the @Before Annotation is for JUnit4. You should use the JUnit5 Annotation @BeforeAll and can remove the import org.junit.Before; in line 17

olis1996 commented 1 year ago

You are using Junit.Jupiter (which is part of junit5) to annotate your tests, but the @before Annotation is for JUnit4. You should use the JUnit5 Annotation @BeforeAll and can remove the import org.junit.Before; in line 17

It works now. Thanks a lot!

olis1996 commented 1 year ago

I added comments to all test cases, which will be removed before finishing the config endpoint feature, so that my idea behind the test is easier to understand.

sonarcloud[bot] commented 1 year ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

97.3% 97.3% Coverage
2.8% 2.8% Duplication