@Test
public void testCreatePuppetScript() throws Exception {
Pool pool = mock(Pool.class);
final AdminAccess adminAccess = AdminAccess.builder()
.privateKey(TestConstants.PRIVATE_KEY)
.publicKey(TestConstants.PUBLIC_KEY)
.username(System.getProperty("user.name"))
.createAdminAccess();
when(pool.getAdminAccess()).thenReturn(adminAccess);
PuppetActivity activity = new SetupAdminAccess();
String content = activity.createPuppetScript(pool, null);
final String username = adminAccess.getUsername();
assertThat(content).contains(username)
.contains(adminAccess.getPublicKey().split(" ")[1])
.contains(String.format("user { \"%s\":", username))
.contains(String.format("file { \"/home/%s/.ssh\":", username));
}