Closed olis1996 closed 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
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 theimport org.junit.Before;
in line 17
It works now. Thanks a lot!
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.
Kudos, SonarCloud Quality Gate passed!
@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"?