This is the codeAbility Sharing Platform! Learn more about the codeAbility Sharing Platform.

Skip to content
Snippets Groups Projects
Commit dab6ea49 authored by Michael Breu's avatar Michael Breu :speech_balloon:
Browse files

Merge remote-tracking branch 'origin/development' into 115-implement-watchlist-and-stored-searches

parents 0364ec57 8c7142ff
2 merge requests!188Merging Peer Reviewing et. al to Master,!164211 peer reviewing functionality
{ {
"home": { "home": {
"title": "<img src=\"/content/img/logo-top.png\" alt=\"codeAbility\" width=\"168px\"/>Joint Resourcing of Teaching Material", "title": "Joint Resourcing of Teaching Material",
"subtitle": "The CodeAbility Sharing Platform is ready", "subtitle": "The CodeAbility Sharing Platform is ready",
"teaser": "<p>The CodeAbility Sharing Platform offers an infrastructure for the open exchange of programming teaching content.</p>\n <p>This comprises programming exercises, lecture scripts and slides, and link collections to all aspects of programming education.</p>", "teaser": "<p>The CodeAbility Sharing Platform offers an infrastructure for the open exchange of programming teaching content.</p>\n <p>This comprises programming exercises, lecture scripts and slides, and link collections to all aspects of programming education.</p>",
"logged": { "logged": {
......
...@@ -23,7 +23,13 @@ ...@@ -23,7 +23,13 @@
<script src="content/js/popper1.16.0.min.js"></script> <script src="content/js/popper1.16.0.min.js"></script>
<!-- Latest compiled JavaScript --> <!-- Latest compiled JavaScript -->
<script src="content/js/bootstrap4.5.2.min.js"></script> <script src="content/js/bootstrap4.5.2.min.js"></script>
<script src="content/js/duplicate/katex.min.js"></script>
<script src="content/js/duplicate/joypixels.min.js"></script>
<!-- syntax highlighting currently disabled. It is too complex to be integrated on the fly -->
<!--
<script src="content/js/duplicate/prism.js"></script>
<script src="content/js/duplicate/components/prism-java.min.js"></script>
-->
<!-- jhipster-needle-add-resources-to-root - JHipster will add new resources here --> <!-- jhipster-needle-add-resources-to-root - JHipster will add new resources here -->
</head> </head>
<body> <body>
......
...@@ -16,11 +16,14 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers. ...@@ -16,11 +16,14 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
import java.io.IOException;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import javax.persistence.EntityManager; import javax.persistence.EntityManager;
import org.elasticsearch.node.NodeValidationException;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith; import org.junit.jupiter.api.extension.ExtendWith;
...@@ -39,6 +42,7 @@ import at.ac.uibk.gitsearch.GitsearchApp; ...@@ -39,6 +42,7 @@ import at.ac.uibk.gitsearch.GitsearchApp;
import at.ac.uibk.gitsearch.domain.Statistics; import at.ac.uibk.gitsearch.domain.Statistics;
import at.ac.uibk.gitsearch.repository.StatisticsRepository; import at.ac.uibk.gitsearch.repository.StatisticsRepository;
import at.ac.uibk.gitsearch.repository.search.StatisticsSearchRepository; import at.ac.uibk.gitsearch.repository.search.StatisticsSearchRepository;
import at.ac.uibk.gitsearch.repository.search.testESService.ElasticSearchTestServerConfiguration;
import at.ac.uibk.gitsearch.security.AuthoritiesConstants; import at.ac.uibk.gitsearch.security.AuthoritiesConstants;
import at.ac.uibk.gitsearch.service.StatisticsService; import at.ac.uibk.gitsearch.service.StatisticsService;
import at.ac.uibk.gitsearch.service.dto.StatisticsDTO; import at.ac.uibk.gitsearch.service.dto.StatisticsDTO;
...@@ -61,6 +65,8 @@ public class StatisticsResourceIT { ...@@ -61,6 +65,8 @@ public class StatisticsResourceIT {
private static final Long DEFAULT_EXERCISE_ID = (long) 1; private static final Long DEFAULT_EXERCISE_ID = (long) 1;
private static final Long UPDATED_EXERCISE_ID = (long) 2; private static final Long UPDATED_EXERCISE_ID = (long) 2;
final String publicGitLabProjectId = "3";
@Autowired @Autowired
private StatisticsRepository statisticsRepository; private StatisticsRepository statisticsRepository;
...@@ -88,6 +94,12 @@ public class StatisticsResourceIT { ...@@ -88,6 +94,12 @@ public class StatisticsResourceIT {
private Statistics statistics; private Statistics statistics;
@BeforeAll
public static void setUpESServer() throws IOException, NodeValidationException {
ElasticSearchTestServerConfiguration.getTestInstance().startTestNode();
}
/** /**
* Create an entity for this test. * Create an entity for this test.
* *
...@@ -316,24 +328,13 @@ public class StatisticsResourceIT { ...@@ -316,24 +328,13 @@ public class StatisticsResourceIT {
public void createStatisticsByExerciseId() throws Exception { public void createStatisticsByExerciseId() throws Exception {
// Initialize the database // Initialize the database
statisticsRepository.saveAndFlush(statistics); statisticsRepository.saveAndFlush(statistics);
// Optional<GitLabAccessInfo> accessInfo = gitLabRepository.getGitLabAccessInfo();
// GitLabApi gitlabApi = gitLabRepository.getGitLabApi(accessInfo);
// ProjectApi projectApi = gitlabApi.getProjectApi();
// Integer id = projectApi.getProjects().get(0).getId();
// Get the statistics restStatisticsMockMvc.perform(get("/api/statistics/exercise/{id}", publicGitLabProjectId).with(csrf().asHeader())).andExpect(status().isOk())
// System.out.println("My request: ##################################################################"); .andExpect(content().contentType(MediaType.APPLICATION_JSON_VALUE))
// System.out.println(restStatisticsMockMvc.perform(get("/api/statistics/exercise/{id}", 3).with(csrf().asHeader()))); .andExpect(jsonPath("$.exerciseID").value(publicGitLabProjectId));
// restStatisticsMockMvc.perform(get("/api/statistics/exercise/{id}", 3).with(csrf().asHeader())).andExpect(status().isOk())
// .andExpect(content().contentType(MediaType.APPLICATION_JSON_VALUE))
// .andExpect(jsonPath("$.exerciseID").value(3));
//assertEquals(true,gitlabService.repositoryExists("3"));
// Get the statistics and see if it coincides with the mock stats // Get the statistics and see if it is found
assertEquals(statisticsService.findOneByExerciseID(statistics.getExerciseID()).get().getExerciseID(), statistics.getExerciseID()); assertEquals(3L,statisticsService.findOneByExerciseID( 3L).get().getExerciseID());
} }
......
...@@ -12,5 +12,8 @@ ...@@ -12,5 +12,8 @@
"use-pipe-transform-interface": false, "use-pipe-transform-interface": false,
"component-class-suffix": true, "component-class-suffix": true,
"directive-class-suffix": true "directive-class-suffix": true
} },
"linterOptions": {
"exclude": ["src/main/webapp/content/js/duplicate/**/*"]
}
} }
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment