package com.github.avarabyeu.jashing.eventsource;

import com.github.avarabyeu.jashing.integration.vcs.git.GitClient;
import org.junit.Test;

import java.nio.file.FileSystems;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.Map;

/**
 * Created by andrey.vorobyov on 9/27/14.
 */
public class GitTest {

    @Test
    public void testGit() {

        String property = System.getProperty("java.io.tmpdir");
        System.out.println(property);
        GitClient gitClient = new GitClient(FileSystems.getDefault().
                getPath(property), "restendpoint",
                "git@github.com:avarabyeu/restendpoint.git");
        LocalDateTime now = LocalDateTime.now();
        LocalDateTime before = now.minusMonths(30);
        Map<String, Integer> commitsPerUser = gitClient.
                getCommitsPerUser(before.
                        atZone(ZoneId.systemDefault()).toInstant());
        System.out.println(commitsPerUser);

    }
}

@@ -151,28 +151,48 @@
 ava.
-nio.file.FileSystems
+time.Instant;%0Aimport java.time.LocalDate
 ;%0Aim
@@ -385,231 +385,52 @@
 ) %7B%0A
-%0A        String property = System.getProperty(%22java.io.tmpdir%22);%0A        System.out.println(property);%0A        GitClient gitClient = new GitClient(FileSystems.getDefault().%0A                getPath(property), %22restendpoint%22,
+        GitClient gitClient = new GitClient(
 %0A   
@@ -485,16 +485,32 @@
 int.git%22
+, %22restendpoint%22
 );%0A     
@@ -521,20 +521,16 @@
 ocalDate
-Time
  now = L
@@ -537,20 +537,16 @@
 ocalDate
-Time
 .now();%0A
@@ -553,29 +553,23 @@
         
-LocalDateTime
+Instant
  before 
@@ -583,17 +583,63 @@
 inus
-Months(30
+Days(4).atStartOfDay(ZoneId.systemDefault()).toInstant(
 );%0A 

fix git test