@BeforeClass
public static void setUpAgentAndCreds() throws Exception {
s = j.createOnlineSlave();
s.setLabelString("some-label docker here");
s.getNodeProperties().add(new EnvironmentVariablesNodeProperty(new EnvironmentVariablesNodeProperty.Entry("ONAGENT", "true"),
new EnvironmentVariablesNodeProperty.Entry("WHICH_AGENT", "first")));
s.setNumExecutors(2);
s2 = j.createOnlineSlave();
s2.setLabelString("other-docker");
s2.getNodeProperties().add(new EnvironmentVariablesNodeProperty(new EnvironmentVariablesNodeProperty.Entry("ONAGENT", "true"),
new EnvironmentVariablesNodeProperty.Entry("WHICH_AGENT", "second")));
CredentialsStore store = CredentialsProvider.lookupStores(j.jenkins).iterator().next();
String usernamePasswordCredentialsId = "FOOcredentials";
UsernamePasswordCredentialsImpl usernamePassword = new UsernamePasswordCredentialsImpl(CredentialsScope.GLOBAL, usernamePasswordCredentialsId, "sample", usernamePasswordUsername, usernamePasswordPassword);
store.addCredentials(Domain.global(), usernamePassword);
}