@Test public void getUserAgent_createsConcatenatedStringOfSdkVersions() { String[] expectedUserAgent = {"bar/2", "foo/1"}; String[] actualUserAgent = userAgentPublisher.getUserAgent().split(" "); Arrays.sort(actualUserAgent); assertThat(actualUserAgent).isEqualTo(expectedUserAgent); }
@Override public String getUserAgent() { if (gamesSDKRegistrar.getRegisteredVersions().isEmpty()) { return javaSDKVersionUserAgent; } return javaSDKVersionUserAgent + ' ' + toUserAgent(gamesSDKRegistrar.getRegisteredVersions()); }
DefaultUserAgentPublisher implements UserAgentPublisher { @Override public String getUserAgent() { if (gamesSDKRegistrar.getRegisteredVersions().isEmpty()) { return javaSDKVersionUserAgent; } return javaSDKVersionUserAgent + ' ' + toUserAgent(gamesSDKRegistrar.getRegisteredVersions()); } }
DefaultUserAgentPublisher implements UserAgentPublisher { @Override public String getUserAgent() { if (gamesSDKRegistrar.getRegisteredVersions().isEmpty()) { return javaSDKVersionUserAgent; } return javaSDKVersionUserAgent + ' ' + toUserAgent(gamesSDKRegistrar.getRegisteredVersions()); } DefaultUserAgentPublisher(
      Set<LibraryVersion> libraryVersions, GlobalLibraryVersionRegistrar gamesSDKRegistrar); }
DefaultUserAgentPublisher implements UserAgentPublisher { @Override public String getUserAgent() { if (gamesSDKRegistrar.getRegisteredVersions().isEmpty()) { return javaSDKVersionUserAgent; } return javaSDKVersionUserAgent + ' ' + toUserAgent(gamesSDKRegistrar.getRegisteredVersions()); } DefaultUserAgentPublisher(
      Set<LibraryVersion> libraryVersions, GlobalLibraryVersionRegistrar gamesSDKRegistrar); @Override String getUserAgent(); static Component<UserAgentPublisher> component(); }
DefaultUserAgentPublisher implements UserAgentPublisher { @Override public String getUserAgent() { if (gamesSDKRegistrar.getRegisteredVersions().isEmpty()) { return javaSDKVersionUserAgent; } return javaSDKVersionUserAgent + ' ' + toUserAgent(gamesSDKRegistrar.getRegisteredVersions()); } DefaultUserAgentPublisher(
      Set<LibraryVersion> libraryVersions, GlobalLibraryVersionRegistrar gamesSDKRegistrar); @Override String getUserAgent(); static Component<UserAgentPublisher> component();  }