Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;

import org.eclipse.dirigible.components.engine.javascript.service.JavascriptService;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.webmvc.test.autoconfigure.AutoConfigureMockMvc;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.security.test.context.support.WithMockUser;
Expand All @@ -33,14 +34,17 @@
@ComponentScan(basePackages = {"org.eclipse.dirigible.components.*"})
public class CoreSuiteTest {

@Autowired
protected WebApplicationContext wac;
@Autowired
private JavascriptService javascriptService;

@Autowired
private MockMvc mockMvc;

@Autowired
protected WebApplicationContext wac;

@SpringBootApplication
static class TestConfiguration {
}

@Test
public void executeConfigurationGetTest() throws Exception {
Expand Down Expand Up @@ -89,8 +93,4 @@ public void executeDestinationsGetTest() throws Exception {
.andDo(print())
.andExpect(status().is2xxSuccessful());
}

@SpringBootApplication
static class TestConfiguration {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.webmvc.test.autoconfigure.AutoConfigureMockMvc;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.security.test.context.support.WithMockUser;
Expand All @@ -45,24 +45,28 @@
@TestInstance(Lifecycle.PER_CLASS)
public class DatabaseSuiteTest {

/** The wac. */
@Autowired
protected WebApplicationContext wac;
/** The datasource repository. */
@Autowired
private DataSourceRepository datasourceRepository;

@Autowired
private DataSourcesManager datasourcesManager;

/** The javascript service. */
@Autowired
private JavascriptService javascriptService;

/** The mock mvc. */
@Autowired
private MockMvc mockMvc;

/** The wac. */
@Autowired
protected WebApplicationContext wac;

/**
* The Class TestConfiguration.
*/
@SpringBootApplication
static class TestConfiguration {
}

/**
* Setup.
Expand Down Expand Up @@ -123,12 +127,4 @@ public void executeUpdateTest() throws Exception {
public void executeSequenceTest() throws Exception {
javascriptService.handleRequest("db-tests", "sequence-nextval.js", null, null, false);
}


/**
* The Class TestConfiguration.
*/
@SpringBootApplication
static class TestConfiguration {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
import org.eclipse.dirigible.components.base.tenant.TenantContext;
import org.mockito.Mockito;
import org.springframework.boot.test.context.TestConfiguration;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.context.annotation.Bean;
import org.springframework.test.context.bean.override.mockito.MockitoBean;

import static org.mockito.Mockito.when;

@TestConfiguration
public class TestConfig {

@MockBean
@MockitoBean
@DefaultTenant
private Tenant defaultTenant;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import org.junit.jupiter.api.TestInstance;
import org.junit.jupiter.api.extension.ExtendWith;
import org.junit.jupiter.api.extension.RegisterExtension;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.webmvc.test.autoconfigure.AutoConfigureMockMvc;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.security.test.context.support.WithMockUser;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.webmvc.test.autoconfigure.AutoConfigureMockMvc;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.security.test.context.support.WithMockUser;
Expand All @@ -39,20 +39,21 @@
@ComponentScan(basePackages = {"org.eclipse.dirigible.components.*"})
public class ExtensionsSuiteTest {

@Autowired
protected WebApplicationContext wac;
@Autowired
private ExtensionPointRepository extensionPointRepository;

@Autowired
private ExtensionRepository extensionRepository;

@Autowired
private JavascriptService javascriptService;

@Autowired
private MockMvc mockMvc;

@Autowired
protected WebApplicationContext wac;

@SpringBootApplication
static class TestConfiguration {
}

@BeforeEach
public void setup() throws Exception {
Expand All @@ -72,6 +73,16 @@ public void cleanup() throws Exception {
extensionRepository.deleteAll();
}

public static ExtensionPoint createExtensionPoint(String location, String name, String description) {
ExtensionPoint extensionPoint = new ExtensionPoint(location, name, description);
return extensionPoint;
}

public static Extension createExtension(String location, String name, String description, String extensionPoint, String module) {
Extension extension = new Extension(location, name, description, extensionPoint, module, null);
return extension;
}

@Test
public void executeExtensionsTest() throws Exception {
javascriptService.handleRequest("extensions-tests", "extensions-get-extension-points.js", null, null, false);
Expand All @@ -87,18 +98,4 @@ public void executeExtensionsMockTest() throws Exception {
.andDo(print())
.andExpect(status().is2xxSuccessful());
}

public static ExtensionPoint createExtensionPoint(String location, String name, String description) {
ExtensionPoint extensionPoint = new ExtensionPoint(location, name, description);
return extensionPoint;
}

public static Extension createExtension(String location, String name, String description, String extensionPoint, String module) {
Extension extension = new Extension(location, name, description, extensionPoint, module, null);
return extension;
}

@SpringBootApplication
static class TestConfiguration {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
import org.junit.jupiter.api.TestInstance.Lifecycle;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.webmvc.test.autoconfigure.AutoConfigureMockMvc;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.security.test.context.support.WithMockUser;
Expand All @@ -53,23 +53,23 @@
@TestInstance(Lifecycle.PER_CLASS)
public class GitFacadeTest {

/** The gson. */
private final Gson gson = new Gson();
/** The username. */
private String username = "dirigible";

/** The email. */
private String email = "dirigible@eclipse.com";

/** The project name. */
private String projectName = "project1";

/** The workspace name. */
private String workspaceName = "workspace";

/** The repository. */
private String repository = "project1-repo";

/** The gson. */
private final Gson gson = new Gson();

@SpringBootApplication
static class TestConfiguration {
}

/**
* Test init repository and commit.
Expand Down Expand Up @@ -126,9 +126,5 @@ private void assertProjectJsonExists(Project project) {
assertEquals(1, parsedProjectJsonContent.size());
}

@SpringBootApplication
static class TestConfiguration {
}

}

Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.webmvc.test.autoconfigure.AutoConfigureMockMvc;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.security.test.context.support.WithMockUser;
Expand All @@ -32,21 +32,20 @@
@TestInstance(Lifecycle.PER_CLASS)
public class GitSuiteTest {

@Autowired
protected WebApplicationContext wac;
@Autowired
private JavascriptService javascriptService;

@Autowired
private MockMvc mockMvc;

@Autowired
protected WebApplicationContext wac;

@SpringBootApplication
static class TestConfiguration {
}

@Test
public void executeGitTest() throws Exception {
javascriptService.handleRequest("git-tests", "git-local.js", null, null, false);
}

@SpringBootApplication
static class TestConfiguration {
}
}
Loading
Loading