Skip to content

Commit

Permalink
#41 Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
KaylaCharky committed Dec 7, 2020
1 parent d2384cb commit f22f9d5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -1,21 +1,14 @@
package smarthomesimulator;

import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ui.ModelMap;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import smarthomesimulator.model.*;

import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.List;
import java.util.Map;
import java.util.ArrayList;
Expand Down Expand Up @@ -422,6 +415,4 @@ public Simulator getTemps(){
Simulator sim = simulatorMap.get(0);
return sim;
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ public ModelAndView showForm() {
}

@RequestMapping(value = "/simulator", method = {RequestMethod.GET, RequestMethod.POST})
public String submit(@Validated @ModelAttribute("simulator") Simulator simulator, @Validated @ModelAttribute("profile") Profile profile, @Validated @ModelAttribute("shp") SHP shp,
BindingResult result, ModelMap model, @RequestParam("file") String fileName) {
public String simulator(@Validated @ModelAttribute("simulator") Simulator simulator, @Validated @ModelAttribute("profile") Profile profile, @Validated @ModelAttribute("shp") SHP shp,
BindingResult result, ModelMap model, @RequestParam("file") String fileName) {
if (result.hasErrors()) {
return "error";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ void openCloseWindowsTest() {
}

@Test
void getBlockedDoors() {
void blockingDoorsTest() {
room.setBlockedDoors(1);
Assertions.assertEquals(room.getBlockedDoors(), 1);
}

@Test
void getBlockedWindows() {
void blockingWindowsTest() {
room.setBlockedWindows(1);
Assertions.assertEquals(room.getBlockedWindows(), 1);
}
Expand Down

0 comments on commit f22f9d5

Please sign in to comment.