Author: rdonkin
Date: Thu Nov 22 20:29:18 2012
New Revision: 1412660

URL: http://svn.apache.org/viewvc?rev=1412660&view=rev
Log:
WHISKER-11 Introduce Configuration (context object) with property conttrolling 
source URLs

Added:
    
creadur/whisker/trunk/apache-whisker-app/src/main/java/org/apache/creadur/whisker/app/Configuration.java
   (with props)
    
creadur/whisker/trunk/apache-whisker-app/src/main/java/org/apache/creadur/whisker/app/ConfigurationBuilder.java
   (with props)
    
creadur/whisker/trunk/apache-whisker-app/src/test/java/org/apache/creadur/whisker/app/TestConfigurationBuilder.java
   (with props)
Modified:
    
creadur/whisker/trunk/apache-whisker-app/src/main/java/org/apache/creadur/whisker/app/AbstractEngine.java
    
creadur/whisker/trunk/apache-whisker-app/src/main/java/org/apache/creadur/whisker/app/Whisker.java
    
creadur/whisker/trunk/apache-whisker-velocity/src/main/java/org/apache/creadur/whisker/out/velocity/VelocityEngine.java
    
creadur/whisker/trunk/apache-whisker-velocity/src/test/java/org/apache/creadur/whisker/out/velocity/TestLicenseGeneration.java
    
creadur/whisker/trunk/apache-whisker-velocity/src/test/java/org/apache/creadur/whisker/out/velocity/TestNoticeGeneration.java

Modified: 
creadur/whisker/trunk/apache-whisker-app/src/main/java/org/apache/creadur/whisker/app/AbstractEngine.java
URL: 
http://svn.apache.org/viewvc/creadur/whisker/trunk/apache-whisker-app/src/main/java/org/apache/creadur/whisker/app/AbstractEngine.java?rev=1412660&r1=1412659&r2=1412660&view=diff
==============================================================================
--- 
creadur/whisker/trunk/apache-whisker-app/src/main/java/org/apache/creadur/whisker/app/AbstractEngine.java
 (original)
+++ 
creadur/whisker/trunk/apache-whisker-app/src/main/java/org/apache/creadur/whisker/app/AbstractEngine.java
 Thu Nov 22 20:29:18 2012
@@ -33,41 +33,46 @@ public abstract class AbstractEngine {
      * Writes templates to help create meta-data.
      * @param withBase from this base, not null
      * @param writerFactory not null
+     * @param configuration not null
      * @return this
      * @throws Exception when creation fails
      */
     public abstract AbstractEngine skeleton(
             Collection<Directory> withBase,
-            ResultWriterFactory writerFactory) throws Exception;
+            ResultWriterFactory writerFactory, Configuration configuration) 
throws Exception;
 
     /**
      * Reports validations.
      * @param analyst not null
      * @param writerFactory not null
+     * @param configuration not null
      * @return not null
      * @throws Exception when report creation fails
      */
     public abstract AbstractEngine validate(LicenseAnalyst analyst,
-            ResultWriterFactory writerFactory) throws Exception;
+            ResultWriterFactory writerFactory, Configuration configuration) 
throws Exception;
 
     /**
      * Writes a report describing the directories present.
      * @param directories not null
      * @param writerFactory not null
+     * @param configuration not null
      * @return this
      * @throws Exception when report creation fails
      */
     public abstract AbstractEngine report(
             final Collection<Directory> directories,
-            ResultWriterFactory writerFactory) throws Exception;
+            ResultWriterFactory writerFactory, Configuration configuration) 
throws Exception;
 
     /**
      * Writes legal documents.
      * @param work not null
      * @param writerFactory not null
+     * @param configuration not null
      * @return this
      * @throws Exception when report creation fails
      */
     public abstract AbstractEngine generate(final Descriptor work,
-            ResultWriterFactory writerFactory) throws Exception;
+            ResultWriterFactory writerFactory, Configuration configuration) 
throws Exception;
+
 }

Added: 
creadur/whisker/trunk/apache-whisker-app/src/main/java/org/apache/creadur/whisker/app/Configuration.java
URL: 
http://svn.apache.org/viewvc/creadur/whisker/trunk/apache-whisker-app/src/main/java/org/apache/creadur/whisker/app/Configuration.java?rev=1412660&view=auto
==============================================================================
--- 
creadur/whisker/trunk/apache-whisker-app/src/main/java/org/apache/creadur/whisker/app/Configuration.java
 (added)
+++ 
creadur/whisker/trunk/apache-whisker-app/src/main/java/org/apache/creadur/whisker/app/Configuration.java
 Thu Nov 22 20:29:18 2012
@@ -0,0 +1,57 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.creadur.whisker.app;
+
+/**
+ * Immutable context for operations.
+ */
+public class Configuration {
+
+    /**
+     * Should source URLs be included in the license text?
+     */
+    private final boolean includeSourceUrlsInLicense;
+
+    /**
+     * Constructs an immutable context for operations.
+     * @param includeSourceUrlsInLicense true when source URLs should
+     * be included in the license text, false otherwise
+     */
+    public Configuration(final boolean includeSourceUrlsInLicense) {
+        this.includeSourceUrlsInLicense = includeSourceUrlsInLicense;
+    }
+
+    /**
+     * Should source URLs be included in the license text?
+     * @return true when source URLs should be included in the license text
+     */
+    public boolean includeSourceURLsInLicense() {
+        return includeSourceUrlsInLicense;
+    }
+
+    /**
+     * Suitable for logging.
+     * return not null
+     */
+    @Override
+    public String toString() {
+        return "Configuration [includeSourceUrlsInLicense="
+                + includeSourceUrlsInLicense + "]";
+    }
+}

Propchange: 
creadur/whisker/trunk/apache-whisker-app/src/main/java/org/apache/creadur/whisker/app/Configuration.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 
creadur/whisker/trunk/apache-whisker-app/src/main/java/org/apache/creadur/whisker/app/ConfigurationBuilder.java
URL: 
http://svn.apache.org/viewvc/creadur/whisker/trunk/apache-whisker-app/src/main/java/org/apache/creadur/whisker/app/ConfigurationBuilder.java?rev=1412660&view=auto
==============================================================================
--- 
creadur/whisker/trunk/apache-whisker-app/src/main/java/org/apache/creadur/whisker/app/ConfigurationBuilder.java
 (added)
+++ 
creadur/whisker/trunk/apache-whisker-app/src/main/java/org/apache/creadur/whisker/app/ConfigurationBuilder.java
 Thu Nov 22 20:29:18 2012
@@ -0,0 +1,74 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.creadur.whisker.app;
+
+/**
+ * Builds configurations fluently.
+ */
+public class ConfigurationBuilder {
+
+    /**
+     * Creates a new builder.
+     * @return not null
+     */
+    public static ConfigurationBuilder aConfiguration() {
+        return new ConfigurationBuilder();
+    }
+
+    /**
+     * Include source URLs in the License document?
+     */
+    private boolean includeSourceUrlsInLicense;
+
+    /**
+     * Create via factory method.
+     */
+    private ConfigurationBuilder() {
+        includeSourceUrlsInLicense = true;
+    }
+
+    /**
+     * Builds a configuration.
+     * @return not null
+     */
+    public Configuration build() {
+        return new Configuration(includeSourceUrlsInLicense);
+    }
+
+    /**
+     * Set source URLs in license to true
+     * when the configuration is built.
+     * @return this, not null
+     */
+    public ConfigurationBuilder withSourceURLsInLicense() {
+        includeSourceUrlsInLicense = true;
+        return this;
+    }
+
+    /**
+     * Set source URLs in license to false
+     * when the configuration is built.
+     * @return this, not null
+     */
+    public ConfigurationBuilder noSourceURLsInLicense() {
+        includeSourceUrlsInLicense = false;
+        return this;
+    }
+
+}

