package com.chrisdempewolf.pinterest;

import org.junit.Test;

import java.net.URI;
import java.net.URISyntaxException;

import static com.chrisdempewolf.pinterest.EndPointURIBuilder.buildBoardPinUri;
import static com.chrisdempewolf.pinterest.EndPointURIBuilder.buildBoardUri;
import static com.chrisdempewolf.pinterest.EndPointURIBuilder.buildMyBoardUri;
import static com.chrisdempewolf.pinterest.EndPointURIBuilder.buildMyPinUri;
import static com.chrisdempewolf.pinterest.EndPointURIBuilder.buildPinUri;

import static org.junit.Assert.assertEquals;

public class TestEndPointURIBuilder {
    private static final String ACCESS_TOKEN = "testaccesstoken123";
    private static final String PIN_ID = "1234567890";
    private static final String FIELDS = "myFields";
    private static final String USER_NAME = "jsmith";
    private static final String BOARD_NAME = "myBoard";

    @Test
    public void testBuildPinUri() throws URISyntaxException {
        final URI actual = buildPinUri(ACCESS_TOKEN, PIN_ID, FIELDS);
        final URI expected = new URI("https://api.pinterest.com/v1/pins/" + PIN_ID + "/?access_token=" + ACCESS_TOKEN + "&fields=" + FIELDS);
        assertEquals(expected, actual);
    }

    @Test
    public void testBuildMyPinUri() throws URISyntaxException {
        final URI actual = buildMyPinUri(ACCESS_TOKEN, FIELDS);
        final URI expected = new  URI("https://api.pinterest.com/v1/me/pins/?access_token=" + ACCESS_TOKEN + "&fields=" + FIELDS);
        assertEquals(expected, actual);
    }

    @Test
    public void testBuildBoardPinUri() throws URISyntaxException {
        final URI actual = buildBoardPinUri(ACCESS_TOKEN, USER_NAME, FIELDS);
        final URI expected = new  URI("https://api.pinterest.com/v1/boards/" + USER_NAME + "/pins/?access_token=" + ACCESS_TOKEN + "&fields=" + FIELDS);
        assertEquals(expected, actual);
    }

    @Test
    public void testBuildBoardUri() throws URISyntaxException {
        final URI actual = buildBoardUri(ACCESS_TOKEN, USER_NAME, BOARD_NAME, FIELDS);
        final URI expected = new  URI("https://api.pinterest.com/v1/boards/" + USER_NAME + "/" + BOARD_NAME + "/?access_token=" + ACCESS_TOKEN + "&fields=" + FIELDS);
        assertEquals(expected, actual);
    }

    @Test
    public void testBuildMyBoardUri() throws URISyntaxException {
        final URI actual = buildMyBoardUri(ACCESS_TOKEN, FIELDS);
        final URI expected = new  URI("https://api.pinterest.com/v1/me/boards/?access_token=" + ACCESS_TOKEN + "&fields=" + FIELDS);
        assertEquals(expected, actual);
    }

}

@@ -963,32 +963,35 @@
 final URI actual
+URI
  = buildPinUri(A
@@ -1042,24 +1042,27 @@
 URI expected
+URI
  = new URI(%22
@@ -1190,32 +1190,35 @@
 als(expected
+URI
 , actual
 );%0A    %7D%0A%0A  
@@ -1197,32 +1197,35 @@
 ectedURI, actual
+URI
 );%0A    %7D%0A%0A    @T
@@ -1308,32 +1308,35 @@
 final URI actual
+URI
  = buildMyPinUri
@@ -1377,32 +1377,35 @@
 nal URI expected
+URI
  = new  URI(%22htt
@@ -1518,32 +1518,35 @@
 als(expected
+URI
 , actual
 );%0A    %7D%0A%0A  
@@ -1525,32 +1525,35 @@
 ectedURI, actual
+URI
 );%0A    %7D%0A%0A    @T
@@ -1639,32 +1639,35 @@
 final URI actual
+URI
  = buildBoardPin
@@ -1722,32 +1722,35 @@
 nal URI expected
+URI
  = new  URI(%22htt
@@ -1885,32 +1885,35 @@
 als(expected
+URI
 , actual
 );%0A    %7D%0A%0A  
@@ -1892,32 +1892,35 @@
 ectedURI, actual
+URI
 );%0A    %7D%0A%0A    @T
@@ -2003,32 +2003,35 @@
 final URI actual
+URI
  = buildBoardUri
@@ -2095,32 +2095,35 @@
 nal URI expected
+URI
  = new  URI(%22htt
@@ -2272,32 +2272,35 @@
 als(expected
+URI
 , actual
 );%0A    %7D%0A%0A  
@@ -2279,32 +2279,35 @@
 ectedURI, actual
+URI
 );%0A    %7D%0A%0A    @T
@@ -2400,16 +2400,19 @@
 I actual
+URI
  = build
@@ -2471,16 +2471,19 @@
 expected
+URI
  = new  
@@ -2610,24 +2610,27 @@
 expected
+URI
 , actual
 );%0A    %7D
@@ -2621,16 +2621,19 @@
 , actual
+URI
 );%0A    %7D

Rename variables in end point builder unit test