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.
- Loading branch information
Showing
5 changed files
with
86 additions
and
2 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
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,28 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<parent> | ||
<artifactId>jsonschema-pojo-generator</artifactId> | ||
<groupId>uk.gov.justice.generators</groupId> | ||
<version>1.0.0-SNAPSHOT</version> | ||
</parent> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<artifactId>pojo-plugin-test-provider</artifactId> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>uk.gov.justice.generators</groupId> | ||
<artifactId>pojo-generation-core</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
|
||
<!-- Test dependencies --> | ||
<dependency> | ||
<groupId>junit</groupId> | ||
<artifactId>junit</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
</project> |
22 changes: 22 additions & 0 deletions
22
...er/src/main/java/uk/gov/justice/generation/pojo/generators/plugin/PluginTestProvider.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,22 @@ | ||
package uk.gov.justice.generation.pojo.generators.plugin; | ||
|
||
import static java.util.Arrays.asList; | ||
import static java.util.Collections.emptyList; | ||
|
||
import java.util.List; | ||
|
||
public class PluginTestProvider implements PluginProvider { | ||
|
||
@Override | ||
public List<PluginClassGeneratable> pluginClassGenerators() { | ||
return asList( | ||
new EventAnnotationGenerator(), | ||
new SerializableGenerator(), | ||
new FieldAndMethodGenerator()); | ||
} | ||
|
||
@Override | ||
public List<TypeNamePlugin> typeNamePlugins() { | ||
return emptyList(); | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
...rc/test/java/uk/gov/justice/generation/pojo/generators/plugin/PluginTestProviderTest.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.generation.pojo.generators.plugin; | ||
|
||
import static org.hamcrest.CoreMatchers.hasItems; | ||
import static org.hamcrest.CoreMatchers.instanceOf; | ||
import static org.hamcrest.CoreMatchers.is; | ||
import static org.junit.Assert.assertThat; | ||
|
||
import java.util.List; | ||
|
||
import org.junit.Test; | ||
|
||
public class PluginTestProviderTest { | ||
|
||
@Test | ||
@SuppressWarnings("unchecked") | ||
public void shouldProvideDefaultListOfPluginClassGenerators() throws Exception { | ||
final List<PluginClassGeneratable> pluginClassGenerators = new PluginTestProvider().pluginClassGenerators(); | ||
|
||
assertThat(pluginClassGenerators.size(), is(3)); | ||
assertThat(pluginClassGenerators, hasItems( | ||
instanceOf(EventAnnotationGenerator.class), | ||
instanceOf(SerializableGenerator.class), | ||
instanceOf(FieldAndMethodGenerator.class))); | ||
} | ||
|
||
@Test | ||
public void shouldProvideDefaultListOfTypeNamePlugins() throws Exception { | ||
|
||
final List<TypeNamePlugin> typeNamePlugins = new PluginTestProvider().typeNamePlugins(); | ||
|
||
assertThat(typeNamePlugins.size(), is(0)); | ||
} | ||
} |
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