Propchange: 
creadur/whisker/trunk/apache-whisker-app/src/main/java/org/apache/creadur/whisker/app/ConfigurationBuilder.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: 
creadur/whisker/trunk/apache-whisker-app/src/main/java/org/apache/creadur/whisker/app/Whisker.java
URL: 
http://svn.apache.org/viewvc/creadur/whisker/trunk/apache-whisker-app/src/main/java/org/apache/creadur/whisker/app/Whisker.java?rev=1412660&r1=1412659&r2=1412660&view=diff
==============================================================================
--- 
creadur/whisker/trunk/apache-whisker-app/src/main/java/org/apache/creadur/whisker/app/Whisker.java
 (original)
+++ 
creadur/whisker/trunk/apache-whisker-app/src/main/java/org/apache/creadur/whisker/app/Whisker.java
 Thu Nov 22 20:29:18 2012
@@ -18,6 +18,8 @@
  */
 package org.apache.creadur.whisker.app;
 
+import static org.apache.creadur.whisker.app.ConfigurationBuilder.*;
+
 import java.io.IOException;
 import java.io.InputStream;
 import java.util.Collection;
@@ -159,17 +161,25 @@ public class Whisker {
      * @return this, not null
      */
     private Whisker skeleton() throws Exception {
-        engine.skeleton(directories(), getWriterFactory());
+        engine.skeleton(directories(), getWriterFactory(), configuration());
         return this;
     }
 
     /**
+     * Builds a populated configuration.
+     * @return not null
+     */
+    private Configuration configuration() {
+        return aConfiguration().build();
+    }
+
+    /**
      * Writes a report on the directories in the source.
      * @return this, not null
      * @throws Exception when the report creation fails
      */
     private Whisker report() throws Exception {
-        engine.report(directories(), getWriterFactory());
+        engine.report(directories(), getWriterFactory(), configuration());
         return this;
     }
 
@@ -179,7 +189,7 @@ public class Whisker {
      * @throws Exception when the generation fails
      */
     private Whisker generate() throws Exception {
-        engine.generate(new 
LicenseAnalyst().validate(load(getLicenseDescriptor())), getWriterFactory());
+        engine.generate(new 
LicenseAnalyst().validate(load(getLicenseDescriptor())), getWriterFactory(), 
configuration());
         return this;
     }
 
@@ -189,7 +199,7 @@ public class Whisker {
      * @throws Exception when the validation fails
      */
     private Whisker validate() throws Exception {
-        engine.validate(new 
LicenseAnalyst(directories()).analyse(load(getLicenseDescriptor())), 
getWriterFactory());
+        engine.validate(new 
LicenseAnalyst(directories()).analyse(load(getLicenseDescriptor())), 
getWriterFactory(), configuration());
         return this;
     }
 

Added: 
creadur/whisker/trunk/apache-whisker-app/src/test/java/org/apache/creadur/whisker/app/TestConfigurationBuilder.java
URL: 
http://svn.apache.org/viewvc/creadur/whisker/trunk/apache-whisker-app/src/test/java/org/apache/creadur/whisker/app/TestConfigurationBuilder.java?rev=1412660&view=auto
==============================================================================
--- 
creadur/whisker/trunk/apache-whisker-app/src/test/java/org/apache/creadur/whisker/app/TestConfigurationBuilder.java
 (added)
+++ 
creadur/whisker/trunk/apache-whisker-app/src/test/java/org/apache/creadur/whisker/app/TestConfigurationBuilder.java
 Thu Nov 22 20:29:18 2012
@@ -0,0 +1,47 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.creadur.whisker.app;
+
+import junit.framework.TestCase;
+
+public class TestConfigurationBuilder extends TestCase {
+
+    ConfigurationBuilder subject;
+
+    @Override
+    protected void setUp() throws Exception {
+        super.setUp();
+        subject = ConfigurationBuilder.aConfiguration();
+    }
+
+
+    public void testWithNoSourceURLsInLicense() {
+        
assertFalse(subject.noSourceURLsInLicense().build().includeSourceURLsInLicense());
+    }
+
+    public void testSourceURLsInLicenseDefault() {
+        
assertTrue(subject.withSourceURLsInLicense().build().includeSourceURLsInLicense());
+    }
+
+
+    public void testWithSourceURLsInLicense() {
+        
assertTrue(subject.withSourceURLsInLicense().build().includeSourceURLsInLicense());
+    }
+
+}

Propchange: 
creadur/whisker/trunk/apache-whisker-app/src/test/java/org/apache/creadur/whisker/app/TestConfigurationBuilder.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: 
creadur/whisker/trunk/apache-whisker-velocity/src/main/java/org/apache/creadur/whisker/out/velocity/VelocityEngine.java
URL: 
http://svn.apache.org/viewvc/creadur/whisker/trunk/apache-whisker-velocity/src/main/java/org/apache/creadur/whisker/out/velocity/VelocityEngine.java?rev=1412660&r1=1412659&r2=1412660&view=diff
==============================================================================
--- 
creadur/whisker/trunk/apache-whisker-velocity/src/main/java/org/apache/creadur/whisker/out/velocity/VelocityEngine.java
 (original)
+++ 
creadur/whisker/trunk/apache-whisker-velocity/src/main/java/org/apache/creadur/whisker/out/velocity/VelocityEngine.java
 Thu Nov 22 20:29:18 2012
@@ -22,6 +22,7 @@ import java.util.Collection;
 
 import org.apache.commons.logging.Log;
 import org.apache.creadur.whisker.app.AbstractEngine;
+import org.apache.creadur.whisker.app.Configuration;
 import org.apache.creadur.whisker.app.ResultWriterFactory;
 import org.apache.creadur.whisker.app.analysis.LicenseAnalyst;
 import org.apache.creadur.whisker.model.Descriptor;
@@ -49,14 +50,16 @@ public class VelocityEngine extends Abst
      * Generates a template, and writes result using given factory.
      * @param withBase not null
      * @param writerFactory not null
+     * @param configuration not null
      * @return this engine, not null
      * @throws Exception when generation fails
-     * @see AbstractEngine#skeleton(Collection, ResultWriterFactory)
+     * @see AbstractEngine#skeleton(Collection, ResultWriterFactory, 
Configuration)
      */
     @Override
     public final AbstractEngine skeleton(
             final Collection<Directory> withBase,
-            final ResultWriterFactory writerFactory)
+            final ResultWriterFactory writerFactory,
+            final Configuration configuration)
                 throws Exception {
         reporter(writerFactory).generateTemplate(withBase);
         return this;
@@ -75,14 +78,16 @@ public class VelocityEngine extends Abst
      * Generates a validation report, and writes result using given factory.
      * @param analyst not null
      * @param writerFactory not null
+     * @param configuration not null
      * @return this, not null
      * @throws Exception when validation fails
-     * @see AbstractEngine#validate(LicenseAnalyst, ResultWriterFactory)
+     * @see AbstractEngine#validate(LicenseAnalyst, ResultWriterFactory, 
Configuration)
      */
     @Override
     public final AbstractEngine validate(
             final LicenseAnalyst analyst,
-            final ResultWriterFactory writerFactory) throws Exception {
+            final ResultWriterFactory writerFactory,
+            final Configuration configuration) throws Exception {
         reporter(writerFactory).validate(analyst);
         return this;
     }
@@ -91,14 +96,16 @@ public class VelocityEngine extends Abst
      * Generates a directories report, and writes result using given factory.
      * @param directories not null
      * @param writerFactory not null
+     * @param configuration not null
      * @return this, not null
      * @throws Exception when reporting fails
-     * @see AbstractEngine#report(java.util.Collection, ResultWriterFactory)
+     * @see AbstractEngine#report(java.util.Collection, ResultWriterFactory, 
Configuration)
      */
     @Override
     public final AbstractEngine report(
             final Collection<Directory> directories,
-            final ResultWriterFactory writerFactory) throws Exception {
+            final ResultWriterFactory writerFactory,
+            final Configuration configuration) throws Exception {
         reporter(writerFactory).report(directories);
         return this;
     }
@@ -107,14 +114,16 @@ public class VelocityEngine extends Abst
      * Generates documents, and writes results using given factory.
      * @param work not null
      * @param writerFactory not null
+     * @param configuration not null
      * @return this, not null
      * @throws Exception when generation fails.
-     * @see AbstractEngine#generate(Descriptor, ResultWriterFactory)
+     * @see AbstractEngine#generate(Descriptor, ResultWriterFactory, 
Configuration)
      */
     @Override
     public final AbstractEngine generate(
             final Descriptor work,
-            final ResultWriterFactory writerFactory) throws Exception {
+            final ResultWriterFactory writerFactory,
+            final Configuration configuration) throws Exception {
         reporter(writerFactory).generate(work);
         return this;
     }

Modified: 
creadur/whisker/trunk/apache-whisker-velocity/src/test/java/org/apache/creadur/whisker/out/velocity/TestLicenseGeneration.java
URL: 
http://svn.apache.org/viewvc/creadur/whisker/trunk/apache-whisker-velocity/src/test/java/org/apache/creadur/whisker/out/velocity/TestLicenseGeneration.java?rev=1412660&r1=1412659&r2=1412660&view=diff
==============================================================================
--- 
creadur/whisker/trunk/apache-whisker-velocity/src/test/java/org/apache/creadur/whisker/out/velocity/TestLicenseGeneration.java
 (original)
