- Notifications
You must be signed in to change notification settings - Fork12
Tests for rest calls#125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Tests for rest calls#125
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
9006546
tod30cab9
CompareSigned-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
d30cab9
to6660d1a
CompareSigned-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
Since package is always same, so we can resolve the whole path inthe base class.Also put the context information in file name at the end, so thatfixtures show up near the test class in the IDE.Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
Also fix wrong JSON property mapping.Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
…ethodsSigned-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
66515d3
to4f4e3c9
CompareAlso introduce some defaults to models which came from DefectDojo:We had some fields null by default which will be empty string/arrayby default in DefectDojo responses.Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
4f4e3c9
toeccab28
CompareSigned-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
The structure of code should be ordered, so that the more abstractAPI is at the top and the more nitty gritty details are below. Thishas the advantage that one interested in an quick overview need notto scroll up and down. You only need to scroll down for details.Also add some null-checks and missing API doc.Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
7e2587e
toe4b6e3f
CompareThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Have a couple of questions, but LGTM.
@@ -10,7 +10,7 @@ | |||
import io.securecodebox.persistence.defectdojo.model.PaginatedResult; | |||
import io.securecodebox.persistence.defectdojo.model.ProductType; | |||
public class ProductTypeService extends GenericDefectDojoService<ProductType> { | |||
publicfinalclass ProductTypeService extends GenericDefectDojoService<ProductType> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
What is the reasoning behind making the class final ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
This is a general advice to make API as private and immutable as possible to avoid accidental missuse. I make classes in general package private and final. Only, and only if, I later encounter that it is necessary to open such contraints, I do this explicitly. This practice helps me to avoid accidental complexity (e.g. inheritance hell).
Another example – not relevant for this particular example because it is a service and not a value object – isequalTo()
andhashCode()
. If your class is not final then you must handleLiskov Substitution Principle to avoid possible memory leaks. That's quite complicated, so it makes sense to forbid deriving a model class to avoid this.
A very good book about this isEffecitve Java from Joshua Bloch.
*/ | ||
class DefaultImportScanServiceTest { | ||
finalclass DefaultImportScanServiceTest { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
what do you mean in the commit by "This is not a Typical Service"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Not "typical" means "does not inherit from GenericDefectDojoService". Thisis not very good documented nor well architected. Hope to make implicit stuff like this more explicit during my refacotrings.
Uh oh!
There was an error while loading.Please reload this page.
This PR adds capture and replay integration tests for all generic services.