@Test @ExtendWith(TemporaryFolderExtension.class) void testLoadWithEnvironmentConfigFolderPath(TemporaryFolder temporaryFolder) throws IOException, DocumentParseException { DocumentTools documentTools = Mockito.mock(DocumentTools.class); File configFolder = temporaryFolder.createDirectory("config"); String xml = "<l7:Items xmlns:l7=\"http: " <l7:Name>Test MQ</l7:Name>\n" + " <l7:Id>101c874561f1c09907094335ae786924</l7:Id>\n" + " <l7:Type>SSG_ACTIVE</l7:Type>\n" + " <l7:Resource>\n" + " <l7:ActiveConnector id=\"101c874561f1c09907094335ae786924\">\n" + " <l7:Name>Test MQ</l7:Name>\n" + " <l7:Enabled>true</l7:Enabled>\n" + " <l7:Type>MqNative</l7:Type>\n" + " <l7:Properties>\n" + " <l7:Property key=\"MqNativeChannel\">\n" + " <l7:StringValue>SYSTEM.DEF.SVRCONN</l7:StringValue>\n" + " </l7:Property>\n" + " <l7:Property key=\"MqNativeHostName\">\n" + " <l7:StringValue>sfad</l7:StringValue>\n" + " </l7:Property>\n" + " <l7:Property key=\"MqNativeInboundIsFailedQueuePutMessageOptionsUsed\">\n" + " <l7:StringValue>false</l7:StringValue>\n" + " </l7:Property>\n" + " <l7:Property key=\"MqNativeInboundIsGetMessageOptionsUsed\">\n" + " <l7:StringValue>false</l7:StringValue>\n" + " </l7:Property>\n" + " <l7:Property key=\"MqNativeInboundIsOpenOptionsUsed\">\n" + " <l7:StringValue>false</l7:StringValue>\n" + " </l7:Property>\n" + " <l7:Property key=\"MqNativeInboundIsReplyQueuePutMessageOptionsUsed\">\n" + " <l7:StringValue>false</l7:StringValue>\n" + " </l7:Property>\n" + " <l7:Property key=\"MqNativeIsQueueCredentialRequired\">\n" + " <l7:StringValue>false</l7:StringValue>\n" + " </l7:Property>\n" + " <l7:Property key=\"MqNativeIsSslEnabled\">\n" + " <l7:StringValue>false</l7:StringValue>\n" + " </l7:Property>\n" + " <l7:Property key=\"MqNativeOutboundIsReplyQueueGetMessageOptionsUsed\">\n" + " <l7:StringValue>false</l7:StringValue>\n" + " </l7:Property>\n" + " <l7:Property key=\"MqNativeOutboundIsTemplateQueue\">\n" + " <l7:StringValue>false</l7:StringValue>\n" + " </l7:Property>\n" + " <l7:Property key=\"MqNativeOutboundMessageFormat\">\n" + " <l7:StringValue>AUTOMATIC</l7:StringValue>\n" + " </l7:Property>\n" + " <l7:Property key=\"MqNativePort\">\n" + " <l7:StringValue>24</l7:StringValue>\n" + " </l7:Property>\n" + " <l7:Property key=\"MqNativeQueueManagerName\">\n" + " <l7:StringValue>sfasdf</l7:StringValue>\n" + " </l7:Property>\n" + " <l7:Property key=\"MqNativeReplyType\">\n" + " <l7:StringValue>REPLY_NONE</l7:StringValue>\n" + " </l7:Property>\n" + " <l7:Property key=\"MqNativeTargetQueueName\">\n" + " <l7:StringValue>adsfa</l7:StringValue>\n" + " </l7:Property>\n" + " <l7:Property key=\"inbound\">\n" + " <l7:StringValue>false</l7:StringValue>\n" + " </l7:Property>\n" + " </l7:Properties>\n" + " </l7:ActiveConnector>\n" + " </l7:Resource>\n" + " </l7:Item></l7:Items>"; File xmlFile = new File(configFolder, "unsupported-entities.xml"); Files.touch(xmlFile); Mockito.when(documentTools.parse(Mockito.any(File.class))).thenReturn(DocumentTools.INSTANCE.parse(xml)); UnsupportedEntityLoader unsupportedEntityLoader = new UnsupportedEntityLoader(jsonTools, new IdGenerator(), documentTools); UnsupportedGatewayEntity gatewayEntity = new UnsupportedGatewayEntity(); gatewayEntity.setType("SSG_ACTIVE"); gatewayEntity.setName("Test MQ"); gatewayEntity.setId("101c874561f1c09907094335ae786924"); String yaml = jsonTools.getObjectWriter(JSON).writeValueAsString(gatewayEntity); Bundle bundle = new Bundle(); unsupportedEntityLoader.load(bundle, "SSG_ACTIVE/Test MQ", yaml, configFolder.getPath()); verifyConfig(bundle); }
@Override public void load(final Bundle bundle, final File rootDir) { super.load(bundle, rootDir); updateItemXml(bundle, new File(rootDir, "config")); }
UnsupportedEntityLoader extends EntityLoaderBase<UnsupportedGatewayEntity> implements EntityLoader { @Override public void load(final Bundle bundle, final File rootDir) { super.load(bundle, rootDir); updateItemXml(bundle, new File(rootDir, "config")); } }
UnsupportedEntityLoader extends EntityLoaderBase<UnsupportedGatewayEntity> implements EntityLoader { @Override public void load(final Bundle bundle, final File rootDir) { super.load(bundle, rootDir); updateItemXml(bundle, new File(rootDir, "config")); } @Inject  UnsupportedEntityLoader(final JsonTools jsonTools, final IdGenerator idGenerator, final DocumentTools documentTools); }
UnsupportedEntityLoader extends EntityLoaderBase<UnsupportedGatewayEntity> implements EntityLoader { @Override public void load(final Bundle bundle, final File rootDir) { super.load(bundle, rootDir); updateItemXml(bundle, new File(rootDir, "config")); } @Inject  UnsupportedEntityLoader(final JsonTools jsonTools, final IdGenerator idGenerator, final DocumentTools documentTools); @Override void load(final Bundle bundle, final File rootDir); @Override void load(Bundle bundle, String name, String value, String environmentConfigurationFolderPath); @Override String getEntityType(); }
UnsupportedEntityLoader extends EntityLoaderBase<UnsupportedGatewayEntity> implements EntityLoader { @Override public void load(final Bundle bundle, final File rootDir) { super.load(bundle, rootDir); updateItemXml(bundle, new File(rootDir, "config")); } @Inject  UnsupportedEntityLoader(final JsonTools jsonTools, final IdGenerator idGenerator, final DocumentTools documentTools); @Override void load(final Bundle bundle, final File rootDir); @Override void load(Bundle bundle, String name, String value, String environmentConfigurationFolderPath); @Override String getEntityType();  }