This repository has been archived by the owner on May 26, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add factory for the generator plugin
- Loading branch information
amckenzie
committed
Nov 21, 2017
1 parent
cfb3b61
commit 0c080d3
Showing
7 changed files
with
58 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 3 additions & 9 deletions
12
...log/generation/MavenCatalogGenerator.java → ...neration/maven/MavenCatalogGenerator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
...ain/java/uk/gov/justice/schema/catalog/generation/maven/MavenCatalogGeneratorFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package uk.gov.justice.schema.catalog.generation.maven; | ||
|
||
import uk.gov.justice.maven.generator.io.files.parser.core.Generator; | ||
import uk.gov.justice.maven.generator.io.files.parser.core.GeneratorFactory; | ||
import uk.gov.justice.schema.catalog.generation.ObjectFactory; | ||
|
||
import java.net.URI; | ||
import java.util.List; | ||
|
||
public class MavenCatalogGeneratorFactory implements GeneratorFactory<List<URI>> { | ||
|
||
@Override | ||
public Generator<List<URI>> create() { | ||
return new MavenCatalogGenerator(new ObjectFactory()); | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
...java/uk/gov/justice/schema/catalog/generation/maven/MavenCatalogGeneratorFactoryTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package uk.gov.justice.schema.catalog.generation.maven; | ||
|
||
import static org.hamcrest.CoreMatchers.instanceOf; | ||
import static org.hamcrest.CoreMatchers.is; | ||
import static org.hamcrest.CoreMatchers.notNullValue; | ||
import static org.junit.Assert.assertThat; | ||
|
||
import uk.gov.justice.maven.generator.io.files.parser.core.Generator; | ||
|
||
import java.net.URI; | ||
import java.util.List; | ||
|
||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
import org.mockito.InjectMocks; | ||
import org.mockito.runners.MockitoJUnitRunner; | ||
|
||
|
||
@RunWith(MockitoJUnitRunner.class) | ||
public class MavenCatalogGeneratorFactoryTest { | ||
|
||
@InjectMocks | ||
private MavenCatalogGeneratorFactory mavenCatalogGeneratorFactory; | ||
|
||
@Test | ||
public void shouldCreateAMavenCatalogGenerator() throws Exception { | ||
|
||
final Generator<List<URI>> generator = mavenCatalogGeneratorFactory.create(); | ||
|
||
assertThat(generator, is(notNullValue())); | ||
assertThat(generator, is(instanceOf(MavenCatalogGenerator.class))); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters