Skip to content

Commit

Permalink
refactoring code
Browse files Browse the repository at this point in the history
  • Loading branch information
juliusbrehme committed Oct 21, 2023
1 parent cae498c commit 42fcfbf
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 12 deletions.
17 changes: 5 additions & 12 deletions api/src/test/java/com/algoverse/api/ApiApplicationTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
/**
* Test class to test if the API is working.
*/
@SuppressWarnings("unused")
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
class ApiApplicationTests {

Expand All @@ -32,11 +33,9 @@ public void contextLoads() {

/**
* Tests if a get request can be made for path finding and if a response is generated.
*
* @throws Exception Exception
*/
@Test
public void pathFindingTest() throws Exception {
public void pathFindingTest() {
String result = restTemplate.getForObject("http://localhost:" + port
+ "/pathfinding/findpath?startpoint=0,0&endpoint=4,4&size=5,5&strategy=DIJKSTRA",
String.class);
Expand All @@ -46,11 +45,9 @@ public void pathFindingTest() throws Exception {

/**
* Tests if a get request can be made for creating random nodes and if a response is generated.
*
* @throws Exception Exception
*/
@Test
public void createRandomNodeTest() throws Exception {
public void createRandomNodeTest() {
String result = restTemplate.getForObject("http://localhost:" + port
+ "/pathfinding/random-nodes?size=2,1", String.class);

Expand All @@ -59,11 +56,9 @@ public void createRandomNodeTest() throws Exception {

/**
* Tests if a get request can be made for sorting and if a response is generated.
*
* @throws Exception Exception
*/
@Test
public void sortTest() throws Exception {
public void sortTest() {
String result = restTemplate.getForObject("http://localhost:" + port
+ "/sorting/sort?toSort=3,2,1&strategy=selectionsort", String.class);

Expand All @@ -73,11 +68,9 @@ public void sortTest() throws Exception {

/**
* Tests if a get request can be made for creating a random array and if a response is generated.
*
* @throws Exception Exception
*/
@Test
public void createRandomNumbersTest() throws Exception {
public void createRandomNumbersTest() {
String result = restTemplate.getForObject("http://localhost:" + port
+ "/sorting/random-numbers?size=10", String.class);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
/**
* Class to test the api get request.
*/
@SuppressWarnings("unused")
@WebMvcTest(controllers = PathFindingController.class)
public class PathFindingControllerTest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
/**
* Test the calls to the sorting controller.
*/
@SuppressWarnings("unused")
@WebMvcTest(controllers = SortingController.class)
public class SortingControllerTest {

Expand Down

0 comments on commit 42fcfbf

Please sign in to comment.