+++ 
creadur/whisker/trunk/apache-whisker-velocity/src/test/java/org/apache/creadur/whisker/out/velocity/TestLicenseGeneration.java
 Thu Nov 22 20:29:18 2012
@@ -18,6 +18,8 @@
  */
 package org.apache.creadur.whisker.out.velocity;
 
+import static org.apache.creadur.whisker.app.ConfigurationBuilder.*;
+
 import junit.framework.TestCase;
 
 import org.apache.commons.lang3.StringUtils;
@@ -47,7 +49,7 @@ public class TestLicenseGeneration exten
     public void testThatWhenThereAreNoThirdPartyContentsFooterIsNotShown() 
throws Exception {
         Descriptor work = builder.build();
 
-        subject.generate(work, writerFactory);
+        subject.generate(work, writerFactory, aConfiguration().build());
 
         assertTrue("Check that work is suitable for this test", 
work.isPrimaryOnly());
         assertEquals("Only one request for LICENSE writer", 1, 
writerFactory.requestsFor(Result.LICENSE));
@@ -61,7 +63,7 @@ public class TestLicenseGeneration exten
 
         assertFalse("Check that work is suitable for this test", 
work.isPrimaryOnly());
 
-        subject.generate(work, writerFactory);
+        subject.generate(work, writerFactory, aConfiguration().build());
 
         assertEquals("Only one request for LICENSE writer", 1, 
writerFactory.requestsFor(Result.LICENSE));
         assertTrue("Expect information when third party contents present: " + 
writerFactory.firstOutputFor(Result.LICENSE),
@@ -74,7 +76,7 @@ public class TestLicenseGeneration exten
                 builder
                 .withSecondaryCopyrightNotice()
                 .withPrimaryCopyrightNotice()
-                .withPrimaryLicenseAndOrgInDirectory("lib").build(), 
writerFactory);
+                .withPrimaryLicenseAndOrgInDirectory("lib").build(), 
writerFactory, aConfiguration().build());
 
         assertEquals("Only one request for LICENSE writer", 1, 
writerFactory.requestsFor(Result.LICENSE));
         assertTrue("Expect secondary copyright to be presented: " + 
writerFactory.firstOutputFor(Result.LICENSE),
@@ -99,7 +101,7 @@ public class TestLicenseGeneration exten
     public void testPrimaryOrganisationSecondaryLicense() throws Exception {
         subject.generate(
                 
builder.withSecondaryLicensePrimaryOrganisationInDirectory("lib").build(),
-                writerFactory);
+                writerFactory, aConfiguration().build());
         assertEquals("Only one request for LICENSE writer", 1, 
writerFactory.requestsFor(Result.LICENSE));
 
         verifyThatResourceNameIsWritten();
@@ -109,7 +111,7 @@ public class TestLicenseGeneration exten
     public void testIgnorePrimaryOrganisationPrimaryLicense() throws Exception 
{
         subject.generate(
                 builder.withPrimaryLicenseAndOrgInDirectory("lib").build(),
-                writerFactory);
+                writerFactory, aConfiguration().build());
         assertEquals("Only one request for LICENSE writer", 1, 
writerFactory.requestsFor(Result.LICENSE));
         verifyThatResourceNameIsNotWritten();
 
@@ -121,7 +123,7 @@ public class TestLicenseGeneration exten
                     .withPrimaryCopyrightNotice()
                     .withPrimaryLicenseAndOrgInDirectory("lib")
                     .build(),
-                writerFactory);
+                writerFactory, aConfiguration().build());
         assertEquals("Only one request for LICENSE writer", 1, 
writerFactory.requestsFor(Result.LICENSE));
         verifyThatResourceNameIsNotWritten();
 

