Skip to content

Commit

Permalink
refs: eclipse#55 add TCK test for Custom Converters
Browse files Browse the repository at this point in the history
Signed-off-by: Mark Struberg <[email protected]>
  • Loading branch information
struberg committed May 5, 2017
1 parent 580cb9e commit b4e1949
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import javax.inject.Inject;

import org.eclipse.microprofile.config.Config;
import org.eclipse.microprofile.config.inject.ConfigProperty;
import org.eclipse.microprofile.config.spi.ConfigSource;
import org.eclipse.microprofile.config.spi.ConfigSourceProvider;
import org.eclipse.microprofile.config.tck.base.AbstractTest;
Expand Down Expand Up @@ -71,6 +72,10 @@ public static WebArchive deploy() {
return war;
}

@Inject
@ConfigProperty(name = "tck.config.test.javaconfig.converter.duckname")
private Duck namedDuck;


@Test
public void testInteger() {
Expand Down Expand Up @@ -187,4 +192,7 @@ public void testBoolean() {
Assert.assertFalse(config.getValue("tck.config.test.javaconfig.configvalue.boolean.off", Boolean.class));
}

public void testCustomConverter() {
Assert.assertEquals(namedDuck.getName(), "Hannelore");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,8 @@ tck.config.test.javaconfig.configvalue.long=1234567890123456
tck.config.test.javaconfig.configvalue.float=12.34
tck.config.test.javaconfig.configvalue.double=12.34567890123456

# Custom Converter tests
tck.config.test.javaconfig.converter.duckname=Hannelore

# empty values treated as not existing
tck.config.test.javaconfig.emptyvalue=

# withVariable
tck.config.test.javaconfig.configvalue.variable = the perfect value
tck.config.test.javaconfig.configvalue.withvariable.key = This key needs ${tck.config.test.javaconfig.configvalue.variable}!

0 comments on commit b4e1949

Please sign in to comment.