HaloCore { @Keep @NonNull public Credentials credentials() { return mAuthenticator.getCredentials(); } HaloCore(@NonNull HaloFramework framework,
                    @NonNull HaloManagerApi managerApi,
                    @NonNull HaloSessionManager sessionManager,
                    @Nullable Credentials credentials,
                    @Nullable List<TagCollector> tagCollectors); @Keep @Api(1.3) @NonNull HaloSessionManager sessionManager(); @Keep @Api(1.3) boolean debug(); @Keep @NonNull Credentials credentials(); @Keep @Api(1.3) void credentials(@NonNull Credentials credentials); @Keep @Api(1.3) void logout(); @Keep @Api(1.3) @NonNull String version(); @Keep @Api(1.3) void flushSession(); @Keep @Api(2.1) void haloAuthRecover(@NonNull AuthenticationRecover authenticationRecover); @Nullable @Keep @Api(2.1) AuthenticationRecover haloAuthRecover(); @Keep @Api(1.3) @NonNull HaloFramework framework(); @Keep @Api(2.0) @NonNull HaloManagerApi manager(); @Keep @Api(1.3) @NonNull List<TagCollector> tagCollectors(); @HaloServerVersion.VersionCheck int serverVersionCheck(); void serverVersionCheck(@Nullable HaloServerVersion version); @NonNull List<HaloSegmentationTag> segmentationTags(); @Keep @Api(1.3) boolean isVersionValid();  }
@Test public void thatCanConfigureCredentials() { Credentials credentials = Credentials.createClient("myClientId", "myClientSecret"); HaloCore core = HaloMock.createCore(credentials); assertThat(core.credentials()).isNotNull(); assertThat(core.credentials().getUsername()).isEqualTo("myClientId"); assertThat(core.credentials().getPassword()).isEqualTo("myClientSecret"); }
@Test public void thatCanCreateNewCredentials() { Credentials credentials = Credentials.createClient("myClient", "myPass"); HaloCore core = HaloMock.createCore(credentials, null); core.credentials(Credentials.createClient("newClient", "newSecret")); assertThat(core.credentials()).isNotEqualTo(credentials); assertThat(core.credentials()); assertThat(credentials.getUsername().equals(core.credentials().getUsername())).isFalse(); assertThat(credentials.getPassword().equals(core.credentials().getPassword())).isFalse(); assertThat(core.credentials().getUsername()).isEqualTo("newClient"); assertThat(core.credentials().getPassword()).isEqualTo("newSecret"); }