2021-02-09-TIL

Git cheet sheet

git clone -b Polynomeer --single-branch https://github.com/Polynomeer/java-chess
git switch -c {branch name}
git push origin {branch name}
git remote add -t Polynomeer upstream https://github.com/codesquad-members-2021/java-chess
git remote -v
git fetch upstream Polynomeer
git rebase upstream/Polynomeer
Tip

가장 필요없는 것이 사용하지 않는 코드를 확장성을 위해서 작성하는 것이다. 미래지향적인 코드를 불필요하게 작성할 필요는 없다.

@BeforeAll/@AfterAll : 모든 테스트 이전/이후에 딱 한번만 호출, static 메서드를 사용해야함. private 사용 불가능

@BeforeEach/@AfterEach : 각 테스트가 시작할 때마다 바로 이전/이후에 한번씩 호출

@Disabled : @Test코드를 비활성화하여 테스트 실행시 무시한다.

@DisplayNameGeneration : 이름을 생성할 전략에 해당하는 구현체를 넣어서 출력하도록 해준다.

@assertNotNull

테스트 코드 실행 시, 커서를 클래스 내부의 임의의 행에 위치시키고 실행하면 테스트 클래스 전체가 실행된다. 하지만 특정 메서드의 이름을 클릭하고 실행하면 해당 메서드만 실행된다.

import org.testng.annotations.Test 를 하니까 JUnit5의 @Test외에 다른 애노테이션이 실행이 되지않았다. import org.junit.jupiter.api.* 로 대체하였더니 정상적으로 실행되었다.

@DisplayName is used to declare a custom display name for the annotated test class or test method.

https://junit.org/junit5/docs/5.0.3/api/org/junit/jupiter/api/DisplayName.html

@Before 시리즈

https://www.baeldung.com/junit-before-beforeclass-beforeeach-beforeall

Parameterized test

https://www.baeldung.com/parameterized-tests-junit-5

 ~/Desktop/Projects/java-chess → feature/board> git push origin feature/board                          
The authenticity of host 'github.com (15.164.81.167)' can't be established.
RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'github.com,15.164.81.167' (RSA) to the list of known hosts.
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

 ~/Desktop/Projects/java-chess → feature/board> git push origin feature/board                   
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
 ~/Desktop/Projects/java-chess → feature/board> git remote -v                                      
origin  ssh://git@github.com/Polynomeer/java-chess.git (fetch)
origin  ssh://git@github.com/Polynomeer/java-chess.git (push)
upstream        ssh://git@github.com/codesquad-members-2021/java-chess.git (fetch)
upstream        ssh://git@github.com/codesquad-members-2021/java-chess.git (push)
 ~/Desktop/Projects/java-chess → feature/board> git push origin feature/board                          
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

 ~/Desktop/Projects/java-chess   feature/board  ssh-keygen                                              ✔  2965  18:27:39
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/ham/.ssh/id_rsa): 
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /Users/ham/.ssh/id_rsa.
Your public key has been saved in /Users/ham/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:c8otEZMWUA9VMTEVc45i/mJb7MZfkpv1NTSOas5yodQ ham@MacBook-Pro.local
The key's randomart image is:
+---[RSA 3072]----+
|      .o+...*++..|
|         =   o = |
|        = . o . .|
|       . o o .   |
|        S o .  o |
|       . B E o+..|
|        = o +o*o+|
|         +.+.=o==|
|          =+..+.o|
+----[SHA256]-----+
 ~/Desktop/Projects/java-chess   feature/board  ssh-agent                                               ✔  2966  18:29:43
SSH_AUTH_SOCK=/var/folders/ph/yh_7dl7565sgsqcl2ztt4ygh0000gn/T//ssh-DgSkgvGg2diH/agent.29405; export SSH_AUTH_SOCK;
SSH_AGENT_PID=29406; export SSH_AGENT_PID;
echo Agent pid 29406;

https://gist.github.com/adamjohnson/5682757

https://medium.com/officialrajdeepsingh/github-error-message-permission-denied-publickey-8c02ffd56a7f

Jekyll Blog

https://www.jihyeleee.com/blog/third-designer-can-make-jekyll-blog/

TDD

A라는 메서드에 내가 1이라는 값을 넣었을 때, 무엇이 나오는지를 먼저 설계해볼 수 있다.

Today I've Done

  • programmers 문제 한 개 풀기
  • 미션2 완료한 다음, PR보내기

Today I Thought

좋은회사, 나쁜회사

스터디 마지막에 팀원들과 ‘가고싶은 회사'에 대해서 이야기했다. 플렉스, 하이퍼커넥트, 보이저엑스, 호갱노노, 당근마켓, 토스와 같은 회사가 가고싶은 회사라고 꼽았다. 의외로 경력으로 지원하면 코딩테스트가 수월할수도 있다는 고급 정보도 얻었다.

안 좋은 회사를 거르는 방법으로 포괄임금제, 포괄근무제 거르기, 물통이 있는 정수기가 있는 회사는 거르기(by Dong) 등이 있었다.

좋은 회사를 찾는 방법으로는 기술블로그가 있는 회사, 잡플래닛 등에서 평점과 리뷰를 기준으로 판단하기가 거론되었다.