본문 바로가기

Programming137

[Java] 테스트 코드 작성시 ParameterizedTest + MethodSource 코드 작성 예시 의존성 설정 implementation 'org.junit.jupiter:junit-jupiter-params:5.9.0' testImplementation 'org.assertj:assertj-core:3.23.1' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.1' ParameterizedTest에서 메소드 소스를 받아 작성하여 4개의 연산 테스트를 하나로 묶을 수 있다. public class CalculatorTest { @DisplayName("덧셈 연산을 수행한다") @ParameterizedTest @MethodSourc.. 2022. 10. 23.
[Java ] 테스트 코드를 작성하는 이유, TDD 코드 예시 [Java ] by 홍종완님, 패스트캠퍼스 나만의 MVC 프레임워크 만들기 테스트 코드를 작성하는 이유 1. 문서화 역할 2. 코드에 결함을 발견하기 위함 3. 리팩토링시 안정성 확보 4. 테스트하기 쉬운 코드를 작성하다 보면 더 낮은 결합도를 가진 설계를 얻을 수 있음 BDD Behavior Driven Development 1. 시나리오 기반으로 테스트 코드를 작성하는 방법 비밀번호 유효성 검증기 만들어보기 요구사항 - 비밀번호는 최소 8자 이상 12자 이하여야 한다. - 비밀번호가 8자 미만 또는 12자 초과인 경우 IllegalArgumentException 예외를 발생시킨다. - 경계조건에 대해 테스트 코드를 작성해야 한다. 테스트 코드에서 .doesNotThrowAnyException(); /.. 2022. 10. 23.
[Java 기초문법] Spring | controller 만들기, thymeleaf 이용해 페이지 만들기, Bootstrap Table, using Formatter interface [Java 기초문법] by Professional Java Developer Career Starter: Java Foundations @ Udemy Set up is as follows package com.neutrio.peopledbweb.web.controller; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; @Controller @RequestMapping("/people") public class PeopleController { @G.. 2022. 10. 22.
[Java 기초문법] Web and HTTP's basic working logic, Spring frame and tomcat underneath [Java 기초문법] by Professional Java Developer Career Starter: Java Foundations @ Udemy Web & HTTP 작동의 기본 원리 localhost:8080에서 무슨 일이 일어난 것인지 살펴보자. loopback address : 127.0.0.1 refer to the current computer address = this operator and this address has an alias which is localhost. what is :8080 ? imagine that the computer is a house. doors with windows = > ports , in generic terms. Likewise a computer .. 2022. 10. 22.
[Java 기초문법] 스프링 시작하기 from start.spring.io to first running [Java 기초문법] by Professional Java Developer Career Starter: Java Foundations @ Udemy First let's go to this webpage. https://start.spring.io/ With this littel wizard here, will generate a mostly empty project that contains all of the add on spring framework projects that we need, with providing a downloadable zip file. metadata could be like this Spring Boot DevTools : shows changing that take si.. 2022. 10. 22.