Skip to content

Instantly share code, notes, and snippets.

View keesun's full-sized avatar
📺
On Air

Keesun Baik (a.k.a, Whiteship) keesun

📺
On Air
View GitHub Profile
@keesun
keesun / application.properties
Created July 2, 2018 04:50
Spring Boot SSL Sample (self signed)
server.ssl.key-store: keystore.p12
server.ssl.key-store-password: 123456
server.ssl.keyStoreType: PKCS12
server.ssl.keyAlias: tomcat
@keesun
keesun / LoginPage.groovy
Last active August 29, 2015 14:01
Geb test with Spock
package pages
import geb.Page
/**
* @author Keeun Baik
*/
class LoginPage extends Page {
static url = "/users/loginform"
@keesun
keesun / test.md
Created December 19, 2013 13:40
깃헙 Gist 코멘트 API 테스트

여기에 댓글을 보내보세요.

@keesun
keesun / BookControllerTest.groovy
Last active December 23, 2015 23:39
spock + spring mvc test: using mock
package whiteship
import org.springframework.test.web.servlet.MockMvc
import org.springframework.test.web.servlet.setup.MockMvcBuilders
import spock.lang.Specification
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status
/**
* @author Keesun Baik
@keesun
keesun / SampleControllerTest.groovy
Last active December 23, 2015 23:39
simple spock + spring mvc test
package whiteship
import org.springframework.test.web.servlet.MockMvc
import org.springframework.test.web.servlet.setup.MockMvcBuilders
import spock.lang.Specification
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
package sandbox.requestmapping;
import org.junit.Test;
import org.springframework.stereotype.Controller;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
@keesun
keesun / BoardDao.java
Created May 29, 2013 04:12
Board - Post, 1대다 양방향관계에서 최신 게시물의 뷰 카운트가 10 이상인 게시판 조회하기
public List<Board> getPopularBoards(){
List<Board> allBoards = boardDao.getAll();
List<Post> recentPosts = new ArrayList()<>;
for(Board b : allBoards) {
Post p = postDao.getRecentPostFrom(b);
recentPosts.add(p);
}
List<Board> result = new ArrayList()<>;
for(Post p : recentPosts) {
if(p.getViewCount() > 10) {
package yes24.api.server
import groovyx.net.http.HTTPBuilder
import static groovyx.net.http.ContentType.TEXT
class BookController {
def info() {
def bookId = params.id
@Test
public void buildCloneRepository() throws GitAPIException, IOException {
// Given
Project original = createProject("keesun", "test");
CloneAndFetchTemplate template = createTemplate(original);
new GitRepository("keesun", "test").create();
// When
Repository repository = template.buildCloneRepository();
@keesun
keesun / gist:5486780
Last active December 16, 2015 19:39
jgit clone
public void cloneRepository(Project originalProject, Project forkingProject) throws GitAPIException, IOException {
String url = // original project's git url
String directory = "repo/git/" + forkingProject.owner + "/" + forkingProject.name;
Git.cloneRepository()
.setURI(url)
.setDirectory(new File(directory))
.setCloneAllBranches(true)
.call();
forkingProject.repositoryUrl = directory + "/.git";
}