-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ issue #15 ] Added JUnit, Mockito deps and FieldInjector test case
- Loading branch information
agazzarini
committed
Dec 23, 2014
1 parent
888f456
commit 996aa8f
Showing
3 changed files
with
46 additions
and
1 deletion.
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
38 changes: 38 additions & 0 deletions
38
...df/src/test/java/org/gazzax/labs/solrdf/handler/update/FieldInjectorRegistryTestCase.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,38 @@ | ||
package org.gazzax.labs.solrdf.handler.update; | ||
|
||
import static org.junit.Assert.assertSame; | ||
|
||
import java.util.Map.Entry; | ||
|
||
import org.gazzax.labs.solrdf.handler.update.FieldInjectorRegistry.FieldInjector; | ||
import org.junit.Before; | ||
import org.junit.Test; | ||
|
||
/** | ||
* Test case for {@link FieldInjectorRegistry}. | ||
* | ||
* @author Andrea Gazzarini | ||
* @since 1.0 | ||
*/ | ||
public class FieldInjectorRegistryTestCase { | ||
private FieldInjectorRegistry cut; | ||
|
||
@Before | ||
public void setUp() { | ||
cut = new FieldInjectorRegistry(); | ||
} | ||
|
||
/** | ||
* If an injector has been registered for a given datatype then it must be returned. | ||
*/ | ||
@Test | ||
public void registeredInjector() { | ||
for (final Entry<String, FieldInjector> entry : cut.injectors.entrySet()) { | ||
final String dataTypeURI = entry.getKey(); | ||
final FieldInjector result = cut.get(dataTypeURI); | ||
assertSame(entry.getValue(), result); | ||
} | ||
|
||
assertSame(cut.catchAllInjector(), cut.get(null)); | ||
} | ||
} |