LinuxSettingsGenerator implements ResourceGenerator<UserCredentials> { @NotNull @Override public String create(@NotNull final UserCredentials userCredentials) { final StringBuilder sb = new StringBuilder(); final String user = userCredentials.getUser(); if(!StringUtil.isEmptyOrSpaces(user)) { sb.append(userCredentials.getUser()); } return sb.toString(); }  @NotNull @Override String create(@NotNull final UserCredentials userCredentials);  }
@Test() public void shouldGenerateContent() { final String expectedContent = "nik"; final List<CommandLineArgument> additionalArgs = Arrays.asList(new CommandLineArgument("arg1", CommandLineArgument.Type.PARAMETER), new CommandLineArgument("arg 2", CommandLineArgument.Type.PARAMETER)); final ResourceGenerator<UserCredentials> instance = createInstance(); final String content = instance.create(new UserCredentials("", "nik", "aaa", WindowsIntegrityLevel.Auto, LoggingLevel.Off, additionalArgs)); myCtx.assertIsSatisfied(); then(content.trim().replace("\n", " ").replace("\r", "")).isEqualTo(expectedContent.trim().replace("\n", " ").replace("\r", "")); }