package spark.route;

import org.junit.Test;

import java.util.ArrayList;
import java.util.List;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

public class RoutesTest {

//    @Test
//    public void testParseValidateAddRoute_whenHttpMethodIsValid_thenAddRoute() {
//        //given
//        String route = "get'/hello'";
//        String acceptType = "*/*";
//        Object target = new Object();
//
//        RouteEntry expectedRouteEntry = new RouteEntry(HttpMethod.get, "/hello", acceptType, target);
//        List<RouteEntry> expectedRoutes = new ArrayList<>();
//        expectedRoutes.add(expectedRouteEntry);
//
//        Routes simpleRouteMatcher = Routes.create();
//        simpleRouteMatcher.add(route, acceptType, target);
//
//        //then
//        List<RouteEntry> routes = simpleRouteMatcher.routes();
//        assertTrue("Should return true because http method is valid and the route should be added to the list",
//                   Util.equals(routes, expectedRoutes));
//
//    }
//
//    @Test
//    public void testParseValidateAddRoute_whenHttpMethodIsInvalid_thenDoNotAddRoute() {
//        //given
//        String route = "test'/hello'";
//        String acceptType = "*/*";
//        Object target = new Object();
//
//        Routes simpleRouteMatcher = Routes.create();
//        simpleRouteMatcher.add(route, acceptType, target);
//
//        //then
//        List<RouteEntry> routes = simpleRouteMatcher.routes();
//        assertEquals("Should return 0 because test is not a valid http method, so the route is not added to the list",
//                     routes.size(), 0);
//    }

    @Test(expected = UnsupportedOperationException.class)
    public void exposesUnmodifiableRoutes() throws Exception {
        Routes simpleRouteMatcher = Routes.create();
        List<RouteEntry> routes = simpleRouteMatcher.routes();

        routes.add(new RouteEntry(HttpMethod.get, "/hello", "*/*", new Object()));
    }
}

@@ -60,1612 +60,40 @@
 til.
-Array
 List;%0A
-import java.util.List;%0A%0Aimport static org.junit.Assert.assertEquals;%0Aimport static org.junit.Assert.assertTrue;%0A%0Apublic class RoutesTest %7B%0A%0A//    @Test%0A//    public void testParseValidateAddRoute_whenHttpMethodIsValid_thenAddRoute() %7B%0A//        //given%0A//        String route = %22get'/hello'%22;%0A//        String acceptType = %22*/*%22;%0A//        Object target = new Object();%0A//%0A//        RouteEntry expectedRouteEntry = new RouteEntry(HttpMethod.get, %22/hello%22, acceptType, target);%0A//        List%3CRouteEntry%3E expectedRoutes = new ArrayList%3C%3E();%0A//        expectedRoutes.add(expectedRouteEntry);%0A//%0A//        Routes simpleRouteMatcher = Routes.create();%0A//        simpleRouteMatcher.add(route, acceptType, target);%0A//%0A//        //then%0A//        List%3CRouteEntry%3E routes = simpleRouteMatcher.routes();%0A//        assertTrue(%22Should return true because http method is valid and the route should be added to the list%22,%0A//                   Util.equals(routes, expectedRoutes));%0A//%0A//    %7D%0A//%0A//    @Test%0A//    public void testParseValidateAddRoute_whenHttpMethodIsInvalid_thenDoNotAddRoute() %7B%0A//        //given%0A//        String route = %22test'/hello'%22;%0A//        String acceptType = %22*/*%22;%0A//        Object target = new Object();%0A//%0A//        Routes simpleRouteMatcher = Routes.create();%0A//        simpleRouteMatcher.add(route, acceptType, target);%0A//%0A//        //then%0A//        List%3CRouteEntry%3E routes = simpleRouteMatcher.routes();%0A//        assertEquals(%22Should return 0 because test is not a valid http method, so the route is not added to the list%22,%0A//                     routes.size(), 0);%0A//    %7D
+%0Apublic class RoutesTest %7B
 %0A%0A  
@@ -195,25 +195,8 @@
 es()
- throws Exception
  %7B%0A 

Clean up after merge