Remove service interfaces — use concrete classes directly

Each domain had a single-implementation interface (e.g. AdminService
interface + AdminServiceImpl). Merged implementation into the service
class and deleted the redundant interfaces per KISS principle.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-02 11:04:41 +02:00
parent 03b96e8584
commit 9713412d42
21 changed files with 1171 additions and 1595 deletions

View File

@@ -30,7 +30,7 @@ class AdminServiceTest {
@Mock private AdminUserQueryRepository adminUserQueryRepository;
@Mock private PasswordEncoder passwordEncoder;
private AdminServiceImpl adminService;
private AdminService adminService;
private final String adminEmail = "admin@example.com";
private UserAccount adminUser;
@@ -38,7 +38,7 @@ class AdminServiceTest {
@BeforeEach
void setUp() {
adminService = new AdminServiceImpl(userAccountRepository, auditLogRepository, adminUserQueryRepository, passwordEncoder);
adminService = new AdminService(userAccountRepository, auditLogRepository, adminUserQueryRepository, passwordEncoder);
adminUser = new UserAccount("admin@example.com", "Admin", "hashed");
setId(adminUser, UserAccount.class, UUID.randomUUID());
targetUser = new UserAccount("jane@example.com", "Jane", "hashed");

View File

@@ -35,7 +35,7 @@ class AuthServiceTest {
private PasswordEncoder passwordEncoder;
@InjectMocks
private AuthServiceImpl authService;
private AuthService authService;
@Test
void signupShouldCreateUserAndReturnResponse() {

View File

@@ -40,7 +40,7 @@ class HouseholdServiceTest {
@Mock private VarietyScoreConfigRepository varietyScoreConfigRepository;
@InjectMocks
private HouseholdServiceImpl householdService;
private HouseholdService householdService;
private UserAccount testUser() {
return new UserAccount("sarah@example.com", "Sarah", "hashed");

View File

@@ -32,7 +32,7 @@ class PantryServiceTest {
@Mock private HouseholdRepository householdRepository;
@Mock private IngredientRepository ingredientRepository;
@InjectMocks private PantryServiceImpl pantryService;
@InjectMocks private PantryService pantryService;
private static final UUID HOUSEHOLD_ID = UUID.randomUUID();

View File

@@ -37,7 +37,7 @@ class PlanningServiceTest {
@Mock private UserAccountRepository userAccountRepository;
@Mock private VarietyScoreConfigRepository varietyScoreConfigRepository;
@InjectMocks private PlanningServiceImpl planningService;
@InjectMocks private PlanningService planningService;
private static final UUID HOUSEHOLD_ID = UUID.randomUUID();
private static final LocalDate WEEK_START = LocalDate.of(2026, 4, 6); // Monday

View File

@@ -38,7 +38,7 @@ class SuggestionsTest {
@Mock private UserAccountRepository userAccountRepository;
@Mock private VarietyScoreConfigRepository varietyScoreConfigRepository;
private PlanningServiceImpl planningService;
private PlanningService planningService;
private static final UUID HOUSEHOLD_ID = UUID.randomUUID();
private static final LocalDate MONDAY = LocalDate.of(2026, 4, 6);
@@ -47,7 +47,7 @@ class SuggestionsTest {
@BeforeEach
void setUp() {
planningService = new PlanningServiceImpl(
planningService = new PlanningService(
weekPlanRepository, weekPlanSlotRepository, cookingLogRepository,
recipeRepository, householdRepository, userAccountRepository,
varietyScoreConfigRepository);

View File

@@ -38,7 +38,7 @@ class VarietyScoreTest {
@Mock private UserAccountRepository userAccountRepository;
@Mock private VarietyScoreConfigRepository varietyScoreConfigRepository;
private PlanningServiceImpl planningService;
private PlanningService planningService;
private static final UUID HOUSEHOLD_ID = UUID.randomUUID();
private static final LocalDate MONDAY = LocalDate.of(2026, 4, 6);
@@ -47,7 +47,7 @@ class VarietyScoreTest {
@BeforeEach
void setUp() {
planningService = new PlanningServiceImpl(
planningService = new PlanningService(
weekPlanRepository, weekPlanSlotRepository, cookingLogRepository,
recipeRepository, householdRepository, userAccountRepository,
varietyScoreConfigRepository);

View File

@@ -28,7 +28,7 @@ class RecipeServiceTest {
@Mock private IngredientCategoryRepository ingredientCategoryRepository;
@Mock private HouseholdRepository householdRepository;
@InjectMocks private RecipeServiceImpl recipeService;
@InjectMocks private RecipeService recipeService;
private static final UUID HOUSEHOLD_ID = UUID.randomUUID();