테스트3 JUnit5를 이용하여 Java 테스트 코드 작성하기 (JUnit5 기준 작성) 자주 사용하는 assert 관련 method assertTure assertFalse assertEquals assertNotEquals assertThrowsExactly assertInstanceOf assertThrowsExactly example assertThrows(ExpectedException.class, () -> Method to test); 다른 bean과 의존 관계 있는 경우 Mock 사용 class ServiceTest { private AutoCloseable openMocks; private Service service; @Mock private OtherService otherService; @BeforeEach void setUp() { openM.. 2022. 12. 22. HTTP 클라이언트 HTTPie 브라우저에 api 주소를 입력할 경우 GET으로만 요청이 된다. 그래서 form을 만들어서 수행하거나 Postman 등의 여러가지 도구들을 사용해서 api 결과를 확인하는데 HTTPie는 커맨드 라인에서 이를 간단하게 확인할 수 있는 HTTP 클라이언트 도구이다. 사용 예시 http GET localhost:8080/restaurants http POST localhost:8080/restaurants name=BeRong address=Busan https://httpie.org/#installation HTTPie – command line HTTP client CLI HTTP that will make you smile. JSON support, syntax highlighting, wget-l.. 2019. 7. 26. [SWEA] 1859. 백만 장자 프로젝트 https://swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5LrsUaDxcDFAXc&categoryId=AV5LrsUaDxcDFAXc&categoryType=CODE SW Expert Academy SW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요! www.swexpertacademy.com 나는 답을 구하는 과정을 너무 복잡하게 생각했더니 감이 안잡혀서 코드를 찾아봤더니 단순한 알고리즘이었다. 매매가 벡터의 뒤에서부터 루프를 도는데 초기에는 마지막 값을 max에 넣고 시작하고, 그 다음부터 max 값보다 작으면 산다고 가정하고 이익을 결과 값에 더해주고, max 값과 같거나 크면 max 값을 해당.. 2019. 4. 24. 이전 1 다음