|
|
@@ -7,12 +7,6 @@ import com.moekr.moocoder.web.dto.CodeDTO;
|
|
|
import org.junit.jupiter.api.Test;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.boot.test.context.SpringBootTest;
|
|
|
-import org.springframework.mock.web.MockMultipartFile;
|
|
|
-import org.springframework.web.multipart.MultipartFile;
|
|
|
-
|
|
|
-import java.io.File;
|
|
|
-import java.io.FileInputStream;
|
|
|
-import java.io.IOException;
|
|
|
|
|
|
import static org.junit.jupiter.api.Assertions.assertFalse;
|
|
|
import static org.junit.jupiter.api.Assertions.assertTrue;
|
|
|
@@ -42,23 +36,6 @@ class ProjectServiceImplTest {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- @Test
|
|
|
- void addProject() throws IOException {
|
|
|
- ProjectService projectService = new ProjectServiceImpl(null, null, null);
|
|
|
- File f = new File(getClass().getResource("/wala/jar/walawork.zip").getFile());
|
|
|
- try (FileInputStream inputStream = new FileInputStream(f)) {
|
|
|
- MultipartFile zipFile = new MockMultipartFile("walawork", "walawork.zip", "binary", inputStream);
|
|
|
- assertTrue(projectService.addProject("walawork", zipFile));
|
|
|
- }
|
|
|
-
|
|
|
- f = new File(getClass().getResource("/wala/jar/ui.zip").getFile());
|
|
|
- try (FileInputStream inputStream = new FileInputStream(f)) {
|
|
|
- MultipartFile zipFile = new MockMultipartFile("ui", "ui.zip", "binary", inputStream);
|
|
|
- assertTrue(projectService.addProject("ui", zipFile));
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
@Test
|
|
|
void containsProject() {
|
|
|
ProjectService projectService = new ProjectServiceImpl(null, null, null);
|