@Test
public void testEnvironmentBuild(){

    UnsupportedEntityBuilder unsupportedEntityBuilder = new UnsupportedEntityBuilder();
    Bundle bundle = new Bundle();
    String entityName = "TestEntity";
    String elementName = "TestElement";
    Document document = DocumentTools.INSTANCE.getDocumentBuilder().newDocument();
    Element element = document.createElement(elementName);
    Map<String, UnsupportedGatewayEntity> unsupportedGatewayEntityMap =  bundle.getUnsupportedEntities();
    UnsupportedGatewayEntity unsupportedGatewayEntity = new UnsupportedGatewayEntity();
    unsupportedGatewayEntity.setName(entityName);
    unsupportedGatewayEntity.setType("SSG_ACTIVE_CONNECTOR");
    unsupportedGatewayEntity.setId("testId");
    unsupportedGatewayEntity.setElement(element);
    unsupportedGatewayEntityMap.put(entityName, unsupportedGatewayEntity);
    List<Entity> entities = unsupportedEntityBuilder.build(bundle, EntityBuilder.BundleType.ENVIRONMENT, document);
    Assert.assertEquals(1, entities.size());
    Entity entity = entities.get(0);
    Assert.assertNotNull(entity.getXml());
    Assert.assertEquals(entityName, entity.getName());
    Assert.assertEquals("SSG_ACTIVE_CONNECTOR", entity.getType());
    Assert.assertEquals(elementName, entity.getXml().getTagName());
    AnnotatedBundle annotatedBundle = new AnnotatedBundle(null, null, null);
    unsupportedGatewayEntityMap =  annotatedBundle.getUnsupportedEntities();
    unsupportedGatewayEntityMap.put("TestEntity", unsupportedGatewayEntity);
    entities = unsupportedEntityBuilder.build(annotatedBundle, EntityBuilder.BundleType.ENVIRONMENT, document);
    Assert.assertEquals(1, entities.size());
    entity = entities.get(0);
    Assert.assertNotNull(entity.getXml());
    Assert.assertEquals(entityName, entity.getName());
    Assert.assertEquals("SSG_ACTIVE_CONNECTOR", entity.getType());
    Assert.assertEquals(elementName, entity.getXml().getTagName());
}