Skip to content

Commit

Permalink
clean up tests
Browse files Browse the repository at this point in the history
  • Loading branch information
R-Sandor committed Sep 15, 2024
1 parent d0d6ea7 commit 2f17eff
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 47 deletions.
6 changes: 2 additions & 4 deletions server/src/main/java/dev/findfirst/core/model/Tag.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,9 @@ public class Tag extends Tenantable {
private Long id;

@Column(length = 255)
@NonNull
private String tag_title;
@NonNull private String tag_title;

public Tag() {
}
public Tag() {}

public Tag(String tagVal) {
this.tag_title = tagVal;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
package dev.findfirst.core.service;

import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;

import lombok.RequiredArgsConstructor;

@Service
@RequiredArgsConstructor
public class ScreenshotManager {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,9 @@

import lombok.NonNull;
import lombok.RequiredArgsConstructor;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import dev.findfirst.core.model.Tag;
import dev.findfirst.core.repository.BookmarkRepository;
import dev.findfirst.core.repository.TagRepository;

@Service
Expand All @@ -20,8 +17,6 @@ public class TagService {

private final TagRepository tagRepository;

private final BookmarkRepository bkmkRepo;

public Tag addTag(String title) {
return tagRepository.saveAndFlush(new Tag(title));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import java.util.Optional;
import java.util.UUID;

import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
Expand All @@ -13,7 +14,6 @@
import dev.findfirst.security.userAuth.models.RefreshToken;
import dev.findfirst.users.model.user.User;
import dev.findfirst.users.repository.UserRepo;
import lombok.RequiredArgsConstructor;

@Service
@RequiredArgsConstructor
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package dev.findfirst.security.userAuth.service;

import lombok.RequiredArgsConstructor;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
Expand All @@ -8,7 +9,6 @@

import dev.findfirst.users.model.user.User;
import dev.findfirst.users.repository.UserRepo;
import lombok.RequiredArgsConstructor;

@Service
@RequiredArgsConstructor
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
package dev.findfirst.security.userAuth.tenant.aspects;

import lombok.RequiredArgsConstructor;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.reflect.MethodSignature;
import org.hibernate.Session;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.annotation.AnnotationUtils;
import org.springframework.stereotype.Component;

import jakarta.persistence.EntityManager;
import jakarta.persistence.PersistenceContext;
import lombok.RequiredArgsConstructor;

import dev.findfirst.core.annotations.DisableTenantFilter;
import dev.findfirst.security.userAuth.tenant.contexts.TenantContext;
import dev.findfirst.security.userAuth.utils.Constants;
Expand Down
8 changes: 6 additions & 2 deletions server/src/test/java/dev/findfirst/core/DatabaseTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@
@IntegrationTest
public class DatabaseTest {

@Autowired
DatabaseTest(BookmarkRepository bkmkRepo) {
this.bkmkRepo = bkmkRepo;
}

@MockBean
private TenantContext tenantContext;

Expand All @@ -33,8 +38,7 @@ public class DatabaseTest {
private static final PostgreSQLContainer<?> postgres =
new PostgreSQLContainer<>("postgres:16.2-alpine3.19");

@Autowired
BookmarkRepository bkmkRepo;
final BookmarkRepository bkmkRepo;

@Test
void connectionEstablish() {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class ScreenshotManagerTest {

@InjectMocks
private ScreenshotManager screenshotManager;


@BeforeEach
void setUp() {
Expand Down

This file was deleted.

0 comments on commit 2f17eff

Please sign in to comment.