@Test void generate_OtherPlatformKey() { final String platform = Platform.STACK_OVERFLOW.name(); final String platformId = "sgfgasfdgshd5"; final String expected = "someKey"; when(fallbackKeyGenerator.generate(randomTarget, randomMethod, platform, platformId)).thenReturn(expected); final String result = (String) keyGenerator.generate(randomTarget, randomMethod, platform, platformId); assertThat(result).isEqualTo(expected); }
@Override public Object generate(final Object target, final Method method, final Object... params) { final String platform = (String) params[0]; if (Platform.GITHUB.name().equalsIgnoreCase(platform)) { return generateGitHubKey(platform, (String) params[1]); } return fallbackKeyGenerator.generate(target, method, params); }
GetAllPossibleTokensKeyGenerator implements KeyGenerator { @Override public Object generate(final Object target, final Method method, final Object... params) { final String platform = (String) params[0]; if (Platform.GITHUB.name().equalsIgnoreCase(platform)) { return generateGitHubKey(platform, (String) params[1]); } return fallbackKeyGenerator.generate(target, method, params); } }
GetAllPossibleTokensKeyGenerator implements KeyGenerator { @Override public Object generate(final Object target, final Method method, final Object... params) { final String platform = (String) params[0]; if (Platform.GITHUB.name().equalsIgnoreCase(platform)) { return generateGitHubKey(platform, (String) params[1]); } return fallbackKeyGenerator.generate(target, method, params); } GetAllPossibleTokensKeyGenerator(final KeyGenerator simpleKeyGenerator); }
GetAllPossibleTokensKeyGenerator implements KeyGenerator { @Override public Object generate(final Object target, final Method method, final Object... params) { final String platform = (String) params[0]; if (Platform.GITHUB.name().equalsIgnoreCase(platform)) { return generateGitHubKey(platform, (String) params[1]); } return fallbackKeyGenerator.generate(target, method, params); } GetAllPossibleTokensKeyGenerator(final KeyGenerator simpleKeyGenerator); @Override Object generate(final Object target, final Method method, final Object... params); }
GetAllPossibleTokensKeyGenerator implements KeyGenerator { @Override public Object generate(final Object target, final Method method, final Object... params) { final String platform = (String) params[0]; if (Platform.GITHUB.name().equalsIgnoreCase(platform)) { return generateGitHubKey(platform, (String) params[1]); } return fallbackKeyGenerator.generate(target, method, params); } GetAllPossibleTokensKeyGenerator(final KeyGenerator simpleKeyGenerator); @Override Object generate(final Object target, final Method method, final Object... params);  }