PlatformCredentialsAuthorizationProvider implements AuthorizationProvider { @Override public String get() throws IOException { return read(type) + " " + read(secret); } PlatformCredentialsAuthorizationProvider(final String name);  PlatformCredentialsAuthorizationProvider(final Path directory, final String name); @Override String get();  }
@Test void shouldSupplyOAuthToken() throws IOException { final AuthorizationProvider unit = new PlatformCredentialsAuthorizationProvider( Paths.get("src/test/resources/meta/credentials"), "example"); assertEquals("Bearer eyJhbGciOiJub25lIiwidHlwIjoiSldUIn0.e30.", unit.get()); }
@Test void shouldFailOnEmptyFile() { final AuthorizationProvider unit = new PlatformCredentialsAuthorizationProvider( Paths.get("src/test/resources/meta/credentials"), "empty"); assertThrows(IndexOutOfBoundsException.class, unit::get); }