알게된 것

sdkman

  • sdk init: .sdkmanrc가 생성됨
  • sdk env install: .sdkmanrc에 명시된 자바/그래들 버전 설치 후, 해당 버전 사용

git

git branch가 꼬였을 때

# Step 1: Rename your local branch  
git branch -m msa-with-springboot/ch02 temp-branch  
  
# Step 2: Delete the conflicting reference in the remote repository  
git push origin --delete msa-with-springboot/ch02  
  
# Step 3: Push the renamed branch to the remote repository  
git push origin temp-branch:msa-with-springboot/ch02  
  
# Step 4: Rename the branch back to the original name if needed  
git branch -m temp-branch msa-with-springboot/ch02  

step 3, 4는 순서가 바뀌어도 상관 없음.

spring

spring 4에서는 다음과 같이 테스트를 작성했다.

@RunWith(SpringRunner.class)
@SpringBootTest
public class MultiplicationServiceTest {
    @MockBean
    private RandomGeneratorService randomService;
 
    // ...
}

spring5는 다음과 같이 동치된다.

  • @RunWith @ExtendWith
  • @MockBean @MockitoBean
@ExtendWith({SpringExtension.class, MockitoExtension.class})  
@SpringBootTest  
class MultiplicationServiceTest {  
    @MockitoBean  
    private RandomService randomService;  
  
    // ...
}

gradle

책은 maven으로 프로젝트를 구성하였다. 일부 클래스만을 테스트하기 위해서 다음을 입력한다.

$ mvnw -Dtest=MultiplicationServiceTest test

현재 나는 gradle로 프로젝트를 구성했기 때문에 다음 명령어를 실행해야 한다.

$ ./gradlew test --tests "MultiplicationServiceTest"