### Question:
ExternalResourceInfoFactory { public static IExternalResourceInfo createResource( ResourceEntry resourceEntry ) { return createResource( resourceEntry, DEFAULT_IS_INPUT ); } protected  ExternalResourceInfoFactory(); static IExternalResourceInfo createDatabaseResource( DatabaseMeta databaseMeta ); static IExternalResourceInfo createDatabaseResource( DatabaseMeta databaseMeta, boolean isInput ); static IExternalResourceInfo createResource( ResourceEntry resourceEntry ); static IExternalResourceInfo createResource( ResourceEntry resourceEntry, boolean isInput ); static IExternalResourceInfo createFileResource( FileObject fileObject ); static IExternalResourceInfo createFileResource( FileObject fileObject, boolean isInput ); static IExternalResourceInfo createURLResource( String url ); static IExternalResourceInfo createURLResource( String url, boolean isInput );  }### Answer:
@Test public void testCreateResource() throws Exception { ResourceEntry resourceEntry = mock( ResourceEntry.class ); when( resourceEntry.getResource() ).thenReturn( "myResource" ); when( resourceEntry.getResourcetype() ).thenReturn( ResourceEntry.ResourceType.ACTIONFILE ); IExternalResourceInfo resourceInfo = ExternalResourceInfoFactory.createResource( resourceEntry ); assertEquals( DictionaryConst.NODE_TYPE_FILE, resourceInfo.getType() ); when( resourceEntry.getResourcetype() ).thenReturn( ResourceEntry.ResourceType.FILE ); resourceInfo = ExternalResourceInfoFactory.createResource( resourceEntry, true ); assertEquals( DictionaryConst.NODE_TYPE_FILE, resourceInfo.getType() ); when( resourceEntry.getResourcetype() ).thenReturn( ResourceEntry.ResourceType.URL ); resourceInfo = ExternalResourceInfoFactory.createResource( resourceEntry ); assertEquals( DictionaryConst.NODE_TYPE_WEBSERVICE, resourceInfo.getType() ); when( resourceEntry.getResourcetype() ).thenReturn( ResourceEntry.ResourceType.CONNECTION ); resourceInfo = ExternalResourceInfoFactory.createResource( resourceEntry, false ); assertEquals( DictionaryConst.NODE_TYPE_DATASOURCE, resourceInfo.getType() ); when( resourceEntry.getResourcetype() ).thenReturn( ResourceEntry.ResourceType.DATABASENAME ); resourceInfo = ExternalResourceInfoFactory.createResource( resourceEntry ); assertEquals( DictionaryConst.NODE_TYPE_DATASOURCE, resourceInfo.getType() ); when( resourceEntry.getResourcetype() ).thenReturn( ResourceEntry.ResourceType.SERVER ); resourceInfo = ExternalResourceInfoFactory.createResource( resourceEntry ); assertEquals( "SERVER", resourceInfo.getType() ); when( resourceEntry.getResourcetype() ).thenReturn( ResourceEntry.ResourceType.OTHER ); resourceInfo = ExternalResourceInfoFactory.createResource( resourceEntry ); assertEquals( "OTHER", resourceInfo.getType() ); }