Skip to main content

All Questions

Tagged with
-1 votes
3 answers
1k views

Should methods with business logic be made private? [duplicate]

So I am writing a project using Spring Boot. All of my logic resides in @Service classes. I have separated each service class based on entity. For example - If I have two independent entities A and B, ...
rsp's user avatar
  • 143
0 votes
2 answers
114 views

What to test when testing an API? [closed]

When testing an API (with, for example, Java), what parts should I actually be testing when calling methods of my Controller class (e.g. a Spring RestController)? For example, lets say I've got a ...
rezadru's user avatar
  • 21
0 votes
2 answers
303 views

How to I best test this method? Do I need to split it up?

Okay, please consider the following method. Let me first tell you that my goals of the method is to determine if file system assets exist. That's to say this is an internal company site where you'd ...
Paul Duer's user avatar
  • 139
2 votes
1 answer
339 views

Using Spring in Java Project

I've got a question about a correct usage of Spring. I know that some people use the DI "aggressively" so that they always use spring and completely eliminate the usage of word "new" in the ...
Mark Bramnik's user avatar
2 votes
2 answers
4k views

Testing using mocking, must I mock all dependencies too?

I have the following method to test: public List<MarkId> getMarkIdList(ICar carDoc) { ICourseCar courseCarDoc = courseCarRep.get(carDoc); List<MarkWag> markWagList = ...
user1883212's user avatar
4 votes
2 answers
398 views

How to add rigor to my testing?

I work on a small/medium sized Java application. Over time, I've tried to ensure that the tests which I write are "good" tests, and that there's plenty of them. Hence I've been looking into various, ...
Tinned_Tuna's user avatar
5 votes
2 answers
5k views

Write Unit test for heavily-database application? [duplicate]

I'm currently developing a Spring-based web-application, in which almost every operation create/update/delete something in the database. The logic mostly about checking condition so as to we should ...
Hoàng Long's user avatar