spring

    1熱度

    2回答

    我試圖嘲笑jdbcTemplate拋出異常。 我試圖拋出異常此方法上的JdbcTemplate <T> List<T> query(String sql, Object[] args, RowMapper<T> rowMapper) 這裏是我有什麼 @MockBean JdbcTemplate jdbcTemplate; Mockito.doThrow(exception).when(jdb

    0熱度

    1回答

    我想弄清楚我應該爲我的項目圖層做什麼類型的測試。 我已經做了Controller-> Service-> DAO項目模型。 所以我需要用單元測試和集成測試來測試DAO層? 和單元測試和集成測試的控制器? 我只是想知道它是如何以專業的方式完成的,代碼不會超載:)也許有人有任何鏈接到我的情況單元測試和集成測試?

    0熱度

    1回答

    在春季啓動1.5.4我有一個請求映射這樣的: @RequestMapping(value = "/graph/{graphId}/details/{iri:.+}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) @Timed public JSONObject

    1熱度

    1回答

    我試圖用Spring後端和AngularJS前端製作單頁應用程序。我遵循教程並查找了類似的問題,但ngRoute似乎不適用於Spring後端(我得到它與NodeJS後端一起工作)。 的index.html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"/> <title>Spring Demo</

    0熱度

    2回答

    我們有一個Spring引導REST應用程序,它具有GET和POST方法的API。我們很少有響應消息需要根據GET和POST參數「locale」進行國際化。在GET的情況下,語言環境將作爲查詢參數傳遞(例如:http://sampleapp/search?locale=en),對於POST方法,語言環境將成爲請求JSON的一部分。如果我能爲這種情況獲得一些參考實現,那將是非常好的。

    0熱度

    1回答

    問題是,BCryptPasswordEncoder未在登錄過程中對密碼進行加密,因此登錄失敗,我們假設密碼爲123,並以散列形式存儲在數據庫中,密碼123返回invalid_grants,但是當從客戶端發送散列密碼時,返回訪問令牌。當密碼編碼器的密碼被註釋時也是可以的。 App.java @SpringBootApplication public class App { @Bean

    1熱度

    1回答

    我想用Spring數據mongodb實現自定義回購。 Application.java: @SpringBootApplication public class Application implements CommandLineRunner{ @Autowired private CustomerRepositoryCustom repo; public st

    0熱度

    1回答

    我有一個簡單春數據休息實現使用休眠和MongoDB的用戶創建的。 User.java: @Data @Entity @RequiredArgsConstructor @JsonIgnoreProperties(ignoreUnknown = true) public class User { private @Id String username; private

    0熱度

    1回答

    我正在開發SpringBoot應用程序。對於POST終點,沒有要傳遞的請求正文。我的服務工作正常。但是,當我在請求的主體中傳遞一些值時,它也起作用。 如果在請求的主體中傳遞了某些內容,並且理想情況下該請求仍爲空,我該如何驗證並返回一個不良請求? *@RequestMapping(value = "/sample/customers", method = POST) public Customer

    2熱度

    2回答

    我想配置MongoDB的審計在我的春天啓動的應用程序,並試圖堅持我的域名類當具有這個錯誤我:從這裏https://docs.spring.io/spring-data/mongodb/docs/current/reference/html/#auditing java.lang.IllegalArgumentException: Couldn't find PersistentEntity for