use of com.cloudbees.jenkins.support.api.Content in project support-core-plugin by jenkinsci.
the class AgentsConfigFileTest method agentsConfigFile.
@Test
public void agentsConfigFile() throws Exception {
j.createSlave("node1", "node1", new EnvVars());
AgentsConfigFile comp = new AgentsConfigFile();
ByteArrayOutputStream baos = new ByteArrayOutputStream();
comp.addContents(new Container() {
@Override
public void add(@CheckForNull Content content) {
try {
content.writeTo(baos);
} catch (IOException e) {
fail(e.getMessage());
}
}
});
String fileContent = baos.toString();
assertTrue(fileContent.contains("<name>node1</name>"));
}
Aggregations