AdminDistTransforms { protected boolean areRequiredUserTypeFieldsNull(AssertionType oAssertion) { if (oAssertion != null && oAssertion.getUserInfo() != null) { if (oAssertion.getUserInfo().getUserName() != null) { LOG.debug("Incomming request.getAssertion.getUserInfo.getUserName: " + oAssertion.getUserInfo().getUserName()); } else { LOG.error("Incomming request.getAssertion.getUserInfo.getUserName was null."); return true; } if (oAssertion.getUserInfo().getOrg().getHomeCommunityId() != null) { LOG.debug("Incomming request.getAssertion.getUserInfo.getOrg().getHomeCommunityId(): " + oAssertion.getUserInfo().getOrg().getHomeCommunityId()); } else { LOG.error("Incomming request.getAssertion.getUserInfo.getOrg().getHomeCommunityId() was null."); return true; } if (oAssertion.getUserInfo().getOrg().getName() != null) { LOG.debug("Incomming request.getAssertion.getUserInfo.getOrg().getName() or Community Name: " + oAssertion.getUserInfo().getOrg().getName()); } else { LOG.error("Incomming request.getAssertion.getUserInfo.getOrg().getName() or Community Name was null."); return true; } } else { LOG.error("The UserType object or request assertion object containing the assertion user info was null."); return true; } return false; }  LogEventRequestType transformEDXLDistributionRequestToAuditMsg(EDXLDistribution body,
            AssertionType assertion, NhinTargetSystemType target, String direction, String _interface); LogEventRequestType transformEDXLDistributionRequestToAuditMsg(EDXLDistribution body,
            AssertionType assertion, String direction, String _interface); String getAdminDistributionMessageCommunityID(AssertionType assertion, String direction, String _interface,
            NhinTargetSystemType target);  }
@Test public void testAreRequiredUserTypeFieldsNull() { System.out.println("areRequiredUserTypeFieldsNull"); AssertionType oAssertion = null; AdminDistTransforms instance = new AdminDistTransforms(); boolean expResult = true; boolean result = instance.areRequiredUserTypeFieldsNull(oAssertion); assertEquals(expResult, result); }
@Test public void testAreRequiredUserTypeFieldsNull_NoUserName() { System.out.println("testAreRequiredUserTypeFieldsNull_NoUserName"); AssertionType assertion = new AssertionType(); assertion.setUserInfo(new UserType()); AdminDistTransforms instance = new AdminDistTransforms(); boolean expResult = true; boolean result = instance.areRequiredUserTypeFieldsNull(assertion); assertEquals(expResult, result); }
@Test public void testAreRequiredUserTypeFieldsNull_NoHCID() { System.out.println("testAreRequiredUserTypeFieldsNull_NoHCID"); AssertionType assertion = new AssertionType(); UserType user = new UserType(); HomeCommunityType hc = new HomeCommunityType(); user.setUserName("test"); user.setOrg(hc); assertion.setUserInfo(user); AdminDistTransforms instance = new AdminDistTransforms(); boolean expResult = true; boolean result = instance.areRequiredUserTypeFieldsNull(assertion); assertEquals(expResult, result); }
@Test public void testAreRequiredUserTypeFieldsNull_NoHCName() { System.out.println("testAreRequiredUserTypeFieldsNull_NoHCName"); AssertionType assertion = new AssertionType(); UserType user = new UserType(); HomeCommunityType hc = new HomeCommunityType(); hc.setHomeCommunityId("123"); user.setUserName("test"); user.setOrg(hc); assertion.setUserInfo(user); AdminDistTransforms instance = new AdminDistTransforms(); boolean expResult = true; boolean result = instance.areRequiredUserTypeFieldsNull(assertion); assertEquals(expResult, result); }
@Test public void testAreRequiredUserTypeFieldsNull_False() { System.out.println("testAreRequiredUserTypeFieldsNull_False"); AssertionType assertion = new AssertionType(); UserType user = new UserType(); HomeCommunityType hc = new HomeCommunityType(); hc.setHomeCommunityId("123"); hc.setName("test"); user.setUserName("test"); user.setOrg(hc); assertion.setUserInfo(user); AdminDistTransforms instance = new AdminDistTransforms(); boolean expResult = false; boolean result = instance.areRequiredUserTypeFieldsNull(assertion); assertEquals(expResult, result); }