Skip to content
Snippets Groups Projects
Commit 0c7741b8 authored by OZGCloud's avatar OZGCloud
Browse files

ORG-1918 Test aktualisiert of GridFs-Strecke

parent 8b9933eb
No related branches found
No related tags found
No related merge requests found
...@@ -11,7 +11,6 @@ import java.util.List; ...@@ -11,7 +11,6 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.mockito.Mock; import org.mockito.Mock;
...@@ -29,8 +28,7 @@ import org.springframework.test.web.servlet.ResultActions; ...@@ -29,8 +28,7 @@ import org.springframework.test.web.servlet.ResultActions;
import de.itvsh.goofy.common.downloadtoken.DownloadTokenController; import de.itvsh.goofy.common.downloadtoken.DownloadTokenController;
import de.itvsh.goofy.common.downloadtoken.DownloadTokenProperties; import de.itvsh.goofy.common.downloadtoken.DownloadTokenProperties;
import de.itvsh.goofy.common.downloadtoken.DownloadTokenTestFactory; import de.itvsh.goofy.common.downloadtoken.DownloadTokenTestFactory;
import de.itvsh.goofy.common.file.OzgFileDataTestFactory; import de.itvsh.goofy.common.file.OzgFileTestFactory;
import de.itvsh.goofy.common.file.OzgFileService;
import de.itvsh.goofy.common.user.UserTestFactory; import de.itvsh.goofy.common.user.UserTestFactory;
import io.jsonwebtoken.JwtBuilder; import io.jsonwebtoken.JwtBuilder;
...@@ -42,7 +40,7 @@ class BinaryFileControllerITCase { ...@@ -42,7 +40,7 @@ class BinaryFileControllerITCase {
@SpyBean @SpyBean
private BinaryFileController controller; private BinaryFileController controller;
@MockBean @MockBean
private OzgFileService service; private BinaryFileService service;
@Autowired @Autowired
private MockMvc mockMvc; private MockMvc mockMvc;
@Autowired @Autowired
...@@ -58,7 +56,7 @@ class BinaryFileControllerITCase { ...@@ -58,7 +56,7 @@ class BinaryFileControllerITCase {
@BeforeEach @BeforeEach
void init() { void init() {
when(service.getOzgFileData(any())).thenReturn(OzgFileDataTestFactory.create()); when(service.getFile(any())).thenReturn(OzgFileTestFactory.create());
} }
@Test @Test
...@@ -75,7 +73,6 @@ class BinaryFileControllerITCase { ...@@ -75,7 +73,6 @@ class BinaryFileControllerITCase {
performRequest().andExpect(status().isForbidden()); performRequest().andExpect(status().isForbidden());
} }
@Disabled("OZG-2268 FIXME")
@Test @Test
void shouldGetFile() throws Exception { void shouldGetFile() throws Exception {
setTokenToSecuriyContext(tokenBuilder.addClaims(createClaims(fileId)).compact()); setTokenToSecuriyContext(tokenBuilder.addClaims(createClaims(fileId)).compact());
...@@ -105,7 +102,7 @@ class BinaryFileControllerITCase { ...@@ -105,7 +102,7 @@ class BinaryFileControllerITCase {
@BeforeEach @BeforeEach
void init() { void init() {
when(service.getOzgFileData(any())).thenReturn(OzgFileDataTestFactory.create()); when(service.getFile(any())).thenReturn(OzgFileTestFactory.create());
SecurityContextHolder.getContext().setAuthentication(authentication); SecurityContextHolder.getContext().setAuthentication(authentication);
} }
...@@ -116,7 +113,6 @@ class BinaryFileControllerITCase { ...@@ -116,7 +113,6 @@ class BinaryFileControllerITCase {
performRequest().andExpect(status().isUnauthorized()); performRequest().andExpect(status().isUnauthorized());
} }
@Disabled("OZG-2268 FIXME")
@Test @Test
void shouldGetFile() throws Exception { void shouldGetFile() throws Exception {
when(authentication.isAuthenticated()).thenReturn(Boolean.TRUE); when(authentication.isAuthenticated()).thenReturn(Boolean.TRUE);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment