use of jenkins.plugins.nodejs.configfiles.NPMConfig.NPMConfigProvider in project nodejs-plugin by jenkinsci.
the class NodeJSBuildWrapperTest method createSetting.
private Config createSetting(String id, String content, List<NPMRegistry> registries) {
String providerId = new NPMConfigProvider().getProviderId();
Config config = new NPMConfig(id, null, null, content, providerId, registries);
GlobalConfigFiles globalConfigFiles = j.jenkins.getExtensionList(GlobalConfigFiles.class).get(GlobalConfigFiles.class);
globalConfigFiles.save(config);
return config;
}
use of jenkins.plugins.nodejs.configfiles.NPMConfig.NPMConfigProvider in project nodejs-plugin by jenkinsci.
the class NodeJSCommandInterpreterTest method createSetting.
private Config createSetting(String id, String content, List<NPMRegistry> registries) {
String providerId = new NPMConfigProvider().getProviderId();
Config config = new NPMConfig(id, null, null, content, providerId, registries);
GlobalConfigFiles globalConfigFiles = j.jenkins.getExtensionList(GlobalConfigFiles.class).get(GlobalConfigFiles.class);
globalConfigFiles.save(config);
return config;
}
use of jenkins.plugins.nodejs.configfiles.NPMConfig.NPMConfigProvider in project nodejs-plugin by jenkinsci.
the class NPMConfigTest method test_load_template.
@Test
public void test_load_template() {
Descriptor<?> descriptor = j.jenkins.getDescriptor(NPMConfig.class);
assertNotNull("NPMConfi descriptor not registered", descriptor);
assertThat("Unexpected descriptor class", descriptor, instanceOf(NPMConfigProvider.class));
NPMConfigProvider provider = (NPMConfigProvider) descriptor;
Config config = provider.newConfig("testId");
assertThat("Unexpected config class", config, instanceOf(NPMConfig.class));
assertThat("Expected the default template, instead got empty", config.content, allOf(notNullValue(), is(not(""))));
}
use of jenkins.plugins.nodejs.configfiles.NPMConfig.NPMConfigProvider in project nodejs-plugin by jenkinsci.
the class NpmrcFileSupplyTest method createSetting.
private Config createSetting(String id, String content, List<NPMRegistry> registries) {
String providerId = new NPMConfigProvider().getProviderId();
Config config = new NPMConfig(id, null, null, content, providerId, registries);
GlobalConfigFiles globalConfigFiles = j.jenkins.getExtensionList(GlobalConfigFiles.class).get(GlobalConfigFiles.class);
globalConfigFiles.save(config);
return config;
}
Aggregations