Skip to content

Commit

Permalink
- Mer test endringer
Browse files Browse the repository at this point in the history
#deploy-test-dolly-backend
  • Loading branch information
stigus committed Jan 10, 2025
1 parent 6cba3f8 commit f8bcac3
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 42 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import no.nav.dolly.repository.BrukerRepository;
import no.nav.dolly.repository.IdentRepository;
import no.nav.dolly.repository.TestgruppeRepository;
import org.flywaydb.core.Flyway;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.extension.ExtendWith;
Expand All @@ -20,7 +19,6 @@
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.bean.override.mockito.MockitoBean;
import org.springframework.test.context.junit.jupiter.SpringExtension;
import org.testcontainers.junit.jupiter.Testcontainers;

import java.time.LocalDate;
import java.util.Optional;
Expand All @@ -33,7 +31,6 @@
@SpringBootTest(webEnvironment = RANDOM_PORT)
@ExtendWith(SpringExtension.class)
@ActiveProfiles("test")
@Testcontainers(disabledWithoutDocker = true)
@AutoConfigureMockMvc(addFilters = false)
@AutoConfigureWireMock(port = 0)
public abstract class AbstractControllerTest {
Expand All @@ -44,8 +41,6 @@ public abstract class AbstractControllerTest {
private TestgruppeRepository testgruppeRepository;
@Autowired
private IdentRepository identRepository;
@Autowired
private Flyway flyway;

@MockitoBean
@SuppressWarnings("unused")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.web.client.TestRestTemplate;
import org.springframework.data.elasticsearch.core.ElasticsearchOperations;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.bean.override.mockito.MockitoBean;
Expand Down Expand Up @@ -76,9 +75,6 @@ class MalBestillingControllerTest {
@Autowired
private MockMvc mockMvc;

@Autowired
private TestRestTemplate restTemplate;

@Autowired
private BestillingMalRepository bestillingMalRepository;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,8 @@ void createBestilling()
.build())
.build())
.build();
mockMvc
.perform(

mockMvc.perform(
post("/api/v1/gruppe/{gruppeId}/bestilling", testgruppe.getId())
.contentType(APPLICATION_JSON)
.content(objectMapper.writeValueAsString(bestilling)))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import no.nav.dolly.repository.OrganisasjonBestillingMalRepository;
import no.nav.dolly.repository.OrganisasjonBestillingRepository;
import no.nav.testnav.libs.servletsecurity.exchange.AzureAdTokenService;
import org.flywaydb.core.Flyway;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.DisplayName;
Expand All @@ -25,8 +24,6 @@
import org.springframework.test.context.bean.override.mockito.MockitoBean;
import org.springframework.test.context.junit.jupiter.SpringExtension;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.transaction.annotation.Transactional;
import org.testcontainers.junit.jupiter.Testcontainers;

import java.time.LocalDateTime;

Expand All @@ -45,7 +42,6 @@
)
@ExtendWith(SpringExtension.class)
@ActiveProfiles("test")
@Testcontainers(disabledWithoutDocker = true)
@AutoConfigureMockMvc(addFilters = false)
@AutoConfigureWireMock(port = 0)
class OrganisasjonMalBestillingServiceTest {
Expand Down Expand Up @@ -86,13 +82,9 @@ class OrganisasjonMalBestillingServiceTest {
private OrganisasjonBestillingRepository organisasjonBestillingRepository;
@Autowired
private BrukerRepository brukerRepository;
@Autowired
private Flyway flyway;

@BeforeEach
@Transactional
public void beforeEach() {
flyway.migrate();
saveDummyBruker(DUMMY_EN);
saveDummyBruker(DUMMY_TO);
MockedJwtAuthenticationTokenUtils.setJwtAuthenticationToken();
Expand Down
3 changes: 0 additions & 3 deletions apps/dolly-backend/src/test/resources/application-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,6 @@ management:
include: none

spring:
jpa:
hibernate:
ddl-auto: create
cloud:
gcp:
secretmanager:
Expand Down

0 comments on commit f8bcac3

Please sign in to comment.