Skip to content
Snippets Groups Projects
Commit b0227b35 authored by tranoris's avatar tranoris Committed by trantzas
Browse files

fixes to run tests in ide also. related to #41

(cherry picked from commit 113bab7c)
parent 6ff95eba
No related branches found
No related tags found
3 merge requests!36Merging 2024Q2_RC into main, creating 2024Q2 Release,!35Merging 2024Q2_RC into develop,!33fixes to run tests in ide also. related to #41
Pipeline #7021 failed
......@@ -261,6 +261,13 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>com.vaadin.external.google</groupId>
<artifactId>android-json</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
......
......@@ -76,6 +76,7 @@ import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.jdbc.AutoConfigureTestDatabase;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.http.MediaType;
......@@ -95,7 +96,7 @@ import net.minidev.json.JSONObject;
@RunWith(SpringRunner.class)
@Transactional
@SpringBootTest( webEnvironment = SpringBootTest.WebEnvironment.MOCK , classes = OpenAPISpringBoot.class)
//@AutoConfigureTestDatabase //this automatically uses h2
@AutoConfigureTestDatabase //this automatically uses h2
@AutoConfigureMockMvc
@ActiveProfiles("testing")
//@TestPropertySource(
......
......@@ -66,6 +66,7 @@ import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.jdbc.AutoConfigureTestDatabase;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.http.MediaType;
......@@ -83,7 +84,7 @@ import org.springframework.web.context.WebApplicationContext;
@RunWith(SpringRunner.class)
@Transactional
@SpringBootTest( webEnvironment = SpringBootTest.WebEnvironment.MOCK , classes = OpenAPISpringBoot.class)
//@AutoConfigureTestDatabase //this automatically uses h2
@AutoConfigureTestDatabase //this automatically uses h2
@AutoConfigureMockMvc
@ActiveProfiles("testing")
//@TestPropertySource(
......
......@@ -17,6 +17,7 @@ import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.jdbc.AutoConfigureTestDatabase;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.http.HttpStatus;
......@@ -51,7 +52,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
@RunWith(SpringRunner.class)
@Transactional
@SpringBootTest( webEnvironment = SpringBootTest.WebEnvironment.MOCK , classes = OpenAPISpringBoot.class)
//@AutoConfigureTestDatabase //this automatically uses h2
@AutoConfigureTestDatabase //this automatically uses h2
@AutoConfigureMockMvc
@ActiveProfiles("testing")
//@TestPropertySource(
......
......@@ -446,7 +446,8 @@ public class ServiceSpecificationRepoServiceTest {
alias = v.getAlias();
assertEquals("PrimitivesList", serviceSpecCharacteristic.getName());
assertEquals("{\"vnfs\":[{\"config-primitive\":[{\"parameter\":[{\"name\":\"filename\",\"data-type\":\"STRING\"}],\"name\":\"run-touch-command\"}],\"id\":\"vnf1\",\"vdu-configs\":[{\"config-primitive\":[{\"parameter\":[{\"name\":\"filename\",\"data-type\":\"STRING\"}],\"name\":\"run-touch-command\"}],\"id\":\"vdu1\"},{\"config-primitive\":[{\"parameter\":[{\"name\":\"filename\",\"data-type\":\"STRING\"}],\"name\":\"run-touch-command\"}],\"id\":\"vdu2\"}]},{\"config-primitive\":[{\"parameter\":[{\"name\":\"filename\",\"data-type\":\"STRING\"}],\"name\":\"run-touch-command\"}],\"id\":\"vnf2\",\"vdu-configs\":[{\"config-primitive\":[{\"parameter\":[{\"name\":\"filename\",\"data-type\":\"STRING\"}],\"name\":\"run-touch-command\"}],\"id\":\"vdu1\"},{\"config-primitive\":[{\"parameter\":[{\"name\":\"filename\",\"data-type\":\"STRING\"}],\"name\":\"run-touch-command\"}],\"id\":\"vdu2\"}]}]}", value);
// assertEquals("{\"vnfs\":[{\"config-primitive\":[{\"parameter\":[{\"name\":\"filename\",\"data-type\":\"STRING\"}],\"name\":\"run-touch-command\"}],\"id\":\"vnf1\",\"vdu-configs\":[{\"config-primitive\":[{\"parameter\":[{\"name\":\"filename\",\"data-type\":\"STRING\"}],\"name\":\"run-touch-command\"}],\"id\":\"vdu1\"},{\"config-primitive\":[{\"parameter\":[{\"name\":\"filename\",\"data-type\":\"STRING\"}],\"name\":\"run-touch-command\"}],\"id\":\"vdu2\"}]},{\"config-primitive\":[{\"parameter\":[{\"name\":\"filename\",\"data-type\":\"STRING\"}],\"name\":\"run-touch-command\"}],\"id\":\"vnf2\",\"vdu-configs\":[{\"config-primitive\":[{\"parameter\":[{\"name\":\"filename\",\"data-type\":\"STRING\"}],\"name\":\"run-touch-command\"}],\"id\":\"vdu1\"},{\"config-primitive\":[{\"parameter\":[{\"name\":\"filename\",\"data-type\":\"STRING\"}],\"name\":\"run-touch-command\"}],\"id\":\"vdu2\"}]}]}", value);
assertEquals("{\"vnfs\":[{\"config-primitive\":[{\"name\":\"run-touch-command\",\"parameter\":[{\"name\":\"filename\",\"data-type\":\"STRING\"}]}],\"id\":\"vnf1\",\"vdu-configs\":[{\"config-primitive\":[{\"name\":\"run-touch-command\",\"parameter\":[{\"name\":\"filename\",\"data-type\":\"STRING\"}]}],\"id\":\"vdu1\"},{\"config-primitive\":[{\"name\":\"run-touch-command\",\"parameter\":[{\"name\":\"filename\",\"data-type\":\"STRING\"}]}],\"id\":\"vdu2\"}]},{\"config-primitive\":[{\"name\":\"run-touch-command\",\"parameter\":[{\"name\":\"filename\",\"data-type\":\"STRING\"}]}],\"id\":\"vnf2\",\"vdu-configs\":[{\"config-primitive\":[{\"name\":\"run-touch-command\",\"parameter\":[{\"name\":\"filename\",\"data-type\":\"STRING\"}]}],\"id\":\"vdu1\"},{\"config-primitive\":[{\"name\":\"run-touch-command\",\"parameter\":[{\"name\":\"filename\",\"data-type\":\"STRING\"}]}],\"id\":\"vdu2\"}]}]}", value);
assertEquals("", alias);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment