@PrepareForTest(value={gov.va.med.vistalink.institution.InstitutionMappingDelegate.class,gov.va.med.vistalink.adapter.cci.VistaLinkDuzConnectionSpec.class})
public class VistaLinkHelperTest
extends java.lang.Object
| Constructor and Description |
|---|
VistaLinkHelperTest() |
| Modifier and Type | Method and Description |
|---|---|
void |
setUp() |
void |
tearDown() |
void |
testGetRpcRequestThrowsBeansException()
Test that getRpcRequest rethrows BeansException when context.getBean fails
|
void |
testRpcRequestInjection()
Test DI of rpcRequest
|
void |
testThatGetAppProxyConnectionThrowsResourceExceptionWhenAppProxyNameEqualsEmptyString()
Test that getAppProxyConnection throws ResourceException when appProxyName == ""
|
void |
testThatGetAppProxyConnectionThrowsResourceExceptionWhenAppProxyNameEqualsNull()
Test that getAppProxyConnection throws ResourceException when appProxyName == null
|
void |
testThatGetAppProxyConnectionThrowsResourceExceptionWhenSiteIdEqualsEmptyString()
Test that getAppProxyConnection throws ResourceException when siteId == ""
|
void |
testThatGetAppProxyConnectionThrowsResourceExceptionWhenSiteIdEqualsNull()
Test that getAppProxyConnection throws ResourceException when siteId == null
|
void |
testThatGetConnectionThrowsResourceExceptionWhenDuzEqualsEmptyString()
Test that getConnection throws ResourceException when duz == ""
|
void |
testThatGetConnectionThrowsResourceExceptionWhenDuzEqualsNull()
Test that getConnection throws ResourceException when duz == null
|
void |
testThatGetConnectionThrowsResourceExceptionWhenSiteIdEqualsEmptyString()
Test that getConnection throws ResourceException when siteId == ""
|
void |
testThatGetConnectionThrowsResourceExceptionWhenSiteIdEqualsNull()
Test that getConnection throws ResourceException when siteId == null
|
void |
testThatGetRpcRequestReturnsNewInstanceEachCall()
Test that the appContext is returning a new RpcRequest bean with each call
i.e., NOT a Spring singleton.
|
void |
testVistaLinkHelperInjection()
Test DI of vistaLinkHelper
|
void |
verifyThatGetAppProxyConnectionRethrowsInstitutionMapNotInitialized()
Verify that getAppProxyConnection(siteId, appProxyName) rethrows InstitutionMapNotInitialized
when InstitutionMappingDelegate.getJndiConnectorNameForInstitution(siteId)
throws InstitutionMapNotInitialized
|
void |
verifyThatGetAppProxyConnectionRethrowsInstitutionMappingNotFound()
Verify that getAppProxyConnection(siteId, appProxyName) rethrows InstitutionMappingNotFoundException
when InstitutionMappingDelegate.getJndiConnectorNameForInstitution(siteId)
throws InstitutionMappingNotFoundException
|
void |
verifyThatGetAppProxyConnectionRethrowsNamingException()
Verify that getAppProxyConnection(siteId, appProxyName) rethrows NamingException
when InitialContext.lookup(jndiName) throws NamingException.
|
void |
verifyThatGetAppProxyConnectionRethrowsResourceException()
Verify that getAppProxyConnection(siteId, appProxyName) rethrows ResourceException
when connectionFactory.getConnection(connSpec) throws ResourceException.
|
void |
verifyThatGetAppProxyConnectionReturnsVistaLinkConnection()
Verify that getAppProxyConnection returns a valid VistaLink Connection (happy path)
|
void |
verifyThatGetConnectionRethrowsInstitutionMapNotInitialized()
Verify that getConnection(siteId, duz) rethrows InstitutionMapNotInitialized
when InstitutionMappingDelegate.getJndiConnectorNameForInstitution(siteId)
throws InstitutionMapNotInitialized
|
void |
verifyThatGetConnectionRethrowsInstitutionMappingNotFound()
Verify that getConnection(siteId, duz) rethrows InstitutionMappingNotFoundException
when InstitutionMappingDelegate.getJndiConnectorNameForInstitution(siteId)
throws InstitutionMappingNotFoundException
|
void |
verifyThatGetConnectionRethrowsNamingException()
Verify that getConnection(siteId, duz) rethrows NamingException
when InitialContext.lookup(jndiName) throws NamingException.
|
void |
verifyThatGetConnectionRethrowsResourceException()
Verify that getConnection(siteId, duz) rethrows ResourceException
when connectionFactory.getConnection(connSpec) throws ResourceException.
|
void |
verifyThatGetConnectionReturnsVistaLinkConnection()
Verify that getConnection returns a valid VistaLink Connection (happy path)
|
void |
verifyThatInitialContextLookupIsCalledFromGetAppProxyConnection()
Verify that InitialContext.lookup(jndiName) is called from
getAppProxyConnection(siteId, appProxyName) once
|
void |
verifyThatInitialContextLookupIsCalledFromGetConnection()
Verify that InitialContext.lookup(jndiName) is called from
getConnection(siteId, duz) once
|
void |
verifyThatInstitutionMappingDelegateGetJndiConnectorNameForInstitutionIsCalledFromGetAppProxyConnection()
Verify that
InstitutionMappingDelegate.getJndiConnectorNameForInstitution(siteId) is
called from getAppProxyConnection(siteId, appProxyName)
|
void |
verifyThatInstitutionMappingDelegateGetJndiConnectorNameForInstitutionIsCalledFromGetConnection()
Verify that
InstitutionMappingDelegate.getJndiConnectorNameForInstitution(siteId) is
called from getConnection(siteId, duz)
|
void |
verifyThatNewVistaLinkConnectionSpecIsCalledFromGetAppProxyConnection()
Verify that new VistaLinkAppProxyConnectionSpec(siteId, appProxyName) is called from
getAppProxyConnection(siteId, appProxyName)
|
void |
verifyThatNewVistaLinkConnectionSpecIsCalledFromGetConnection()
Verify that new VistaLinkConnectionSpec(siteId, duz) is called from
getConnection(siteId, duz)
|
void |
verifyThatVistaLinkConnectionFactoryGetConnectionIsCalledFromGetAppProxyConnection()
Verify that VistaLinkConnectionFactory.getAppProxyConnection(connSpec) is called
from getAppProxyConnection(siteId, appProxyName) once
|
void |
verifyThatVistaLinkConnectionFactoryGetConnectionIsCalledFromGetConnection()
Verify that VistaLinkConnectionFactory.getConnection(connSpec) is called
from getConnection(siteId, duz) once
|
public void setUp()
public void tearDown()
public final void testVistaLinkHelperInjection()
public final void testRpcRequestInjection()
public final void testThatGetRpcRequestReturnsNewInstanceEachCall()
public final void testGetRpcRequestThrowsBeansException()
public void verifyThatGetConnectionReturnsVistaLinkConnection()
public void testThatGetConnectionThrowsResourceExceptionWhenSiteIdEqualsNull()
public void testThatGetConnectionThrowsResourceExceptionWhenSiteIdEqualsEmptyString()
public void testThatGetConnectionThrowsResourceExceptionWhenDuzEqualsNull()
public void testThatGetConnectionThrowsResourceExceptionWhenDuzEqualsEmptyString()
public void verifyThatNewVistaLinkConnectionSpecIsCalledFromGetConnection()
public void verifyThatInstitutionMappingDelegateGetJndiConnectorNameForInstitutionIsCalledFromGetConnection()
public void verifyThatInitialContextLookupIsCalledFromGetConnection()
public void verifyThatVistaLinkConnectionFactoryGetConnectionIsCalledFromGetConnection()
public void verifyThatGetConnectionRethrowsInstitutionMapNotInitialized()
public void verifyThatGetConnectionRethrowsInstitutionMappingNotFound()
public void verifyThatGetConnectionRethrowsNamingException()
public void verifyThatGetConnectionRethrowsResourceException()
public void verifyThatGetAppProxyConnectionReturnsVistaLinkConnection()
public void testThatGetAppProxyConnectionThrowsResourceExceptionWhenSiteIdEqualsNull()
public void testThatGetAppProxyConnectionThrowsResourceExceptionWhenSiteIdEqualsEmptyString()
public void testThatGetAppProxyConnectionThrowsResourceExceptionWhenAppProxyNameEqualsNull()
public void testThatGetAppProxyConnectionThrowsResourceExceptionWhenAppProxyNameEqualsEmptyString()
public void verifyThatNewVistaLinkConnectionSpecIsCalledFromGetAppProxyConnection()
public void verifyThatInstitutionMappingDelegateGetJndiConnectorNameForInstitutionIsCalledFromGetAppProxyConnection()
public void verifyThatInitialContextLookupIsCalledFromGetAppProxyConnection()
public void verifyThatVistaLinkConnectionFactoryGetConnectionIsCalledFromGetAppProxyConnection()
public void verifyThatGetAppProxyConnectionRethrowsInstitutionMapNotInitialized()
public void verifyThatGetAppProxyConnectionRethrowsInstitutionMappingNotFound()
public void verifyThatGetAppProxyConnectionRethrowsNamingException()
public void verifyThatGetAppProxyConnectionRethrowsResourceException()