본문 바로가기

전체 글

(73)
[이동욱스프링책]java.lang.AssertionError:, mustache 한글 오류상황 java.lang.assertionerror: expecting actual: ????? 한글 깨지는거같아서 mustache에 hello 추가하고 assertThat(body).contains("hello");로 바꿔서 실행하니까 테스트 통과됨 한글이 문제여서 mustache한글 깨짐으로 검색함 해결방법 - 스프링 부트 버전 낮추기 : 이걸 할 순 없어서 - application.properties에 server.servlet.encoding.force-response=true 추가함
[이동욱스프링책]Database "mem:testdb" not found, either pre-create it or allow remote database creation (not recommended in secure environments) 그치 바로되면 재미없지 실행할때마다 디비주소?가 바뀌기때문에 고정시켜줘야됨? application.properties에 spring.h2.console.enabled=true spring.datasource.url=jdbc:h2:mem:testdb 이 두 줄 추가
[이동욱스프링책]java.lang.Exception: No tests found matching Method Posts 아니 왜 복붙이 안돼 java.lang.Exception: No tests found matching Method Posts_수정된다 ~... 말그대로 진짜 @Test 어노테이션이 없어서 오류가 난거였음 ..ㅎ ;;
[이동욱스프링책]assertThat assertThat(posts.getTitle()).isEqualTo(title); assertThat(posts.getTitle().isEqualTo(title)); 이렇게 써서 한참을 오류났다 import static org.assertj.core.api.Assertions.assertThat;
[이동욱스프링책]import import jakarta.persistence.Entity; import javax.persistence.Entity; https://www.inflearn.com/questions/723903/javax-jakarta-%EC%B0%A8%EC%9D%B4 Javax Jakarta 차이 - 인프런 | 질문 & 답변 학습하는 분들께 도움이 되고, 더 좋은 답변을 드릴 수 있도록 질문전에 다음을 꼭 확인해주세요.1. 강의 내용과 관련된 질문을 남겨주세요.2. 인프런의 질문 게시판과 자주 하는 질문(링크)을 먼 www.inflearn.com https://post.dooray.io/we-dooray/tech-insight-ko/back-end/4173/ 스프링 부트 3.0 으로 전환 - Dooray! POST 2022년 11월에 기존의 Spring framework 5 와 Spring Boot 2.X 버전을 대체하는 Spring ..
[이동욱스프링책]mvc.perform(get("/hello")).andExpect(status().isOk()).andExpect(content().string(hello)); 오류 package com.jojoldu.book.springboot.web; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.web.servlet.MockMvc; import static org.springframework.test.web.servle..
[이동욱스프링책]java.lang.ClassCastException: class org.springframework.test.web.servlet.result.JsonPathResultMatchers cannot be cast to class org.springframework.test.web.servlet.ResultMatcher (org.springframework.test.web.servlet.result.JsonPat.. package com.jojoldu.book.springboot.web; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.web.servlet.MockMvc; import static org.hamcrest.Matchers.is; import st..
프로그래머스 package hello; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.Scanner; import java.util.StringTokenizer; public class Main { public static void main(String[] args){ Solution solution = new Solution(); solution.solution("-1 -1"); } } class Solution { public String solution(String s) { String answer = ""; StringTokenizer s..