@Test public void testConverterEnforcement() { ProfileHelper.setEnforceProfileDefinition(true); try { definition.addAttribute(NAME, new FakeConverter()); assertEquals(FAKE_VALUE, definition.convert(NAME, VALUE)); } finally { ProfileHelper.setEnforceProfileDefinition(false); } }
@Test public void testNoConverterEnforcement() { ProfileHelper.setEnforceProfileDefinition(true); try { assertNull(definition.convert(NAME, VALUE)); } finally { ProfileHelper.setEnforceProfileDefinition(false); } }
@Test public void testConverterNoEnforcement() { definition.addAttribute(NAME, new FakeConverter()); assertEquals(FAKE_VALUE, definition.convert(NAME, VALUE)); }
@Test public void testNoConverterNoEnforcement() { assertEquals(VALUE, definition.convert(NAME, VALUE)); }