From 086b805ba9be0dbaef3fd0cc25d714eb31008ef4 Mon Sep 17 00:00:00 2001
From: evilimkova <evilimkova@onpointserv.com>
Date: Wed, 29 Mar 2023 15:40:58 +0200
Subject: [PATCH] Delete old tests

---
 ...CertificateCertificateControllerTests.java | 66 -------------------
 1 file changed, 66 deletions(-)
 delete mode 100644 application/module-certificate/src/test/java/org/fuseri/modulecertificate/ModuleCertificateCertificateControllerTests.java

diff --git a/application/module-certificate/src/test/java/org/fuseri/modulecertificate/ModuleCertificateCertificateControllerTests.java b/application/module-certificate/src/test/java/org/fuseri/modulecertificate/ModuleCertificateCertificateControllerTests.java
deleted file mode 100644
index 16a08fc3..00000000
--- a/application/module-certificate/src/test/java/org/fuseri/modulecertificate/ModuleCertificateCertificateControllerTests.java
+++ /dev/null
@@ -1,66 +0,0 @@
-package org.fuseri.modulecertificate;
-
-import com.fasterxml.jackson.databind.ObjectMapper;
-import org.fuseri.model.dto.certificate.CertificateCreateDto;
-import org.fuseri.model.dto.certificate.CertificateDto;
-import org.fuseri.model.dto.course.CourseDto;
-import org.fuseri.model.dto.course.LanguageTypeDto;
-import org.fuseri.model.dto.course.ProficiencyLevelDto;
-import org.fuseri.model.dto.user.AddressDto;
-import org.fuseri.model.dto.user.UserDto;
-import org.fuseri.modulecertificate.service.CertificateController;
-import org.junit.jupiter.api.Test;
-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.http.MediaType;
-import org.springframework.test.web.servlet.MockMvc;
-
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.*;
-import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*;
-import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
-
-
-@SpringBootTest
-@AutoConfigureMockMvc
-class ModuleCertificateCertificateControllerTests {
-
-    @Autowired
-    private MockMvc mockMvc;
-
-    @Autowired
-    ObjectMapper objectMapper;
-
-    @Test
-    void generateCertificate() throws Exception {
-        CertificateDto expectedResponse = new CertificateDto();
-        String response = mockMvc.perform(post("/certificates/generate")
-                .content(asJsonString(new CertificateCreateDto(
-                        new UserDto("novakovat","novakova@gamil.com", "Tereza",
-                                "Nováková", new AddressDto()),
-                        new CourseDto("AJ1", 10, LanguageTypeDto.ENGLISH, ProficiencyLevelDto.A1))))
-                .contentType(MediaType.APPLICATION_JSON))
-                .andExpect(status().isOk())
-                .andReturn().getResponse().getContentAsString();
-        CertificateController certificateController = objectMapper.readValue(response, CertificateController.class);
-        assertThat("response", certificateController.find(0L), is(instanceOf(expectedResponse.getClass())));
-    }
-
-
-    @Test
-    void deleteCertificate() throws Exception {
-        String response = mockMvc.perform(delete("/certificates/delete")
-                            .param("id", "1"))
-                            .andExpect(status().isOk())
-                            .andReturn().getResponse().getContentAsString();
-    }
-
-    public static String asJsonString(final Object obj) {
-        try {
-            return new ObjectMapper().writeValueAsString(obj);
-        } catch (Exception e) {
-            throw new RuntimeException(e);
-        }
-    }
-}
-- 
GitLab