Modified: 
creadur/whisker/trunk/apache-whisker-velocity/src/test/java/org/apache/creadur/whisker/out/velocity/TestNoticeGeneration.java
URL: 
http://svn.apache.org/viewvc/creadur/whisker/trunk/apache-whisker-velocity/src/test/java/org/apache/creadur/whisker/out/velocity/TestNoticeGeneration.java?rev=1412660&r1=1412659&r2=1412660&view=diff
==============================================================================
--- 
creadur/whisker/trunk/apache-whisker-velocity/src/test/java/org/apache/creadur/whisker/out/velocity/TestNoticeGeneration.java
 (original)
+++ 
creadur/whisker/trunk/apache-whisker-velocity/src/test/java/org/apache/creadur/whisker/out/velocity/TestNoticeGeneration.java
 Thu Nov 22 20:29:18 2012
@@ -18,6 +18,8 @@
  */
 package org.apache.creadur.whisker.out.velocity;
 
+import static org.apache.creadur.whisker.app.ConfigurationBuilder.*;
+
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
@@ -33,7 +35,7 @@ import org.apache.creadur.whisker.model.
 import junit.framework.TestCase;
 
 public class TestNoticeGeneration extends TestCase {
-    
+
     StringResultWriterFactory writerFactory;
     VelocityEngine subject;
     License primaryLicense = new License(false, "This is the license text", 
Collections.<String> emptyList(), "example.org", "http://example.org";, "Example 
License");
@@ -43,7 +45,7 @@ public class TestNoticeGeneration extend
     Map<String, License> licenses = new HashMap<String, License>();
     Map<String, String> notices = new HashMap<String, String>();
     Map<String, Organisation> organisations = new HashMap<String, 
Organisation>();
-    
+
     @Override
     protected void setUp() throws Exception {
         super.setUp();
@@ -56,25 +58,25 @@ public class TestNoticeGeneration extend
     protected void tearDown() throws Exception {
         super.tearDown();
     }
-    
+
     public void testThatWhenThereAreNoThirdPartyNoticesHeaderIsNotShown() 
throws Exception {
-        Descriptor work = 
-                new Descriptor(primaryLicense, primaryOrg,  primaryNotice, 
+        Descriptor work =
+                new Descriptor(primaryLicense, primaryOrg,  primaryNotice,
                         licenses, notices, organisations, contents);
-        
-        subject.generate(work, writerFactory);
-        
+
+        subject.generate(work, writerFactory, aConfiguration().build());
+
         assertEquals("Only one request for NOTICE writer", 1, 
writerFactory.requestsFor(Result.NOTICE));
         assertEquals("When no third party notices, expect that only the 
primary notice is output", primaryNotice, 
writerFactory.firstOutputFor(Result.NOTICE).trim());
     }
-    
+
     public void testThatNoticeOutputIsSkippedWhenThereAreNoNotices() throws 
Exception {
-        Descriptor work = 
-                new Descriptor(primaryLicense, primaryOrg,  "", 
+        Descriptor work =
+                new Descriptor(primaryLicense, primaryOrg,  "",
                         licenses, notices, organisations, contents);
-        
-        subject.generate(work, writerFactory);
-        
+
+        subject.generate(work, writerFactory, aConfiguration().build());
+
         assertEquals("No requests for NOTICE writer", 0, 
writerFactory.requestsFor(Result.NOTICE));
     }
 


Reply via email to