@Test public void failedXmlConversionShouldReturnConversionError(@Capturing TimTransmogrifier capturingTimTransmogrifier) throws XmlUtilsException, JsonUtilsException { new Expectations() { { TimTransmogrifier.convertToXml((DdsAdvisorySituationData) any, (ObjectNode) any, (OdeMsgMetadata) any, (SerialId) any); result = new XmlUtilsException("testException123", null); } }; ResponseEntity<String> actualResponse = testTimDepositController.postTim( "{\"request\":{\"rsus\":[],\"snmp\":{}},\"tim\":{\"msgCnt\":\"13\",\"timeStamp\":\"2017-03-13T01:07:11-05:00\"}}"); assertEquals("{\"error\":\"Error sending data to ASN.1 Encoder module: testException123\"}", actualResponse.getBody()); }
@PostMapping(value = "/tim", produces = "application/json") @CrossOrigin public ResponseEntity<String> postTim(@RequestBody String jsonString) { return depositTim(jsonString, ServiceRequest.OdeInternal.RequestVerb.POST); }
TimDepositController { @PostMapping(value = "/tim", produces = "application/json") @CrossOrigin public ResponseEntity<String> postTim(@RequestBody String jsonString) { return depositTim(jsonString, ServiceRequest.OdeInternal.RequestVerb.POST); } }
TimDepositController { @PostMapping(value = "/tim", produces = "application/json") @CrossOrigin public ResponseEntity<String> postTim(@RequestBody String jsonString) { return depositTim(jsonString, ServiceRequest.OdeInternal.RequestVerb.POST); } @Autowired  TimDepositController(OdeProperties odeProperties); }
TimDepositController { @PostMapping(value = "/tim", produces = "application/json") @CrossOrigin public ResponseEntity<String> postTim(@RequestBody String jsonString) { return depositTim(jsonString, ServiceRequest.OdeInternal.RequestVerb.POST); } @Autowired  TimDepositController(OdeProperties odeProperties); synchronized ResponseEntity<String> depositTim(String jsonString, RequestVerb verb); @PutMapping(value = "/tim", produces = "application/json") @CrossOrigin ResponseEntity<String> putTim(@RequestBody String jsonString); @PostMapping(value = "/tim", produces = "application/json") @CrossOrigin ResponseEntity<String> postTim(@RequestBody String jsonString); }
TimDepositController { @PostMapping(value = "/tim", produces = "application/json") @CrossOrigin public ResponseEntity<String> postTim(@RequestBody String jsonString) { return depositTim(jsonString, ServiceRequest.OdeInternal.RequestVerb.POST); } @Autowired  TimDepositController(OdeProperties odeProperties); synchronized ResponseEntity<String> depositTim(String jsonString, RequestVerb verb); @PutMapping(value = "/tim", produces = "application/json") @CrossOrigin ResponseEntity<String> putTim(@RequestBody String jsonString); @PostMapping(value = "/tim", produces = "application/json") @CrossOrigin ResponseEntity<String> postTim(@RequestBody String jsonString);  }