Skip to content

Commit

Permalink
Sonar autowired cont.
Browse files Browse the repository at this point in the history
  • Loading branch information
R-Sandor committed Sep 15, 2024
1 parent 848784b commit 8902011
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
import org.springframework.stereotype.Service;

import jakarta.transaction.Transactional;

import lombok.RequiredArgsConstructor;
import dev.findfirst.security.userAuth.tenant.model.Tenant;

@Service
@RequiredArgsConstructor
public class TenantService {

@Autowired
private TenantRepository tenantRepository;
private final TenantRepository tenantRepository;

public Tenant create(String name) {
var tenant = new Tenant();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,20 +49,22 @@
@Testcontainers
@IntegrationTest
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
public class BookmarkControllerTest {
class BookmarkControllerTest {

@Container
@ServiceConnection
static PostgreSQLContainer<?> postgres = new PostgreSQLContainer<>("postgres:16.2-alpine3.19");

@Autowired
BookmarkRepository bkmkRepo;

@Autowired
TestRestTemplate restTemplate;
BookmarkControllerTest(BookmarkRepository bookmarkRepository, TestRestTemplate tRestTemplate, WebApplicationContext wContext) {
this.bkmkRepo = bookmarkRepository;
this.restTemplate = tRestTemplate;
this.wac = wContext;
}

@Autowired
WebApplicationContext wac;
final BookmarkRepository bkmkRepo;
final TestRestTemplate restTemplate;
final WebApplicationContext wac;

private WebTestClient client;

Expand Down

0 comments on commit 8902011

Please sign in to comment.