Skip to content

Commit

Permalink
Fix UploadControllerTest
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanjdew committed Apr 13, 2022
1 parent 089704a commit 13ddbc6
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ public void setup() throws IOException {

@Test
void upload() throws Exception {
mockMvc.perform(buildUpload(UPLOAD_URL, new MockMultipartFile("file", "my-wacky-file.csv", "text/csv", getResourceStream("data/my-wacky-file.csv")))
mockMvc.perform(buildUpload(UPLOAD_URL, new MockMultipartFile("files", "my-wacky-file.csv", "text/csv", getResourceStream("data/my-wacky-file.csv")))
.param("collection", "my-wacky-file.csv")
.param("database", "staging"))
.andExpect(status().isUnauthorized());

registerAccount();
login();

mockMvc.perform(buildUpload(UPLOAD_URL, new MockMultipartFile("file", "my-wacky-file.csv", "text/csv", getResourceStream("data/my-wacky-file.csv")))
mockMvc.perform(buildUpload(UPLOAD_URL, new MockMultipartFile("files", "my-wacky-file.csv", "text/csv", getResourceStream("data/my-wacky-file.csv")))
.param("collection", "my-wacky-file.csv")
.param("database", "staging"))
.andExpect(status().isOk());
Expand All @@ -44,7 +44,7 @@ void upload() throws Exception {

reset(uploadService);

mockMvc.perform(buildUpload(UPLOAD_URL, new MockMultipartFile("file", "my file with spaces.csv", "text/csv", getResourceStream("data/my-wacky-file.csv")))
mockMvc.perform(buildUpload(UPLOAD_URL, new MockMultipartFile("files", "my file with spaces.csv", "text/csv", getResourceStream("data/my-wacky-file.csv")))
.param("collection", "MyCollection")
.param("database", "staging"))
.andExpect(status().isOk());
Expand Down

0 comments on commit 13ddbc6

Please sign in to comment.