@Test public void testRailsGoatControllerParser() { File f = new File (TestConstants.RAILSGOAT_SOURCE_LOCATION); assert f.exists() : "Source code location does not exist. " + TestConstants.RAILSGOAT_SOURCE_LOCATION; assert f.isDirectory() : "Source code location is not folder. " + TestConstants.RAILSGOAT_SOURCE_LOCATION; RailsEndpointMappings mappings = new RailsEndpointMappings(f); List<Endpoint> endpoints = mappings.generateEndpoints(); assert !endpoints.isEmpty() : "Got empty endpoints for " + TestConstants.RAILSGOAT_SOURCE_LOCATION; Endpoint testEndpoint = new RailsEndpoint( "/app/controllers/password_resets_controller.rb", "/forgot_password", set("GET"), set("confirm_password", "email", "token", "password", "user") ); confirmEndpointExistsIn(testEndpoint, endpoints); }
@Nonnull @Override public List<Endpoint> generateEndpoints() { return endpoints; }
RailsEndpointMappings implements EndpointGenerator { @Nonnull @Override public List<Endpoint> generateEndpoints() { return endpoints; } }
RailsEndpointMappings implements EndpointGenerator { @Nonnull @Override public List<Endpoint> generateEndpoints() { return endpoints; } RailsEndpointMappings(@Nonnull File rootDirectory); }
RailsEndpointMappings implements EndpointGenerator { @Nonnull @Override public List<Endpoint> generateEndpoints() { return endpoints; } RailsEndpointMappings(@Nonnull File rootDirectory); @Nonnull @Override List<Endpoint> generateEndpoints(); @Override Iterator<Endpoint> iterator(); String getRelativePath(File f); }
RailsEndpointMappings implements EndpointGenerator { @Nonnull @Override public List<Endpoint> generateEndpoints() { return endpoints; } RailsEndpointMappings(@Nonnull File rootDirectory); @Nonnull @Override List<Endpoint> generateEndpoints(); @Override Iterator<Endpoint> iterator(); String getRelativePath(File f);  }