Skip to content

Commit

Permalink
fix: moog test (add authentication)
Browse files Browse the repository at this point in the history
  • Loading branch information
BettyB979 committed Jul 10, 2024
1 parent 98f8f25 commit 3f0e95d
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import fr.insee.survey.datacollectionmanagement.config.AuthenticationUserProvider;
import fr.insee.survey.datacollectionmanagement.config.auth.user.AuthorityRoleEnum;
import fr.insee.survey.datacollectionmanagement.constants.Constants;

import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
Expand All @@ -26,6 +26,11 @@ class MoogControllerTest {

@Autowired
MockMvc mockMvc;
@BeforeEach
void init() {
SecurityContextHolder.getContext().setAuthentication(AuthenticationUserProvider.getAuthenticatedUser("test", AuthorityRoleEnum.ADMIN));
}


@Test
void getMoogReadOnlyUrl() throws Exception {
Expand Down

0 comments on commit 3f0e95d

Please sign in to comment.