Skip to content

Commit

Permalink
Apply spotless
Browse files Browse the repository at this point in the history
  • Loading branch information
johanah29 committed Nov 4, 2024
1 parent fc71207 commit f70f5e3
Showing 1 changed file with 17 additions and 33 deletions.
50 changes: 17 additions & 33 deletions openbas-api/src/test/java/io/openbas/rest/InjectApiTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,11 @@
import jakarta.mail.Session;
import jakarta.mail.internet.MimeMessage;
import jakarta.servlet.ServletException;

import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.time.Instant;
import java.util.List;

import org.junit.jupiter.api.*;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.ArgumentCaptor;
Expand Down Expand Up @@ -70,36 +68,21 @@ class InjectApiTest extends IntegrationTest {
static Team TEAM;
static String SCENARIO_INJECT_ID;

@Autowired
private MockMvc mvc;
@Autowired
private ScenarioService scenarioService;
@Autowired
private ExerciseService exerciseService;
@Autowired
private ExerciseRepository exerciseRepository;
@SpyBean
private Executor executor;
@Autowired
private ScenarioRepository scenarioRepository;
@Autowired
private InjectRepository injectRepository;
@Autowired
private DocumentRepository documentRepository;
@Autowired
private CommunicationRepository communicationRepository;
@Autowired
private InjectExpectationRepository injectExpectationRepository;
@Autowired
private TeamRepository teamRepository;
@Autowired
private InjectorContractRepository injectorContractRepository;
@Autowired
private UserRepository userRepository;
@Resource
private ObjectMapper objectMapper;
@MockBean
private JavaMailSender javaMailSender;
@Autowired private MockMvc mvc;
@Autowired private ScenarioService scenarioService;
@Autowired private ExerciseService exerciseService;
@Autowired private ExerciseRepository exerciseRepository;
@SpyBean private Executor executor;
@Autowired private ScenarioRepository scenarioRepository;
@Autowired private InjectRepository injectRepository;
@Autowired private DocumentRepository documentRepository;
@Autowired private CommunicationRepository communicationRepository;
@Autowired private InjectExpectationRepository injectExpectationRepository;
@Autowired private TeamRepository teamRepository;
@Autowired private InjectorContractRepository injectorContractRepository;
@Autowired private UserRepository userRepository;
@Resource private ObjectMapper objectMapper;
@MockBean private JavaMailSender javaMailSender;

@BeforeAll
void beforeAll() {
Expand Down Expand Up @@ -419,7 +402,8 @@ void executeEmailInjectForExerciseTest() throws Exception {
new MockMultipartFile("file", "my-awesome-file.xls", "application/xlsx", in.readAllBytes());

// Mock the behavior of JavaMailSender
ArgumentCaptor<MimeMessage> mimeMessageArgumentCaptor = ArgumentCaptor.forClass(MimeMessage.class);
ArgumentCaptor<MimeMessage> mimeMessageArgumentCaptor =
ArgumentCaptor.forClass(MimeMessage.class);
doNothing().when(javaMailSender).send(ArgumentMatchers.any(SimpleMailMessage.class));
when(javaMailSender.createMimeMessage()).thenReturn(new MimeMessage((Session) null));

Expand Down

0 comments on commit f70f5e3

Please sign in to comment.