Skip to content

Commit

Permalink
More changes as per comments
Browse files Browse the repository at this point in the history
  • Loading branch information
maxcurkovic committed Nov 11, 2023
1 parent 5dac8ee commit 159a718
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
5 changes: 2 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,8 @@
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
</dependencies>

Expand Down
10 changes: 4 additions & 6 deletions src/test/java/com/opinionowl/opinionowl/APIControllerTest.java
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
package com.opinionowl.opinionowl;
import com.opinionowl.opinionowl.models.Survey;
import com.opinionowl.opinionowl.repos.*;
//import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.junit.runner.RunWith;
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.context.junit4.SpringRunner;
import org.springframework.test.web.servlet.MockMvc;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;

/**
* Test class for the post mappings in API Controller.
*/
@SpringBootTest
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@AutoConfigureMockMvc
public class APIControllerTest {
@Autowired
Expand All @@ -38,8 +35,9 @@ public void testCreateSurvey() throws Exception{
.contentType(MediaType.APPLICATION_JSON).content(postData))
.andExpect(status().isOk());

Survey survey = surveyRepository.findById(1L);
System.out.println(survey);
for (Survey survey : surveyRepository.findAll()) {
System.out.println(survey.toString());
}
}
}

0 comments on commit 159a718

Please sign in to comment.