diff options
author | Thomas Lenz <thomas.lenz@egiz.gv.at> | 2019-12-04 19:43:32 +0100 |
---|---|---|
committer | Thomas Lenz <thomas.lenz@egiz.gv.at> | 2019-12-04 19:43:32 +0100 |
commit | 759ac5f42c6aff901dbeede4fbf1a1d2e08cad0f (patch) | |
tree | 2132024fc058b1ef5338bf50df575a3244cc3f9f /eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/auth/attributes/GivenNameAttrBuilderTest.java | |
parent | 4f15bdc45b08724d20c66c9fd74ea6a43a03c32f (diff) | |
download | EAAF-Components-759ac5f42c6aff901dbeede4fbf1a1d2e08cad0f.tar.gz EAAF-Components-759ac5f42c6aff901dbeede4fbf1a1d2e08cad0f.tar.bz2 EAAF-Components-759ac5f42c6aff901dbeede4fbf1a1d2e08cad0f.zip |
common EGIZ code-style refactoring
Diffstat (limited to 'eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/auth/attributes/GivenNameAttrBuilderTest.java')
-rw-r--r-- | eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/auth/attributes/GivenNameAttrBuilderTest.java | 110 |
1 files changed, 57 insertions, 53 deletions
diff --git a/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/auth/attributes/GivenNameAttrBuilderTest.java b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/auth/attributes/GivenNameAttrBuilderTest.java index dd1dfa5e..62324491 100644 --- a/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/auth/attributes/GivenNameAttrBuilderTest.java +++ b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/auth/attributes/GivenNameAttrBuilderTest.java @@ -16,57 +16,61 @@ import at.gv.egiz.eaaf.core.impl.idp.builder.attributes.GivenNameAttributeBuilde @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration("/SpringTest-context_eaaf_core.xml") -public class GivenNameAttrBuilderTest extends AbstractAttributeBuilderTest{ - - private final IAttributeBuilder attrBuilde = new GivenNameAttributeBuilder(); - - @Test - public void performTest_ok() { - try { - final IAuthData authData = buildAuthData(); - final String value = attrBuilde.build(spConfig, authData, g); - Assert.assertEquals("GivenName does NOT match", authData.getGivenName(), value); - - } catch (final Exception e) { - Assert.assertTrue("Attr. builder has an exception", e == null); - - } - - } - - @Test - public void performTest_null() { - try { - final AuthenticationData authData = (AuthenticationData) buildAuthData(); - authData.setGivenName(null); - - attrBuilde.build(spConfig, authData, g); - Assert.assertTrue("Attr. Builder provide no 'UnavailableAttributeException'", false); - - } catch (final Exception e) { - Assert.assertTrue("Attr. builder provide wrong exception", e instanceof UnavailableAttributeException); - Assert.assertEquals("Attr. name in exception does NOT match", - PVPAttributeDefinitions.GIVEN_NAME_NAME, ((UnavailableAttributeException) e).getAttributeName()); - - } - - } - - @Test - public void performTest_emtpty() { - try { - final AuthenticationData authData = (AuthenticationData) buildAuthData(); - authData.setGivenName(StringUtils.EMPTY); - - attrBuilde.build(spConfig, authData, g); - Assert.assertTrue("Attr. Builder provide no 'UnavailableAttributeException'", false); - - } catch (final Exception e) { - Assert.assertTrue("Attr. builder provide wrong exception", e instanceof UnavailableAttributeException); - Assert.assertEquals("Attr. name in exception does NOT match", - PVPAttributeDefinitions.GIVEN_NAME_NAME, ((UnavailableAttributeException) e).getAttributeName()); - - } - - } +public class GivenNameAttrBuilderTest extends AbstractAttributeBuilderTest { + + private final IAttributeBuilder attrBuilde = new GivenNameAttributeBuilder(); + + @Test + public void performTest_ok() { + try { + final IAuthData authData = buildAuthData(); + final String value = attrBuilde.build(spConfig, authData, gen); + Assert.assertEquals("GivenName does NOT match", authData.getGivenName(), value); + + } catch (final Exception e) { + Assert.assertTrue("Attr. builder has an exception", e == null); + + } + + } + + @Test + public void performTest_null() { + try { + final AuthenticationData authData = (AuthenticationData) buildAuthData(); + authData.setGivenName(null); + + attrBuilde.build(spConfig, authData, gen); + Assert.assertTrue("Attr. Builder provide no 'UnavailableAttributeException'", false); + + } catch (final Exception e) { + Assert.assertTrue("Attr. builder provide wrong exception", + e instanceof UnavailableAttributeException); + Assert.assertEquals("Attr. name in exception does NOT match", + PVPAttributeDefinitions.GIVEN_NAME_NAME, + ((UnavailableAttributeException) e).getAttributeName()); + + } + + } + + @Test + public void performTest_emtpty() { + try { + final AuthenticationData authData = (AuthenticationData) buildAuthData(); + authData.setGivenName(StringUtils.EMPTY); + + attrBuilde.build(spConfig, authData, gen); + Assert.assertTrue("Attr. Builder provide no 'UnavailableAttributeException'", false); + + } catch (final Exception e) { + Assert.assertTrue("Attr. builder provide wrong exception", + e instanceof UnavailableAttributeException); + Assert.assertEquals("Attr. name in exception does NOT match", + PVPAttributeDefinitions.GIVEN_NAME_NAME, + ((UnavailableAttributeException) e).getAttributeName()); + + } + + } } |