target
stringlengths
20
113k
src_fm
stringlengths
11
86.3k
src_fm_fc
stringlengths
21
86.4k
src_fm_fc_co
stringlengths
30
86.4k
src_fm_fc_ms
stringlengths
42
86.8k
src_fm_fc_ms_ff
stringlengths
43
86.8k
@Test public void shouldReturnAllTokens1() { final String input = "___${____${TOKEN_1}__}___${TOKEN_2}__"; final List<String> tokens = StringUtils.allTokens(input, startDelimiter, endDelimiter); assertEquals(2, tokens.size()); assertEquals("TOKEN_1", tokens.get(0)); assertEquals("TOKEN_2", tokens.get(1)); }
public static List<String> allTokens(String input, String startDelimiter, String endDelimiter) { final List<String> tokens = new ArrayList<>(); Optional<String> token = firstToken(input, startDelimiter, endDelimiter); while(token.isPresent()) { final String tokenValue = token.get(); tokens.add(tokenValue); input = inpu...
StringUtils { public static List<String> allTokens(String input, String startDelimiter, String endDelimiter) { final List<String> tokens = new ArrayList<>(); Optional<String> token = firstToken(input, startDelimiter, endDelimiter); while(token.isPresent()) { final String tokenValue = token.get(); tokens.add(tokenValue)...
StringUtils { public static List<String> allTokens(String input, String startDelimiter, String endDelimiter) { final List<String> tokens = new ArrayList<>(); Optional<String> token = firstToken(input, startDelimiter, endDelimiter); while(token.isPresent()) { final String tokenValue = token.get(); tokens.add(tokenValue)...
StringUtils { public static List<String> allTokens(String input, String startDelimiter, String endDelimiter) { final List<String> tokens = new ArrayList<>(); Optional<String> token = firstToken(input, startDelimiter, endDelimiter); while(token.isPresent()) { final String tokenValue = token.get(); tokens.add(tokenValue)...
StringUtils { public static List<String> allTokens(String input, String startDelimiter, String endDelimiter) { final List<String> tokens = new ArrayList<>(); Optional<String> token = firstToken(input, startDelimiter, endDelimiter); while(token.isPresent()) { final String tokenValue = token.get(); tokens.add(tokenValue)...
@Test public void shouldReturnAllTokens2() { final String input = "___${____${TOKEN_1__}___${TOKEN_2}__"; final List<String> tokens = StringUtils.allTokens(input, startDelimiter, endDelimiter); assertEquals(2, tokens.size()); assertEquals("TOKEN_1__", tokens.get(0)); assertEquals("TOKEN_2", tokens.get(1)); }
public static List<String> allTokens(String input, String startDelimiter, String endDelimiter) { final List<String> tokens = new ArrayList<>(); Optional<String> token = firstToken(input, startDelimiter, endDelimiter); while(token.isPresent()) { final String tokenValue = token.get(); tokens.add(tokenValue); input = inpu...
StringUtils { public static List<String> allTokens(String input, String startDelimiter, String endDelimiter) { final List<String> tokens = new ArrayList<>(); Optional<String> token = firstToken(input, startDelimiter, endDelimiter); while(token.isPresent()) { final String tokenValue = token.get(); tokens.add(tokenValue)...
StringUtils { public static List<String> allTokens(String input, String startDelimiter, String endDelimiter) { final List<String> tokens = new ArrayList<>(); Optional<String> token = firstToken(input, startDelimiter, endDelimiter); while(token.isPresent()) { final String tokenValue = token.get(); tokens.add(tokenValue)...
StringUtils { public static List<String> allTokens(String input, String startDelimiter, String endDelimiter) { final List<String> tokens = new ArrayList<>(); Optional<String> token = firstToken(input, startDelimiter, endDelimiter); while(token.isPresent()) { final String tokenValue = token.get(); tokens.add(tokenValue)...
StringUtils { public static List<String> allTokens(String input, String startDelimiter, String endDelimiter) { final List<String> tokens = new ArrayList<>(); Optional<String> token = firstToken(input, startDelimiter, endDelimiter); while(token.isPresent()) { final String tokenValue = token.get(); tokens.add(tokenValue)...
@Test public void shouldReturnAllTokens3() { final String input = "___${____${TOKEN_2}_}___${TOKEN_2}__"; final List<String> tokens = StringUtils.allTokens(input, startDelimiter, endDelimiter); assertEquals(2, tokens.size()); assertEquals("TOKEN_2", tokens.get(0)); assertEquals("TOKEN_2", tokens.get(1)); }
public static List<String> allTokens(String input, String startDelimiter, String endDelimiter) { final List<String> tokens = new ArrayList<>(); Optional<String> token = firstToken(input, startDelimiter, endDelimiter); while(token.isPresent()) { final String tokenValue = token.get(); tokens.add(tokenValue); input = inpu...
StringUtils { public static List<String> allTokens(String input, String startDelimiter, String endDelimiter) { final List<String> tokens = new ArrayList<>(); Optional<String> token = firstToken(input, startDelimiter, endDelimiter); while(token.isPresent()) { final String tokenValue = token.get(); tokens.add(tokenValue)...
StringUtils { public static List<String> allTokens(String input, String startDelimiter, String endDelimiter) { final List<String> tokens = new ArrayList<>(); Optional<String> token = firstToken(input, startDelimiter, endDelimiter); while(token.isPresent()) { final String tokenValue = token.get(); tokens.add(tokenValue)...
StringUtils { public static List<String> allTokens(String input, String startDelimiter, String endDelimiter) { final List<String> tokens = new ArrayList<>(); Optional<String> token = firstToken(input, startDelimiter, endDelimiter); while(token.isPresent()) { final String tokenValue = token.get(); tokens.add(tokenValue)...
StringUtils { public static List<String> allTokens(String input, String startDelimiter, String endDelimiter) { final List<String> tokens = new ArrayList<>(); Optional<String> token = firstToken(input, startDelimiter, endDelimiter); while(token.isPresent()) { final String tokenValue = token.get(); tokens.add(tokenValue)...
@Test public void shouldReturnAllTokens4() { final String input = "___${____${TOKEN_1}_${TOKEN_2}_}___${TOKEN_2}_${${TOKEN_3}}_"; final List<String> tokens = StringUtils.allTokens(input, startDelimiter, endDelimiter, false); assertEquals(4, tokens.size()); assertEquals("TOKEN_1", tokens.get(0)); assertEquals("TOKEN_2",...
public static List<String> allTokens(String input, String startDelimiter, String endDelimiter) { final List<String> tokens = new ArrayList<>(); Optional<String> token = firstToken(input, startDelimiter, endDelimiter); while(token.isPresent()) { final String tokenValue = token.get(); tokens.add(tokenValue); input = inpu...
StringUtils { public static List<String> allTokens(String input, String startDelimiter, String endDelimiter) { final List<String> tokens = new ArrayList<>(); Optional<String> token = firstToken(input, startDelimiter, endDelimiter); while(token.isPresent()) { final String tokenValue = token.get(); tokens.add(tokenValue)...
StringUtils { public static List<String> allTokens(String input, String startDelimiter, String endDelimiter) { final List<String> tokens = new ArrayList<>(); Optional<String> token = firstToken(input, startDelimiter, endDelimiter); while(token.isPresent()) { final String tokenValue = token.get(); tokens.add(tokenValue)...
StringUtils { public static List<String> allTokens(String input, String startDelimiter, String endDelimiter) { final List<String> tokens = new ArrayList<>(); Optional<String> token = firstToken(input, startDelimiter, endDelimiter); while(token.isPresent()) { final String tokenValue = token.get(); tokens.add(tokenValue)...
StringUtils { public static List<String> allTokens(String input, String startDelimiter, String endDelimiter) { final List<String> tokens = new ArrayList<>(); Optional<String> token = firstToken(input, startDelimiter, endDelimiter); while(token.isPresent()) { final String tokenValue = token.get(); tokens.add(tokenValue)...
@Test public void shouldReturnUniqueTokens1() { final String input = "___${____${TOKEN_2}_}___${TOKEN_2}__"; final List<String> tokens = StringUtils.allTokens(input, startDelimiter, endDelimiter, true); assertEquals(1, tokens.size()); assertEquals("TOKEN_2", tokens.get(0)); }
public static List<String> allTokens(String input, String startDelimiter, String endDelimiter) { final List<String> tokens = new ArrayList<>(); Optional<String> token = firstToken(input, startDelimiter, endDelimiter); while(token.isPresent()) { final String tokenValue = token.get(); tokens.add(tokenValue); input = inpu...
StringUtils { public static List<String> allTokens(String input, String startDelimiter, String endDelimiter) { final List<String> tokens = new ArrayList<>(); Optional<String> token = firstToken(input, startDelimiter, endDelimiter); while(token.isPresent()) { final String tokenValue = token.get(); tokens.add(tokenValue)...
StringUtils { public static List<String> allTokens(String input, String startDelimiter, String endDelimiter) { final List<String> tokens = new ArrayList<>(); Optional<String> token = firstToken(input, startDelimiter, endDelimiter); while(token.isPresent()) { final String tokenValue = token.get(); tokens.add(tokenValue)...
StringUtils { public static List<String> allTokens(String input, String startDelimiter, String endDelimiter) { final List<String> tokens = new ArrayList<>(); Optional<String> token = firstToken(input, startDelimiter, endDelimiter); while(token.isPresent()) { final String tokenValue = token.get(); tokens.add(tokenValue)...
StringUtils { public static List<String> allTokens(String input, String startDelimiter, String endDelimiter) { final List<String> tokens = new ArrayList<>(); Optional<String> token = firstToken(input, startDelimiter, endDelimiter); while(token.isPresent()) { final String tokenValue = token.get(); tokens.add(tokenValue)...
@Test public void shouldReturnUniqueTokens2() { final String input = "___${____${TOKEN_1}_${TOKEN_2}_}___${TOKEN_2}_${${TOKEN_3}}_"; final List<String> tokens = StringUtils.allTokens(input, startDelimiter, endDelimiter, true); assertEquals(3, tokens.size()); assertEquals("TOKEN_1", tokens.get(0)); assertEquals("TOKEN_2...
public static List<String> allTokens(String input, String startDelimiter, String endDelimiter) { final List<String> tokens = new ArrayList<>(); Optional<String> token = firstToken(input, startDelimiter, endDelimiter); while(token.isPresent()) { final String tokenValue = token.get(); tokens.add(tokenValue); input = inpu...
StringUtils { public static List<String> allTokens(String input, String startDelimiter, String endDelimiter) { final List<String> tokens = new ArrayList<>(); Optional<String> token = firstToken(input, startDelimiter, endDelimiter); while(token.isPresent()) { final String tokenValue = token.get(); tokens.add(tokenValue)...
StringUtils { public static List<String> allTokens(String input, String startDelimiter, String endDelimiter) { final List<String> tokens = new ArrayList<>(); Optional<String> token = firstToken(input, startDelimiter, endDelimiter); while(token.isPresent()) { final String tokenValue = token.get(); tokens.add(tokenValue)...
StringUtils { public static List<String> allTokens(String input, String startDelimiter, String endDelimiter) { final List<String> tokens = new ArrayList<>(); Optional<String> token = firstToken(input, startDelimiter, endDelimiter); while(token.isPresent()) { final String tokenValue = token.get(); tokens.add(tokenValue)...
StringUtils { public static List<String> allTokens(String input, String startDelimiter, String endDelimiter) { final List<String> tokens = new ArrayList<>(); Optional<String> token = firstToken(input, startDelimiter, endDelimiter); while(token.isPresent()) { final String tokenValue = token.get(); tokens.add(tokenValue)...
@Test public void shouldReadFileFromRelativePath() throws IOException { try (InputStream is = FileUtils.getStream("./src/test/files/test1.properties")) { final String content = toString(is); assertNotNull(content); assertTrue(content.contains("keyOne")); } }
public static InputStream getStream(String resourcePath) throws FileNotFoundException { if (resourcePath.startsWith(CLASSPATH_PREFIX)) { final String resourceName = resourcePath.substring(CLASSPATH_PREFIX.length()); final InputStream is = FileUtils.class.getClassLoader().getResourceAsStream(resourceName); if (is == nul...
FileUtils { public static InputStream getStream(String resourcePath) throws FileNotFoundException { if (resourcePath.startsWith(CLASSPATH_PREFIX)) { final String resourceName = resourcePath.substring(CLASSPATH_PREFIX.length()); final InputStream is = FileUtils.class.getClassLoader().getResourceAsStream(resourceName); i...
FileUtils { public static InputStream getStream(String resourcePath) throws FileNotFoundException { if (resourcePath.startsWith(CLASSPATH_PREFIX)) { final String resourceName = resourcePath.substring(CLASSPATH_PREFIX.length()); final InputStream is = FileUtils.class.getClassLoader().getResourceAsStream(resourceName); i...
FileUtils { public static InputStream getStream(String resourcePath) throws FileNotFoundException { if (resourcePath.startsWith(CLASSPATH_PREFIX)) { final String resourceName = resourcePath.substring(CLASSPATH_PREFIX.length()); final InputStream is = FileUtils.class.getClassLoader().getResourceAsStream(resourceName); i...
FileUtils { public static InputStream getStream(String resourcePath) throws FileNotFoundException { if (resourcePath.startsWith(CLASSPATH_PREFIX)) { final String resourceName = resourcePath.substring(CLASSPATH_PREFIX.length()); final InputStream is = FileUtils.class.getClassLoader().getResourceAsStream(resourceName); i...
@Test public void shouldReadFileFromRelativePathWithPrefix() throws IOException { try (InputStream is = FileUtils.getStream("file:src/test/files/test1.properties")) { final String content = toString(is); assertNotNull(content); assertTrue(content.contains("keyOne")); } }
public static InputStream getStream(String resourcePath) throws FileNotFoundException { if (resourcePath.startsWith(CLASSPATH_PREFIX)) { final String resourceName = resourcePath.substring(CLASSPATH_PREFIX.length()); final InputStream is = FileUtils.class.getClassLoader().getResourceAsStream(resourceName); if (is == nul...
FileUtils { public static InputStream getStream(String resourcePath) throws FileNotFoundException { if (resourcePath.startsWith(CLASSPATH_PREFIX)) { final String resourceName = resourcePath.substring(CLASSPATH_PREFIX.length()); final InputStream is = FileUtils.class.getClassLoader().getResourceAsStream(resourceName); i...
FileUtils { public static InputStream getStream(String resourcePath) throws FileNotFoundException { if (resourcePath.startsWith(CLASSPATH_PREFIX)) { final String resourceName = resourcePath.substring(CLASSPATH_PREFIX.length()); final InputStream is = FileUtils.class.getClassLoader().getResourceAsStream(resourceName); i...
FileUtils { public static InputStream getStream(String resourcePath) throws FileNotFoundException { if (resourcePath.startsWith(CLASSPATH_PREFIX)) { final String resourceName = resourcePath.substring(CLASSPATH_PREFIX.length()); final InputStream is = FileUtils.class.getClassLoader().getResourceAsStream(resourceName); i...
FileUtils { public static InputStream getStream(String resourcePath) throws FileNotFoundException { if (resourcePath.startsWith(CLASSPATH_PREFIX)) { final String resourceName = resourcePath.substring(CLASSPATH_PREFIX.length()); final InputStream is = FileUtils.class.getClassLoader().getResourceAsStream(resourceName); i...
@Test public void shouldReadFileFromAbsolutePath() throws IOException { final String absolutePath = new File("src/test/files/test1.properties").getAbsolutePath(); try (InputStream is = FileUtils.getStream(absolutePath)) { final String content = toString(is); assertNotNull(content); assertTrue(content.contains("keyOne")...
public static InputStream getStream(String resourcePath) throws FileNotFoundException { if (resourcePath.startsWith(CLASSPATH_PREFIX)) { final String resourceName = resourcePath.substring(CLASSPATH_PREFIX.length()); final InputStream is = FileUtils.class.getClassLoader().getResourceAsStream(resourceName); if (is == nul...
FileUtils { public static InputStream getStream(String resourcePath) throws FileNotFoundException { if (resourcePath.startsWith(CLASSPATH_PREFIX)) { final String resourceName = resourcePath.substring(CLASSPATH_PREFIX.length()); final InputStream is = FileUtils.class.getClassLoader().getResourceAsStream(resourceName); i...
FileUtils { public static InputStream getStream(String resourcePath) throws FileNotFoundException { if (resourcePath.startsWith(CLASSPATH_PREFIX)) { final String resourceName = resourcePath.substring(CLASSPATH_PREFIX.length()); final InputStream is = FileUtils.class.getClassLoader().getResourceAsStream(resourceName); i...
FileUtils { public static InputStream getStream(String resourcePath) throws FileNotFoundException { if (resourcePath.startsWith(CLASSPATH_PREFIX)) { final String resourceName = resourcePath.substring(CLASSPATH_PREFIX.length()); final InputStream is = FileUtils.class.getClassLoader().getResourceAsStream(resourceName); i...
FileUtils { public static InputStream getStream(String resourcePath) throws FileNotFoundException { if (resourcePath.startsWith(CLASSPATH_PREFIX)) { final String resourceName = resourcePath.substring(CLASSPATH_PREFIX.length()); final InputStream is = FileUtils.class.getClassLoader().getResourceAsStream(resourceName); i...
@Test public void shouldReturnEmptyOptionalInteger() { final Map<String, String> properties = new HashMap<>(); properties.put("key.one", "value.one"); properties.put("key.two", "value.two"); final Properlty prop = buildProperlty(properties); assertFalse(prop.getInt("key.three").isPresent()); }
public Optional<Integer> getInt(String key) { return get(key).map(Integer::parseInt); }
Properlty { public Optional<Integer> getInt(String key) { return get(key).map(Integer::parseInt); } }
Properlty { public Optional<Integer> getInt(String key) { return get(key).map(Integer::parseInt); } Properlty(boolean caseSensitive, Map<String, PropertyValue> properties); }
Properlty { public Optional<Integer> getInt(String key) { return get(key).map(Integer::parseInt); } Properlty(boolean caseSensitive, Map<String, PropertyValue> properties); static ProperltyBuilder builder(); Optional<String> get(String key); String get(String key, String defaultValue); Optional<T> get(String key, Funct...
Properlty { public Optional<Integer> getInt(String key) { return get(key).map(Integer::parseInt); } Properlty(boolean caseSensitive, Map<String, PropertyValue> properties); static ProperltyBuilder builder(); Optional<String> get(String key); String get(String key, String defaultValue); Optional<T> get(String key, Funct...
@Test public void shouldReadFileFromAbsolutePathWithPrefix() throws IOException { final String absolutePath = new File("src/test/files/test1.properties").getAbsolutePath(); try (InputStream is = FileUtils.getStream("file:" + absolutePath)) { final String content = toString(is); assertNotNull(content); assertTrue(conten...
public static InputStream getStream(String resourcePath) throws FileNotFoundException { if (resourcePath.startsWith(CLASSPATH_PREFIX)) { final String resourceName = resourcePath.substring(CLASSPATH_PREFIX.length()); final InputStream is = FileUtils.class.getClassLoader().getResourceAsStream(resourceName); if (is == nul...
FileUtils { public static InputStream getStream(String resourcePath) throws FileNotFoundException { if (resourcePath.startsWith(CLASSPATH_PREFIX)) { final String resourceName = resourcePath.substring(CLASSPATH_PREFIX.length()); final InputStream is = FileUtils.class.getClassLoader().getResourceAsStream(resourceName); i...
FileUtils { public static InputStream getStream(String resourcePath) throws FileNotFoundException { if (resourcePath.startsWith(CLASSPATH_PREFIX)) { final String resourceName = resourcePath.substring(CLASSPATH_PREFIX.length()); final InputStream is = FileUtils.class.getClassLoader().getResourceAsStream(resourceName); i...
FileUtils { public static InputStream getStream(String resourcePath) throws FileNotFoundException { if (resourcePath.startsWith(CLASSPATH_PREFIX)) { final String resourceName = resourcePath.substring(CLASSPATH_PREFIX.length()); final InputStream is = FileUtils.class.getClassLoader().getResourceAsStream(resourceName); i...
FileUtils { public static InputStream getStream(String resourcePath) throws FileNotFoundException { if (resourcePath.startsWith(CLASSPATH_PREFIX)) { final String resourceName = resourcePath.substring(CLASSPATH_PREFIX.length()); final InputStream is = FileUtils.class.getClassLoader().getResourceAsStream(resourceName); i...
@Test public void shouldReadFileFromClasspath() throws IOException { try (InputStream is = FileUtils.getStream("classpath:resource1.properties")) { final String content = toString(is); assertNotNull(content); assertTrue(content.contains("name=resource1")); } }
public static InputStream getStream(String resourcePath) throws FileNotFoundException { if (resourcePath.startsWith(CLASSPATH_PREFIX)) { final String resourceName = resourcePath.substring(CLASSPATH_PREFIX.length()); final InputStream is = FileUtils.class.getClassLoader().getResourceAsStream(resourceName); if (is == nul...
FileUtils { public static InputStream getStream(String resourcePath) throws FileNotFoundException { if (resourcePath.startsWith(CLASSPATH_PREFIX)) { final String resourceName = resourcePath.substring(CLASSPATH_PREFIX.length()); final InputStream is = FileUtils.class.getClassLoader().getResourceAsStream(resourceName); i...
FileUtils { public static InputStream getStream(String resourcePath) throws FileNotFoundException { if (resourcePath.startsWith(CLASSPATH_PREFIX)) { final String resourceName = resourcePath.substring(CLASSPATH_PREFIX.length()); final InputStream is = FileUtils.class.getClassLoader().getResourceAsStream(resourceName); i...
FileUtils { public static InputStream getStream(String resourcePath) throws FileNotFoundException { if (resourcePath.startsWith(CLASSPATH_PREFIX)) { final String resourceName = resourcePath.substring(CLASSPATH_PREFIX.length()); final InputStream is = FileUtils.class.getClassLoader().getResourceAsStream(resourceName); i...
FileUtils { public static InputStream getStream(String resourcePath) throws FileNotFoundException { if (resourcePath.startsWith(CLASSPATH_PREFIX)) { final String resourceName = resourcePath.substring(CLASSPATH_PREFIX.length()); final InputStream is = FileUtils.class.getClassLoader().getResourceAsStream(resourceName); i...
@Test public void shouldReadFileFromClasspathFolder() throws IOException { try (InputStream is = FileUtils.getStream("classpath:./inner/resource2.properties")) { final String content = toString(is); assertNotNull(content); assertTrue(content.contains("name=resource2")); } }
public static InputStream getStream(String resourcePath) throws FileNotFoundException { if (resourcePath.startsWith(CLASSPATH_PREFIX)) { final String resourceName = resourcePath.substring(CLASSPATH_PREFIX.length()); final InputStream is = FileUtils.class.getClassLoader().getResourceAsStream(resourceName); if (is == nul...
FileUtils { public static InputStream getStream(String resourcePath) throws FileNotFoundException { if (resourcePath.startsWith(CLASSPATH_PREFIX)) { final String resourceName = resourcePath.substring(CLASSPATH_PREFIX.length()); final InputStream is = FileUtils.class.getClassLoader().getResourceAsStream(resourceName); i...
FileUtils { public static InputStream getStream(String resourcePath) throws FileNotFoundException { if (resourcePath.startsWith(CLASSPATH_PREFIX)) { final String resourceName = resourcePath.substring(CLASSPATH_PREFIX.length()); final InputStream is = FileUtils.class.getClassLoader().getResourceAsStream(resourceName); i...
FileUtils { public static InputStream getStream(String resourcePath) throws FileNotFoundException { if (resourcePath.startsWith(CLASSPATH_PREFIX)) { final String resourceName = resourcePath.substring(CLASSPATH_PREFIX.length()); final InputStream is = FileUtils.class.getClassLoader().getResourceAsStream(resourceName); i...
FileUtils { public static InputStream getStream(String resourcePath) throws FileNotFoundException { if (resourcePath.startsWith(CLASSPATH_PREFIX)) { final String resourceName = resourcePath.substring(CLASSPATH_PREFIX.length()); final InputStream is = FileUtils.class.getClassLoader().getResourceAsStream(resourceName); i...
@Test public void shouldThrowFileNotFoundExceptionForMissingFileFromClasspath() throws IOException { try { FileUtils.getStream("classpath:NOT_EXISTING_FILE"); fail("Should have thrown a FileNotFoundException"); } catch (final FileNotFoundException e) { assertTrue(e.getMessage().contains("NOT_EXISTING_FILE")); } }
public static InputStream getStream(String resourcePath) throws FileNotFoundException { if (resourcePath.startsWith(CLASSPATH_PREFIX)) { final String resourceName = resourcePath.substring(CLASSPATH_PREFIX.length()); final InputStream is = FileUtils.class.getClassLoader().getResourceAsStream(resourceName); if (is == nul...
FileUtils { public static InputStream getStream(String resourcePath) throws FileNotFoundException { if (resourcePath.startsWith(CLASSPATH_PREFIX)) { final String resourceName = resourcePath.substring(CLASSPATH_PREFIX.length()); final InputStream is = FileUtils.class.getClassLoader().getResourceAsStream(resourceName); i...
FileUtils { public static InputStream getStream(String resourcePath) throws FileNotFoundException { if (resourcePath.startsWith(CLASSPATH_PREFIX)) { final String resourceName = resourcePath.substring(CLASSPATH_PREFIX.length()); final InputStream is = FileUtils.class.getClassLoader().getResourceAsStream(resourceName); i...
FileUtils { public static InputStream getStream(String resourcePath) throws FileNotFoundException { if (resourcePath.startsWith(CLASSPATH_PREFIX)) { final String resourceName = resourcePath.substring(CLASSPATH_PREFIX.length()); final InputStream is = FileUtils.class.getClassLoader().getResourceAsStream(resourceName); i...
FileUtils { public static InputStream getStream(String resourcePath) throws FileNotFoundException { if (resourcePath.startsWith(CLASSPATH_PREFIX)) { final String resourceName = resourcePath.substring(CLASSPATH_PREFIX.length()); final InputStream is = FileUtils.class.getClassLoader().getResourceAsStream(resourceName); i...
@Test public void shouldThrowFileNotFoundExceptionForMissingFile() throws IOException { try { FileUtils.getStream("file:NOT_EXISTING_FILE"); fail("Should have thrown a FileNotFoundException"); } catch (final FileNotFoundException e) { assertTrue(e.getMessage().contains("NOT_EXISTING_FILE")); } }
public static InputStream getStream(String resourcePath) throws FileNotFoundException { if (resourcePath.startsWith(CLASSPATH_PREFIX)) { final String resourceName = resourcePath.substring(CLASSPATH_PREFIX.length()); final InputStream is = FileUtils.class.getClassLoader().getResourceAsStream(resourceName); if (is == nul...
FileUtils { public static InputStream getStream(String resourcePath) throws FileNotFoundException { if (resourcePath.startsWith(CLASSPATH_PREFIX)) { final String resourceName = resourcePath.substring(CLASSPATH_PREFIX.length()); final InputStream is = FileUtils.class.getClassLoader().getResourceAsStream(resourceName); i...
FileUtils { public static InputStream getStream(String resourcePath) throws FileNotFoundException { if (resourcePath.startsWith(CLASSPATH_PREFIX)) { final String resourceName = resourcePath.substring(CLASSPATH_PREFIX.length()); final InputStream is = FileUtils.class.getClassLoader().getResourceAsStream(resourceName); i...
FileUtils { public static InputStream getStream(String resourcePath) throws FileNotFoundException { if (resourcePath.startsWith(CLASSPATH_PREFIX)) { final String resourceName = resourcePath.substring(CLASSPATH_PREFIX.length()); final InputStream is = FileUtils.class.getClassLoader().getResourceAsStream(resourceName); i...
FileUtils { public static InputStream getStream(String resourcePath) throws FileNotFoundException { if (resourcePath.startsWith(CLASSPATH_PREFIX)) { final String resourceName = resourcePath.substring(CLASSPATH_PREFIX.length()); final InputStream is = FileUtils.class.getClassLoader().getResourceAsStream(resourceName); i...
@Test public void shouldReadSystemProperties() { final String key = UUID.randomUUID().toString(); final String value = UUID.randomUUID().toString(); System.setProperty(key, value); final Map<String, PropertyValue> systemProperties = new SystemPropertiesReader().read(); assertNotNull(systemProperties); assertTrue(system...
@Override public Map<String, PropertyValue> read() { final Map<String, PropertyValue> properties = new HashMap<>(); final Properties systemProperties = System.getProperties(); for(final Entry<Object, Object> x : systemProperties.entrySet()) { properties.put((String)x.getKey(), PropertyValue.of((String)x.getValue())); }...
SystemPropertiesReader implements Reader { @Override public Map<String, PropertyValue> read() { final Map<String, PropertyValue> properties = new HashMap<>(); final Properties systemProperties = System.getProperties(); for(final Entry<Object, Object> x : systemProperties.entrySet()) { properties.put((String)x.getKey(),...
SystemPropertiesReader implements Reader { @Override public Map<String, PropertyValue> read() { final Map<String, PropertyValue> properties = new HashMap<>(); final Properties systemProperties = System.getProperties(); for(final Entry<Object, Object> x : systemProperties.entrySet()) { properties.put((String)x.getKey(),...
SystemPropertiesReader implements Reader { @Override public Map<String, PropertyValue> read() { final Map<String, PropertyValue> properties = new HashMap<>(); final Properties systemProperties = System.getProperties(); for(final Entry<Object, Object> x : systemProperties.entrySet()) { properties.put((String)x.getKey(),...
SystemPropertiesReader implements Reader { @Override public Map<String, PropertyValue> read() { final Map<String, PropertyValue> properties = new HashMap<>(); final Properties systemProperties = System.getProperties(); for(final Entry<Object, Object> x : systemProperties.entrySet()) { properties.put((String)x.getKey(),...
@Test public void shouldReturnUnresolvableEnvironmentVariables() { final Map<String, PropertyValue> var = new EnvironmentVariablesReader().read(); assertNotNull(var); assertFalse(var.isEmpty()); var.forEach((key, value) -> { assertFalse(value.isResolvable()); }); }
@Override public Map<String, PropertyValue> read() { return envSupplier.get().entrySet().stream() .collect(Collectors.toMap( e -> getKey(e.getKey()), e -> PropertyValue.of(e.getValue()).resolvable(false) )); }
EnvironmentVariablesReader implements Reader { @Override public Map<String, PropertyValue> read() { return envSupplier.get().entrySet().stream() .collect(Collectors.toMap( e -> getKey(e.getKey()), e -> PropertyValue.of(e.getValue()).resolvable(false) )); } }
EnvironmentVariablesReader implements Reader { @Override public Map<String, PropertyValue> read() { return envSupplier.get().entrySet().stream() .collect(Collectors.toMap( e -> getKey(e.getKey()), e -> PropertyValue.of(e.getValue()).resolvable(false) )); } EnvironmentVariablesReader(); EnvironmentVariablesReader(Suppl...
EnvironmentVariablesReader implements Reader { @Override public Map<String, PropertyValue> read() { return envSupplier.get().entrySet().stream() .collect(Collectors.toMap( e -> getKey(e.getKey()), e -> PropertyValue.of(e.getValue()).resolvable(false) )); } EnvironmentVariablesReader(); EnvironmentVariablesReader(Suppl...
EnvironmentVariablesReader implements Reader { @Override public Map<String, PropertyValue> read() { return envSupplier.get().entrySet().stream() .collect(Collectors.toMap( e -> getKey(e.getKey()), e -> PropertyValue.of(e.getValue()).resolvable(false) )); } EnvironmentVariablesReader(); EnvironmentVariablesReader(Suppl...
@Test public void shouldReturnEmptyMapIfEmpty() { final PriorityQueueDecoratorReader queue = new PriorityQueueDecoratorReader(); final Map<String, PropertyValue> prop = queue.read(); assertNotNull(prop); assertTrue(prop.isEmpty()); }
@Override public Map<String, PropertyValue> read() { final Map<String, PropertyValue> result = new LinkedHashMap<>(); readersMap.forEach((priority, readers) -> { readers.forEach(reader -> { final Map<String, PropertyValue> entries = reader.read(); result.putAll(entries); }); }) ; return result; }
PriorityQueueDecoratorReader implements Reader { @Override public Map<String, PropertyValue> read() { final Map<String, PropertyValue> result = new LinkedHashMap<>(); readersMap.forEach((priority, readers) -> { readers.forEach(reader -> { final Map<String, PropertyValue> entries = reader.read(); result.putAll(entries);...
PriorityQueueDecoratorReader implements Reader { @Override public Map<String, PropertyValue> read() { final Map<String, PropertyValue> result = new LinkedHashMap<>(); readersMap.forEach((priority, readers) -> { readers.forEach(reader -> { final Map<String, PropertyValue> entries = reader.read(); result.putAll(entries);...
PriorityQueueDecoratorReader implements Reader { @Override public Map<String, PropertyValue> read() { final Map<String, PropertyValue> result = new LinkedHashMap<>(); readersMap.forEach((priority, readers) -> { readers.forEach(reader -> { final Map<String, PropertyValue> entries = reader.read(); result.putAll(entries);...
PriorityQueueDecoratorReader implements Reader { @Override public Map<String, PropertyValue> read() { final Map<String, PropertyValue> result = new LinkedHashMap<>(); readersMap.forEach((priority, readers) -> { readers.forEach(reader -> { final Map<String, PropertyValue> entries = reader.read(); result.putAll(entries);...
@Test public void shouldReturnDefaultInteger() { final Map<String, String> properties = new HashMap<>(); properties.put("key.one", "1"); final Properlty prop = buildProperlty(properties); assertEquals(1, prop.getInt("key.one", 10)); assertEquals(10, prop.getInt("key.two", 10)); }
public Optional<Integer> getInt(String key) { return get(key).map(Integer::parseInt); }
Properlty { public Optional<Integer> getInt(String key) { return get(key).map(Integer::parseInt); } }
Properlty { public Optional<Integer> getInt(String key) { return get(key).map(Integer::parseInt); } Properlty(boolean caseSensitive, Map<String, PropertyValue> properties); }
Properlty { public Optional<Integer> getInt(String key) { return get(key).map(Integer::parseInt); } Properlty(boolean caseSensitive, Map<String, PropertyValue> properties); static ProperltyBuilder builder(); Optional<String> get(String key); String get(String key, String defaultValue); Optional<T> get(String key, Funct...
Properlty { public Optional<Integer> getInt(String key) { return get(key).map(Integer::parseInt); } Properlty(boolean caseSensitive, Map<String, PropertyValue> properties); static ProperltyBuilder builder(); Optional<String> get(String key); String get(String key, String defaultValue); Optional<T> get(String key, Funct...
@Test(expected=NumberFormatException.class) public void shouldThrowExceptionParsingWrongInteger() { final Map<String, String> properties = new HashMap<>(); properties.put("key.one", "not a number"); final Properlty prop = buildProperlty(properties); prop.getInt("key.one"); }
public Optional<Integer> getInt(String key) { return get(key).map(Integer::parseInt); }
Properlty { public Optional<Integer> getInt(String key) { return get(key).map(Integer::parseInt); } }
Properlty { public Optional<Integer> getInt(String key) { return get(key).map(Integer::parseInt); } Properlty(boolean caseSensitive, Map<String, PropertyValue> properties); }
Properlty { public Optional<Integer> getInt(String key) { return get(key).map(Integer::parseInt); } Properlty(boolean caseSensitive, Map<String, PropertyValue> properties); static ProperltyBuilder builder(); Optional<String> get(String key); String get(String key, String defaultValue); Optional<T> get(String key, Funct...
Properlty { public Optional<Integer> getInt(String key) { return get(key).map(Integer::parseInt); } Properlty(boolean caseSensitive, Map<String, PropertyValue> properties); static ProperltyBuilder builder(); Optional<String> get(String key); String get(String key, String defaultValue); Optional<T> get(String key, Funct...
@Test public void shouldReturnEmptyOptionalBoolean() { final Map<String, String> properties = new HashMap<>(); properties.put("key.one", "value.one"); properties.put("key.two", "value.two"); final Properlty prop = buildProperlty(properties); assertFalse(prop.getBoolean("key.three").isPresent()); }
public Optional<Boolean> getBoolean(String key) { return get(key).map(value -> { if ( "true".equalsIgnoreCase(value) ) return true; else if ( "false".equalsIgnoreCase(value) ) return false; else throw new RuntimeException("Cannot parse boolean value: [" + value+ "]"); }); }
Properlty { public Optional<Boolean> getBoolean(String key) { return get(key).map(value -> { if ( "true".equalsIgnoreCase(value) ) return true; else if ( "false".equalsIgnoreCase(value) ) return false; else throw new RuntimeException("Cannot parse boolean value: [" + value+ "]"); }); } }
Properlty { public Optional<Boolean> getBoolean(String key) { return get(key).map(value -> { if ( "true".equalsIgnoreCase(value) ) return true; else if ( "false".equalsIgnoreCase(value) ) return false; else throw new RuntimeException("Cannot parse boolean value: [" + value+ "]"); }); } Properlty(boolean caseSensitive, ...
Properlty { public Optional<Boolean> getBoolean(String key) { return get(key).map(value -> { if ( "true".equalsIgnoreCase(value) ) return true; else if ( "false".equalsIgnoreCase(value) ) return false; else throw new RuntimeException("Cannot parse boolean value: [" + value+ "]"); }); } Properlty(boolean caseSensitive, ...
Properlty { public Optional<Boolean> getBoolean(String key) { return get(key).map(value -> { if ( "true".equalsIgnoreCase(value) ) return true; else if ( "false".equalsIgnoreCase(value) ) return false; else throw new RuntimeException("Cannot parse boolean value: [" + value+ "]"); }); } Properlty(boolean caseSensitive, ...
@Test public void shouldReturnDefaultBoolean() { final Map<String, String> properties = new HashMap<>(); properties.put("key.one", "true"); final Properlty prop = buildProperlty(properties); assertTrue(prop.getBoolean("key.one", false)); assertFalse(prop.getBoolean("key.two", false)); assertTrue(prop.getBoolean("key.tw...
public Optional<Boolean> getBoolean(String key) { return get(key).map(value -> { if ( "true".equalsIgnoreCase(value) ) return true; else if ( "false".equalsIgnoreCase(value) ) return false; else throw new RuntimeException("Cannot parse boolean value: [" + value+ "]"); }); }
Properlty { public Optional<Boolean> getBoolean(String key) { return get(key).map(value -> { if ( "true".equalsIgnoreCase(value) ) return true; else if ( "false".equalsIgnoreCase(value) ) return false; else throw new RuntimeException("Cannot parse boolean value: [" + value+ "]"); }); } }
Properlty { public Optional<Boolean> getBoolean(String key) { return get(key).map(value -> { if ( "true".equalsIgnoreCase(value) ) return true; else if ( "false".equalsIgnoreCase(value) ) return false; else throw new RuntimeException("Cannot parse boolean value: [" + value+ "]"); }); } Properlty(boolean caseSensitive, ...
Properlty { public Optional<Boolean> getBoolean(String key) { return get(key).map(value -> { if ( "true".equalsIgnoreCase(value) ) return true; else if ( "false".equalsIgnoreCase(value) ) return false; else throw new RuntimeException("Cannot parse boolean value: [" + value+ "]"); }); } Properlty(boolean caseSensitive, ...
Properlty { public Optional<Boolean> getBoolean(String key) { return get(key).map(value -> { if ( "true".equalsIgnoreCase(value) ) return true; else if ( "false".equalsIgnoreCase(value) ) return false; else throw new RuntimeException("Cannot parse boolean value: [" + value+ "]"); }); } Properlty(boolean caseSensitive, ...
@Test(expected=RuntimeException.class) public void shouldThrowExceptionParsingWrongBoolean() { final Map<String, String> properties = new HashMap<>(); properties.put("key.one", "not a bool"); final Properlty prop = buildProperlty(properties); prop.getBoolean("key.one"); }
public Optional<Boolean> getBoolean(String key) { return get(key).map(value -> { if ( "true".equalsIgnoreCase(value) ) return true; else if ( "false".equalsIgnoreCase(value) ) return false; else throw new RuntimeException("Cannot parse boolean value: [" + value+ "]"); }); }
Properlty { public Optional<Boolean> getBoolean(String key) { return get(key).map(value -> { if ( "true".equalsIgnoreCase(value) ) return true; else if ( "false".equalsIgnoreCase(value) ) return false; else throw new RuntimeException("Cannot parse boolean value: [" + value+ "]"); }); } }
Properlty { public Optional<Boolean> getBoolean(String key) { return get(key).map(value -> { if ( "true".equalsIgnoreCase(value) ) return true; else if ( "false".equalsIgnoreCase(value) ) return false; else throw new RuntimeException("Cannot parse boolean value: [" + value+ "]"); }); } Properlty(boolean caseSensitive, ...
Properlty { public Optional<Boolean> getBoolean(String key) { return get(key).map(value -> { if ( "true".equalsIgnoreCase(value) ) return true; else if ( "false".equalsIgnoreCase(value) ) return false; else throw new RuntimeException("Cannot parse boolean value: [" + value+ "]"); }); } Properlty(boolean caseSensitive, ...
Properlty { public Optional<Boolean> getBoolean(String key) { return get(key).map(value -> { if ( "true".equalsIgnoreCase(value) ) return true; else if ( "false".equalsIgnoreCase(value) ) return false; else throw new RuntimeException("Cannot parse boolean value: [" + value+ "]"); }); } Properlty(boolean caseSensitive, ...
@Test public void testParse_success() { List<String> keyValueStrings = Arrays.asList( "SOME_VARIABLE_1=SOME_VALUE_1", "SOME_VARIABLE_2=SOME_VALUE_2", "SOME_VARIABLE_3="); Map<String, String> expectedEnvironment = new HashMap<>(); expectedEnvironment.put("SOME_VARIABLE_1", "SOME_VALUE_1"); expectedEnvironment.put("SOME_...
public static Map<String, String> parse(List<String> keyValueStrings) { Map<String, String> environmentMap = new HashMap<>(); for (String keyValueString : keyValueStrings) { String[] keyValuePair = keyValueString.split("=", 2); if (keyValuePair.length < 2) { throw new IllegalArgumentException( "Error while parsing mini...
MinikubeDockerEnvParser { public static Map<String, String> parse(List<String> keyValueStrings) { Map<String, String> environmentMap = new HashMap<>(); for (String keyValueString : keyValueStrings) { String[] keyValuePair = keyValueString.split("=", 2); if (keyValuePair.length < 2) { throw new IllegalArgumentException(...
MinikubeDockerEnvParser { public static Map<String, String> parse(List<String> keyValueStrings) { Map<String, String> environmentMap = new HashMap<>(); for (String keyValueString : keyValueStrings) { String[] keyValuePair = keyValueString.split("=", 2); if (keyValuePair.length < 2) { throw new IllegalArgumentException(...
MinikubeDockerEnvParser { public static Map<String, String> parse(List<String> keyValueStrings) { Map<String, String> environmentMap = new HashMap<>(); for (String keyValueString : keyValueStrings) { String[] keyValuePair = keyValueString.split("=", 2); if (keyValuePair.length < 2) { throw new IllegalArgumentException(...
MinikubeDockerEnvParser { public static Map<String, String> parse(List<String> keyValueStrings) { Map<String, String> environmentMap = new HashMap<>(); for (String keyValueString : keyValueStrings) { String[] keyValuePair = keyValueString.split("=", 2); if (keyValuePair.length < 2) { throw new IllegalArgumentException(...
@Test public void testBuildMinikubeCommand() { spyAbstractMinikubeMojo.setMinikube("path/to/minikube"); spyAbstractMinikubeMojo.setFlags(ImmutableList.of("someFlag1", "someFlag2")); Mockito.when(spyAbstractMinikubeMojo.getCommand()).thenReturn("somecommand"); Mockito.when(spyAbstractMinikubeMojo.getMoreFlags()) .thenRe...
@VisibleForTesting List<String> buildMinikubeCommand() { List<String> execString = new ArrayList<>(); execString.add(minikube); execString.add(getCommand()); if (flags != null) { execString.addAll(flags); } execString.addAll(getMoreFlags()); return execString; }
AbstractMinikubeMojo extends AbstractMojo { @VisibleForTesting List<String> buildMinikubeCommand() { List<String> execString = new ArrayList<>(); execString.add(minikube); execString.add(getCommand()); if (flags != null) { execString.addAll(flags); } execString.addAll(getMoreFlags()); return execString; } }
AbstractMinikubeMojo extends AbstractMojo { @VisibleForTesting List<String> buildMinikubeCommand() { List<String> execString = new ArrayList<>(); execString.add(minikube); execString.add(getCommand()); if (flags != null) { execString.addAll(flags); } execString.addAll(getMoreFlags()); return execString; } }
AbstractMinikubeMojo extends AbstractMojo { @VisibleForTesting List<String> buildMinikubeCommand() { List<String> execString = new ArrayList<>(); execString.add(minikube); execString.add(getCommand()); if (flags != null) { execString.addAll(flags); } execString.addAll(getMoreFlags()); return execString; } @Override vo...
AbstractMinikubeMojo extends AbstractMojo { @VisibleForTesting List<String> buildMinikubeCommand() { List<String> execString = new ArrayList<>(); execString.add(minikube); execString.add(getCommand()); if (flags != null) { execString.addAll(flags); } execString.addAll(getMoreFlags()); return execString; } @Override vo...
@Test public void testExecute() throws IOException, MojoExecutionException, InterruptedException { List<String> minikubeCommand = Arrays.asList("some", "command"); Mockito.doReturn(minikubeCommand).when(spyAbstractMinikubeMojo).buildMinikubeCommand(); spyAbstractMinikubeMojo.setCommandExecutorSupplier(() -> mockCommand...
@Override public void execute() throws MojoExecutionException { List<String> minikubeCommand = buildMinikubeCommand(); try { commandExecutorSupplier.get().setLogger(mavenBuildLogger).run(minikubeCommand); } catch (InterruptedException | IOException ex) { throw new MojoExecutionException(getDescription() + " failed", ex...
AbstractMinikubeMojo extends AbstractMojo { @Override public void execute() throws MojoExecutionException { List<String> minikubeCommand = buildMinikubeCommand(); try { commandExecutorSupplier.get().setLogger(mavenBuildLogger).run(minikubeCommand); } catch (InterruptedException | IOException ex) { throw new MojoExecuti...
AbstractMinikubeMojo extends AbstractMojo { @Override public void execute() throws MojoExecutionException { List<String> minikubeCommand = buildMinikubeCommand(); try { commandExecutorSupplier.get().setLogger(mavenBuildLogger).run(minikubeCommand); } catch (InterruptedException | IOException ex) { throw new MojoExecuti...
AbstractMinikubeMojo extends AbstractMojo { @Override public void execute() throws MojoExecutionException { List<String> minikubeCommand = buildMinikubeCommand(); try { commandExecutorSupplier.get().setLogger(mavenBuildLogger).run(minikubeCommand); } catch (InterruptedException | IOException ex) { throw new MojoExecuti...
AbstractMinikubeMojo extends AbstractMojo { @Override public void execute() throws MojoExecutionException { List<String> minikubeCommand = buildMinikubeCommand(); try { commandExecutorSupplier.get().setLogger(mavenBuildLogger).run(minikubeCommand); } catch (InterruptedException | IOException ex) { throw new MojoExecuti...
@Test public void testRun_success() throws IOException, InterruptedException { setMockProcessOutput(expectedOutput); List<String> output = testCommandExecutor.run(command); verifyProcessBuilding(command); Assert.assertEquals(expectedOutput, output); Mockito.verifyZeroInteractions(mockBuildLogger); }
public List<String> run(String... command) throws IOException, InterruptedException { return run(Arrays.asList(command)); }
CommandExecutor { public List<String> run(String... command) throws IOException, InterruptedException { return run(Arrays.asList(command)); } }
CommandExecutor { public List<String> run(String... command) throws IOException, InterruptedException { return run(Arrays.asList(command)); } }
CommandExecutor { public List<String> run(String... command) throws IOException, InterruptedException { return run(Arrays.asList(command)); } CommandExecutor setLogger(BuildLogger logger); CommandExecutor setEnvironment(Map<String, String> environmentMap); List<String> run(String... command); List<String> run(List<Str...
CommandExecutor { public List<String> run(String... command) throws IOException, InterruptedException { return run(Arrays.asList(command)); } CommandExecutor setLogger(BuildLogger logger); CommandExecutor setEnvironment(Map<String, String> environmentMap); List<String> run(String... command); List<String> run(List<Str...
@Test public void testRun_commandError() throws InterruptedException, IOException { setMockProcessOutput(expectedOutput); Mockito.when(mockProcess.waitFor()).thenReturn(1); try { testCommandExecutor.run(command); Assert.fail("Expected an IOException to be thrown"); } catch (IOException ex) { Assert.assertEquals("comman...
public List<String> run(String... command) throws IOException, InterruptedException { return run(Arrays.asList(command)); }
CommandExecutor { public List<String> run(String... command) throws IOException, InterruptedException { return run(Arrays.asList(command)); } }
CommandExecutor { public List<String> run(String... command) throws IOException, InterruptedException { return run(Arrays.asList(command)); } }
CommandExecutor { public List<String> run(String... command) throws IOException, InterruptedException { return run(Arrays.asList(command)); } CommandExecutor setLogger(BuildLogger logger); CommandExecutor setEnvironment(Map<String, String> environmentMap); List<String> run(String... command); List<String> run(List<Str...
CommandExecutor { public List<String> run(String... command) throws IOException, InterruptedException { return run(Arrays.asList(command)); } CommandExecutor setLogger(BuildLogger logger); CommandExecutor setEnvironment(Map<String, String> environmentMap); List<String> run(String... command); List<String> run(List<Str...
@Test public void testParse_variableNameEmpty() { List<String> keyValueStrings = Arrays.asList("SOME_VARIABLE_1=SOME_VALUE_1", "=SOME_VALUE_2", "SOME_VARIABLE_3="); try { MinikubeDockerEnvParser.parse(keyValueStrings); Assert.fail("Expected an IllegalArgumentException to be thrown"); } catch (IllegalArgumentException e...
public static Map<String, String> parse(List<String> keyValueStrings) { Map<String, String> environmentMap = new HashMap<>(); for (String keyValueString : keyValueStrings) { String[] keyValuePair = keyValueString.split("=", 2); if (keyValuePair.length < 2) { throw new IllegalArgumentException( "Error while parsing mini...
MinikubeDockerEnvParser { public static Map<String, String> parse(List<String> keyValueStrings) { Map<String, String> environmentMap = new HashMap<>(); for (String keyValueString : keyValueStrings) { String[] keyValuePair = keyValueString.split("=", 2); if (keyValuePair.length < 2) { throw new IllegalArgumentException(...
MinikubeDockerEnvParser { public static Map<String, String> parse(List<String> keyValueStrings) { Map<String, String> environmentMap = new HashMap<>(); for (String keyValueString : keyValueStrings) { String[] keyValuePair = keyValueString.split("=", 2); if (keyValuePair.length < 2) { throw new IllegalArgumentException(...
MinikubeDockerEnvParser { public static Map<String, String> parse(List<String> keyValueStrings) { Map<String, String> environmentMap = new HashMap<>(); for (String keyValueString : keyValueStrings) { String[] keyValuePair = keyValueString.split("=", 2); if (keyValuePair.length < 2) { throw new IllegalArgumentException(...
MinikubeDockerEnvParser { public static Map<String, String> parse(List<String> keyValueStrings) { Map<String, String> environmentMap = new HashMap<>(); for (String keyValueString : keyValueStrings) { String[] keyValuePair = keyValueString.split("=", 2); if (keyValuePair.length < 2) { throw new IllegalArgumentException(...
@Test public void testParse_invalidFormat() { List<String> keyValueStrings = Arrays.asList("SOME_VARIABLE_1=SOME_VALUE_1", "SOME_VARIABLE_2", "SOME_VARIABLE_3="); try { MinikubeDockerEnvParser.parse(keyValueStrings); Assert.fail("Expected an IllegalArgumentException to be thrown"); } catch (IllegalArgumentException ex)...
public static Map<String, String> parse(List<String> keyValueStrings) { Map<String, String> environmentMap = new HashMap<>(); for (String keyValueString : keyValueStrings) { String[] keyValuePair = keyValueString.split("=", 2); if (keyValuePair.length < 2) { throw new IllegalArgumentException( "Error while parsing mini...
MinikubeDockerEnvParser { public static Map<String, String> parse(List<String> keyValueStrings) { Map<String, String> environmentMap = new HashMap<>(); for (String keyValueString : keyValueStrings) { String[] keyValuePair = keyValueString.split("=", 2); if (keyValuePair.length < 2) { throw new IllegalArgumentException(...
MinikubeDockerEnvParser { public static Map<String, String> parse(List<String> keyValueStrings) { Map<String, String> environmentMap = new HashMap<>(); for (String keyValueString : keyValueStrings) { String[] keyValuePair = keyValueString.split("=", 2); if (keyValuePair.length < 2) { throw new IllegalArgumentException(...
MinikubeDockerEnvParser { public static Map<String, String> parse(List<String> keyValueStrings) { Map<String, String> environmentMap = new HashMap<>(); for (String keyValueString : keyValueStrings) { String[] keyValuePair = keyValueString.split("=", 2); if (keyValuePair.length < 2) { throw new IllegalArgumentException(...
MinikubeDockerEnvParser { public static Map<String, String> parse(List<String> keyValueStrings) { Map<String, String> environmentMap = new HashMap<>(); for (String keyValueString : keyValueStrings) { String[] keyValuePair = keyValueString.split("=", 2); if (keyValuePair.length < 2) { throw new IllegalArgumentException(...
@Test public void testDefaultMinikubeTasks() { Project project = ProjectBuilder.builder().withProjectDir(tmp.getRoot()).build(); project.getPluginManager().apply(MinikubePlugin.class); ((ProjectInternal) project).evaluate(); TaskContainer t = project.getTasks(); TaskCollection<MinikubeTask> tc = t.withType(MinikubeTask...
@Override public void apply(Project project) { this.project = project; CommandExecutorFactory commandExecutorFactory = new CommandExecutorFactory(project.getLogger()); createMinikubeExtension(commandExecutorFactory); configureMinikubeTaskAdditionCallback(commandExecutorFactory); createMinikubeStartTask(); createMinikub...
MinikubePlugin implements Plugin<Project> { @Override public void apply(Project project) { this.project = project; CommandExecutorFactory commandExecutorFactory = new CommandExecutorFactory(project.getLogger()); createMinikubeExtension(commandExecutorFactory); configureMinikubeTaskAdditionCallback(commandExecutorFactor...
MinikubePlugin implements Plugin<Project> { @Override public void apply(Project project) { this.project = project; CommandExecutorFactory commandExecutorFactory = new CommandExecutorFactory(project.getLogger()); createMinikubeExtension(commandExecutorFactory); configureMinikubeTaskAdditionCallback(commandExecutorFactor...
MinikubePlugin implements Plugin<Project> { @Override public void apply(Project project) { this.project = project; CommandExecutorFactory commandExecutorFactory = new CommandExecutorFactory(project.getLogger()); createMinikubeExtension(commandExecutorFactory); configureMinikubeTaskAdditionCallback(commandExecutorFactor...
MinikubePlugin implements Plugin<Project> { @Override public void apply(Project project) { this.project = project; CommandExecutorFactory commandExecutorFactory = new CommandExecutorFactory(project.getLogger()); createMinikubeExtension(commandExecutorFactory); configureMinikubeTaskAdditionCallback(commandExecutorFactor...
@Test public void testMinikubeExtensionSetProperties() { Project project = ProjectBuilder.builder().withProjectDir(tmp.getRoot()).build(); project.getPluginManager().apply(MinikubePlugin.class); MinikubeExtension ex = (MinikubeExtension) project.getExtensions().getByName("minikube"); ex.setMinikube("/custom/minikube/pa...
@Override public void apply(Project project) { this.project = project; CommandExecutorFactory commandExecutorFactory = new CommandExecutorFactory(project.getLogger()); createMinikubeExtension(commandExecutorFactory); configureMinikubeTaskAdditionCallback(commandExecutorFactory); createMinikubeStartTask(); createMinikub...
MinikubePlugin implements Plugin<Project> { @Override public void apply(Project project) { this.project = project; CommandExecutorFactory commandExecutorFactory = new CommandExecutorFactory(project.getLogger()); createMinikubeExtension(commandExecutorFactory); configureMinikubeTaskAdditionCallback(commandExecutorFactor...
MinikubePlugin implements Plugin<Project> { @Override public void apply(Project project) { this.project = project; CommandExecutorFactory commandExecutorFactory = new CommandExecutorFactory(project.getLogger()); createMinikubeExtension(commandExecutorFactory); configureMinikubeTaskAdditionCallback(commandExecutorFactor...
MinikubePlugin implements Plugin<Project> { @Override public void apply(Project project) { this.project = project; CommandExecutorFactory commandExecutorFactory = new CommandExecutorFactory(project.getLogger()); createMinikubeExtension(commandExecutorFactory); configureMinikubeTaskAdditionCallback(commandExecutorFactor...
MinikubePlugin implements Plugin<Project> { @Override public void apply(Project project) { this.project = project; CommandExecutorFactory commandExecutorFactory = new CommandExecutorFactory(project.getLogger()); createMinikubeExtension(commandExecutorFactory); configureMinikubeTaskAdditionCallback(commandExecutorFactor...
@Test public void testUserAddedMinikubeTaskConfigured() { Project project = ProjectBuilder.builder().withProjectDir(tmp.getRoot()).build(); project.getPluginManager().apply(MinikubePlugin.class); MinikubeExtension ex = (MinikubeExtension) project.getExtensions().getByName("minikube"); ex.setMinikube("/custom/minikube/p...
@Override public void apply(Project project) { this.project = project; CommandExecutorFactory commandExecutorFactory = new CommandExecutorFactory(project.getLogger()); createMinikubeExtension(commandExecutorFactory); configureMinikubeTaskAdditionCallback(commandExecutorFactory); createMinikubeStartTask(); createMinikub...
MinikubePlugin implements Plugin<Project> { @Override public void apply(Project project) { this.project = project; CommandExecutorFactory commandExecutorFactory = new CommandExecutorFactory(project.getLogger()); createMinikubeExtension(commandExecutorFactory); configureMinikubeTaskAdditionCallback(commandExecutorFactor...
MinikubePlugin implements Plugin<Project> { @Override public void apply(Project project) { this.project = project; CommandExecutorFactory commandExecutorFactory = new CommandExecutorFactory(project.getLogger()); createMinikubeExtension(commandExecutorFactory); configureMinikubeTaskAdditionCallback(commandExecutorFactor...
MinikubePlugin implements Plugin<Project> { @Override public void apply(Project project) { this.project = project; CommandExecutorFactory commandExecutorFactory = new CommandExecutorFactory(project.getLogger()); createMinikubeExtension(commandExecutorFactory); configureMinikubeTaskAdditionCallback(commandExecutorFactor...
MinikubePlugin implements Plugin<Project> { @Override public void apply(Project project) { this.project = project; CommandExecutorFactory commandExecutorFactory = new CommandExecutorFactory(project.getLogger()); createMinikubeExtension(commandExecutorFactory); configureMinikubeTaskAdditionCallback(commandExecutorFactor...
@Test public void testGetDockerEnvWithDefaultProfile() throws IOException, InterruptedException { expectedCommand.add("--profile="); when(commandExecutorMock.run(expectedCommand)).thenReturn(dockerEnvOutput); Assert.assertEquals(expectedMap, minikube.getDockerEnv()); verify(commandExecutorMock).run(expectedCommand); }
public Map<String, String> getDockerEnv() throws IOException, InterruptedException { return getDockerEnv(""); }
MinikubeExtension { public Map<String, String> getDockerEnv() throws IOException, InterruptedException { return getDockerEnv(""); } }
MinikubeExtension { public Map<String, String> getDockerEnv() throws IOException, InterruptedException { return getDockerEnv(""); } MinikubeExtension(Project project, CommandExecutorFactory commandExecutorFactory); }
MinikubeExtension { public Map<String, String> getDockerEnv() throws IOException, InterruptedException { return getDockerEnv(""); } MinikubeExtension(Project project, CommandExecutorFactory commandExecutorFactory); String getMinikube(); void setMinikube(String minikube); Property<String> getMinikubeProvider(); Map<Stri...
MinikubeExtension { public Map<String, String> getDockerEnv() throws IOException, InterruptedException { return getDockerEnv(""); } MinikubeExtension(Project project, CommandExecutorFactory commandExecutorFactory); String getMinikube(); void setMinikube(String minikube); Property<String> getMinikubeProvider(); Map<Stri...
@Test public void testGetDockerEnvWithTestProfile() throws IOException, InterruptedException { String profile = "testProfile"; expectedCommand.add("--profile=".concat(profile)); when(commandExecutorMock.run(expectedCommand)).thenReturn(dockerEnvOutput); Assert.assertEquals(expectedMap, minikube.getDockerEnv(profile)); ...
public Map<String, String> getDockerEnv() throws IOException, InterruptedException { return getDockerEnv(""); }
MinikubeExtension { public Map<String, String> getDockerEnv() throws IOException, InterruptedException { return getDockerEnv(""); } }
MinikubeExtension { public Map<String, String> getDockerEnv() throws IOException, InterruptedException { return getDockerEnv(""); } MinikubeExtension(Project project, CommandExecutorFactory commandExecutorFactory); }
MinikubeExtension { public Map<String, String> getDockerEnv() throws IOException, InterruptedException { return getDockerEnv(""); } MinikubeExtension(Project project, CommandExecutorFactory commandExecutorFactory); String getMinikube(); void setMinikube(String minikube); Property<String> getMinikubeProvider(); Map<Stri...
MinikubeExtension { public Map<String, String> getDockerEnv() throws IOException, InterruptedException { return getDockerEnv(""); } MinikubeExtension(Project project, CommandExecutorFactory commandExecutorFactory); String getMinikube(); void setMinikube(String minikube); Property<String> getMinikubeProvider(); Map<Stri...
@Test public void testGetSameDockerEnvWithTwoDefaultProfiles() throws IOException, InterruptedException { String profile = ""; expectedCommand.add("--profile=".concat(profile)); when(commandExecutorMock.run(expectedCommand)).thenReturn(dockerEnvOutput); Assert.assertEquals(minikube.getDockerEnv(), minikube.getDockerEnv...
public Map<String, String> getDockerEnv() throws IOException, InterruptedException { return getDockerEnv(""); }
MinikubeExtension { public Map<String, String> getDockerEnv() throws IOException, InterruptedException { return getDockerEnv(""); } }
MinikubeExtension { public Map<String, String> getDockerEnv() throws IOException, InterruptedException { return getDockerEnv(""); } MinikubeExtension(Project project, CommandExecutorFactory commandExecutorFactory); }
MinikubeExtension { public Map<String, String> getDockerEnv() throws IOException, InterruptedException { return getDockerEnv(""); } MinikubeExtension(Project project, CommandExecutorFactory commandExecutorFactory); String getMinikube(); void setMinikube(String minikube); Property<String> getMinikubeProvider(); Map<Stri...
MinikubeExtension { public Map<String, String> getDockerEnv() throws IOException, InterruptedException { return getDockerEnv(""); } MinikubeExtension(Project project, CommandExecutorFactory commandExecutorFactory); String getMinikube(); void setMinikube(String minikube); Property<String> getMinikubeProvider(); Map<Stri...
@Test public void testGetDockerEnvWithNullProfile() throws IOException, InterruptedException { try { minikube.getDockerEnv(null); Assert.fail("getDockerEnv() should not permit null values"); } catch (NullPointerException ex) { Assert.assertNotNull(ex.getMessage()); Assert.assertEquals("Minikube profile must not be null...
public Map<String, String> getDockerEnv() throws IOException, InterruptedException { return getDockerEnv(""); }
MinikubeExtension { public Map<String, String> getDockerEnv() throws IOException, InterruptedException { return getDockerEnv(""); } }
MinikubeExtension { public Map<String, String> getDockerEnv() throws IOException, InterruptedException { return getDockerEnv(""); } MinikubeExtension(Project project, CommandExecutorFactory commandExecutorFactory); }
MinikubeExtension { public Map<String, String> getDockerEnv() throws IOException, InterruptedException { return getDockerEnv(""); } MinikubeExtension(Project project, CommandExecutorFactory commandExecutorFactory); String getMinikube(); void setMinikube(String minikube); Property<String> getMinikubeProvider(); Map<Stri...
MinikubeExtension { public Map<String, String> getDockerEnv() throws IOException, InterruptedException { return getDockerEnv(""); } MinikubeExtension(Project project, CommandExecutorFactory commandExecutorFactory); String getMinikube(); void setMinikube(String minikube); Property<String> getMinikubeProvider(); Map<Stri...
@Test public void testEquals_true() throws MalformedURLException { DefaultedURL defaultedURL = new DefaultedURL(); DefaultedURL customURL = new DefaultedURL(); assertTrue(defaultedURL.equals(customURL)); }
@Override public boolean equals(Object o) { if (o instanceof DefaultedURL) { return url.equals(((DefaultedURL) o).getUrl()); } return false; }
DefaultedURL { @Override public boolean equals(Object o) { if (o instanceof DefaultedURL) { return url.equals(((DefaultedURL) o).getUrl()); } return false; } }
DefaultedURL { @Override public boolean equals(Object o) { if (o instanceof DefaultedURL) { return url.equals(((DefaultedURL) o).getUrl()); } return false; } DefaultedURL(); }
DefaultedURL { @Override public boolean equals(Object o) { if (o instanceof DefaultedURL) { return url.equals(((DefaultedURL) o).getUrl()); } return false; } DefaultedURL(); boolean isDefault(); void setUrl(URL url); String getDomain(); URL getUrl(); @Override String toString(); @Override boolean equals(Object o); }
DefaultedURL { @Override public boolean equals(Object o) { if (o instanceof DefaultedURL) { return url.equals(((DefaultedURL) o).getUrl()); } return false; } DefaultedURL(); boolean isDefault(); void setUrl(URL url); String getDomain(); URL getUrl(); @Override String toString(); @Override boolean equals(Object o); }
@Test public void TestSelectN_selectFirstObfs4Connection_returnThirdGateway() { Provider provider = getProvider(null, null, null, null, null, null, "ptdemo_two_openvpn_one_pt_gateways.json", null); MockHelper.mockProviderObserver(provider); mockStatic(PreferenceHelper.class); when(PreferenceHelper.getUsePluggableTransp...
public Gateway select(int nClosest) { Connection.TransportType transportType = getUsePluggableTransports(context) ? OBFS4 : OPENVPN; if (presortedList.size() > 0) { return getGatewayFromPresortedList(nClosest, transportType); } return getGatewayFromTimezoneCalculation(nClosest, transportType); }
GatewaysManager { public Gateway select(int nClosest) { Connection.TransportType transportType = getUsePluggableTransports(context) ? OBFS4 : OPENVPN; if (presortedList.size() > 0) { return getGatewayFromPresortedList(nClosest, transportType); } return getGatewayFromTimezoneCalculation(nClosest, transportType); } }
GatewaysManager { public Gateway select(int nClosest) { Connection.TransportType transportType = getUsePluggableTransports(context) ? OBFS4 : OPENVPN; if (presortedList.size() > 0) { return getGatewayFromPresortedList(nClosest, transportType); } return getGatewayFromTimezoneCalculation(nClosest, transportType); } Gatew...
GatewaysManager { public Gateway select(int nClosest) { Connection.TransportType transportType = getUsePluggableTransports(context) ? OBFS4 : OPENVPN; if (presortedList.size() > 0) { return getGatewayFromPresortedList(nClosest, transportType); } return getGatewayFromTimezoneCalculation(nClosest, transportType); } Gatew...
GatewaysManager { public Gateway select(int nClosest) { Connection.TransportType transportType = getUsePluggableTransports(context) ? OBFS4 : OPENVPN; if (presortedList.size() > 0) { return getGatewayFromPresortedList(nClosest, transportType); } return getGatewayFromTimezoneCalculation(nClosest, transportType); } Gatew...
@Test public void testSelectN_selectFromPresortedGateways_returnsGatewaysInPresortedOrder() { Provider provider = getProvider(null, null, null, null, null, null, "ptdemo_three_mixed_gateways.json", "ptdemo_three_mixed_gateways.geoip.json"); MockHelper.mockProviderObserver(provider); mockStatic(PreferenceHelper.class); ...
public Gateway select(int nClosest) { Connection.TransportType transportType = getUsePluggableTransports(context) ? OBFS4 : OPENVPN; if (presortedList.size() > 0) { return getGatewayFromPresortedList(nClosest, transportType); } return getGatewayFromTimezoneCalculation(nClosest, transportType); }
GatewaysManager { public Gateway select(int nClosest) { Connection.TransportType transportType = getUsePluggableTransports(context) ? OBFS4 : OPENVPN; if (presortedList.size() > 0) { return getGatewayFromPresortedList(nClosest, transportType); } return getGatewayFromTimezoneCalculation(nClosest, transportType); } }
GatewaysManager { public Gateway select(int nClosest) { Connection.TransportType transportType = getUsePluggableTransports(context) ? OBFS4 : OPENVPN; if (presortedList.size() > 0) { return getGatewayFromPresortedList(nClosest, transportType); } return getGatewayFromTimezoneCalculation(nClosest, transportType); } Gatew...
GatewaysManager { public Gateway select(int nClosest) { Connection.TransportType transportType = getUsePluggableTransports(context) ? OBFS4 : OPENVPN; if (presortedList.size() > 0) { return getGatewayFromPresortedList(nClosest, transportType); } return getGatewayFromTimezoneCalculation(nClosest, transportType); } Gatew...
GatewaysManager { public Gateway select(int nClosest) { Connection.TransportType transportType = getUsePluggableTransports(context) ? OBFS4 : OPENVPN; if (presortedList.size() > 0) { return getGatewayFromPresortedList(nClosest, transportType); } return getGatewayFromTimezoneCalculation(nClosest, transportType); } Gatew...
@Test public void testSelectN_selectObfs4FromPresortedGateways_returnsObfs4GatewaysInPresortedOrder() { Provider provider = getProvider(null, null, null, null, null, null, "ptdemo_three_mixed_gateways.json", "ptdemo_three_mixed_gateways.geoip.json"); MockHelper.mockProviderObserver(provider); mockStatic(PreferenceHelpe...
public Gateway select(int nClosest) { Connection.TransportType transportType = getUsePluggableTransports(context) ? OBFS4 : OPENVPN; if (presortedList.size() > 0) { return getGatewayFromPresortedList(nClosest, transportType); } return getGatewayFromTimezoneCalculation(nClosest, transportType); }
GatewaysManager { public Gateway select(int nClosest) { Connection.TransportType transportType = getUsePluggableTransports(context) ? OBFS4 : OPENVPN; if (presortedList.size() > 0) { return getGatewayFromPresortedList(nClosest, transportType); } return getGatewayFromTimezoneCalculation(nClosest, transportType); } }
GatewaysManager { public Gateway select(int nClosest) { Connection.TransportType transportType = getUsePluggableTransports(context) ? OBFS4 : OPENVPN; if (presortedList.size() > 0) { return getGatewayFromPresortedList(nClosest, transportType); } return getGatewayFromTimezoneCalculation(nClosest, transportType); } Gatew...
GatewaysManager { public Gateway select(int nClosest) { Connection.TransportType transportType = getUsePluggableTransports(context) ? OBFS4 : OPENVPN; if (presortedList.size() > 0) { return getGatewayFromPresortedList(nClosest, transportType); } return getGatewayFromTimezoneCalculation(nClosest, transportType); } Gatew...
GatewaysManager { public Gateway select(int nClosest) { Connection.TransportType transportType = getUsePluggableTransports(context) ? OBFS4 : OPENVPN; if (presortedList.size() > 0) { return getGatewayFromPresortedList(nClosest, transportType); } return getGatewayFromTimezoneCalculation(nClosest, transportType); } Gatew...
@Test public void testGenerateVpnProfile_v1_tcp_udp() throws Exception { gateway = new JSONObject(TestSetupHelper.getInputAsString(getClass().getClassLoader().getResourceAsStream("gateway_tcp_udp.json"))); vpnConfigGenerator = new VpnConfigGenerator(generalConfig, secrets, gateway, 1); HashMap<Connection.TransportType,...
public HashMap<Connection.TransportType, VpnProfile> generateVpnProfiles() throws ConfigParser.ConfigParseError, NumberFormatException, JSONException, IOException { HashMap<Connection.TransportType, VpnProfile> profiles = new HashMap<>(); profiles.put(OPENVPN, createProfile(OPENVPN)); if (supportsObfs4()) { profiles.pu...
VpnConfigGenerator { public HashMap<Connection.TransportType, VpnProfile> generateVpnProfiles() throws ConfigParser.ConfigParseError, NumberFormatException, JSONException, IOException { HashMap<Connection.TransportType, VpnProfile> profiles = new HashMap<>(); profiles.put(OPENVPN, createProfile(OPENVPN)); if (supportsO...
VpnConfigGenerator { public HashMap<Connection.TransportType, VpnProfile> generateVpnProfiles() throws ConfigParser.ConfigParseError, NumberFormatException, JSONException, IOException { HashMap<Connection.TransportType, VpnProfile> profiles = new HashMap<>(); profiles.put(OPENVPN, createProfile(OPENVPN)); if (supportsO...
VpnConfigGenerator { public HashMap<Connection.TransportType, VpnProfile> generateVpnProfiles() throws ConfigParser.ConfigParseError, NumberFormatException, JSONException, IOException { HashMap<Connection.TransportType, VpnProfile> profiles = new HashMap<>(); profiles.put(OPENVPN, createProfile(OPENVPN)); if (supportsO...
VpnConfigGenerator { public HashMap<Connection.TransportType, VpnProfile> generateVpnProfiles() throws ConfigParser.ConfigParseError, NumberFormatException, JSONException, IOException { HashMap<Connection.TransportType, VpnProfile> profiles = new HashMap<>(); profiles.put(OPENVPN, createProfile(OPENVPN)); if (supportsO...
@Test public void testGenerateVpnProfile_v1_udp_tcp() throws Exception { gateway = new JSONObject(TestSetupHelper.getInputAsString(getClass().getClassLoader().getResourceAsStream("gateway_udp_tcp.json"))); vpnConfigGenerator = new VpnConfigGenerator(generalConfig, secrets, gateway, 1); HashMap<Connection.TransportType,...
public HashMap<Connection.TransportType, VpnProfile> generateVpnProfiles() throws ConfigParser.ConfigParseError, NumberFormatException, JSONException, IOException { HashMap<Connection.TransportType, VpnProfile> profiles = new HashMap<>(); profiles.put(OPENVPN, createProfile(OPENVPN)); if (supportsObfs4()) { profiles.pu...
VpnConfigGenerator { public HashMap<Connection.TransportType, VpnProfile> generateVpnProfiles() throws ConfigParser.ConfigParseError, NumberFormatException, JSONException, IOException { HashMap<Connection.TransportType, VpnProfile> profiles = new HashMap<>(); profiles.put(OPENVPN, createProfile(OPENVPN)); if (supportsO...
VpnConfigGenerator { public HashMap<Connection.TransportType, VpnProfile> generateVpnProfiles() throws ConfigParser.ConfigParseError, NumberFormatException, JSONException, IOException { HashMap<Connection.TransportType, VpnProfile> profiles = new HashMap<>(); profiles.put(OPENVPN, createProfile(OPENVPN)); if (supportsO...
VpnConfigGenerator { public HashMap<Connection.TransportType, VpnProfile> generateVpnProfiles() throws ConfigParser.ConfigParseError, NumberFormatException, JSONException, IOException { HashMap<Connection.TransportType, VpnProfile> profiles = new HashMap<>(); profiles.put(OPENVPN, createProfile(OPENVPN)); if (supportsO...
VpnConfigGenerator { public HashMap<Connection.TransportType, VpnProfile> generateVpnProfiles() throws ConfigParser.ConfigParseError, NumberFormatException, JSONException, IOException { HashMap<Connection.TransportType, VpnProfile> profiles = new HashMap<>(); profiles.put(OPENVPN, createProfile(OPENVPN)); if (supportsO...
@Test public void testGenerateVpnProfile_v2_tcp_udp() throws Exception { gateway = new JSONObject(TestSetupHelper.getInputAsString(getClass().getClassLoader().getResourceAsStream("gateway_tcp_udp.json"))); vpnConfigGenerator = new VpnConfigGenerator(generalConfig, secrets, gateway, 2); HashMap<Connection.TransportType,...
public HashMap<Connection.TransportType, VpnProfile> generateVpnProfiles() throws ConfigParser.ConfigParseError, NumberFormatException, JSONException, IOException { HashMap<Connection.TransportType, VpnProfile> profiles = new HashMap<>(); profiles.put(OPENVPN, createProfile(OPENVPN)); if (supportsObfs4()) { profiles.pu...
VpnConfigGenerator { public HashMap<Connection.TransportType, VpnProfile> generateVpnProfiles() throws ConfigParser.ConfigParseError, NumberFormatException, JSONException, IOException { HashMap<Connection.TransportType, VpnProfile> profiles = new HashMap<>(); profiles.put(OPENVPN, createProfile(OPENVPN)); if (supportsO...
VpnConfigGenerator { public HashMap<Connection.TransportType, VpnProfile> generateVpnProfiles() throws ConfigParser.ConfigParseError, NumberFormatException, JSONException, IOException { HashMap<Connection.TransportType, VpnProfile> profiles = new HashMap<>(); profiles.put(OPENVPN, createProfile(OPENVPN)); if (supportsO...
VpnConfigGenerator { public HashMap<Connection.TransportType, VpnProfile> generateVpnProfiles() throws ConfigParser.ConfigParseError, NumberFormatException, JSONException, IOException { HashMap<Connection.TransportType, VpnProfile> profiles = new HashMap<>(); profiles.put(OPENVPN, createProfile(OPENVPN)); if (supportsO...
VpnConfigGenerator { public HashMap<Connection.TransportType, VpnProfile> generateVpnProfiles() throws ConfigParser.ConfigParseError, NumberFormatException, JSONException, IOException { HashMap<Connection.TransportType, VpnProfile> profiles = new HashMap<>(); profiles.put(OPENVPN, createProfile(OPENVPN)); if (supportsO...
@Test public void testGenerateVpnProfile_v2_udp_tcp() throws Exception { gateway = new JSONObject(TestSetupHelper.getInputAsString(getClass().getClassLoader().getResourceAsStream("gateway_udp_tcp.json"))); vpnConfigGenerator = new VpnConfigGenerator(generalConfig, secrets, gateway, 2); HashMap<Connection.TransportType,...
public HashMap<Connection.TransportType, VpnProfile> generateVpnProfiles() throws ConfigParser.ConfigParseError, NumberFormatException, JSONException, IOException { HashMap<Connection.TransportType, VpnProfile> profiles = new HashMap<>(); profiles.put(OPENVPN, createProfile(OPENVPN)); if (supportsObfs4()) { profiles.pu...
VpnConfigGenerator { public HashMap<Connection.TransportType, VpnProfile> generateVpnProfiles() throws ConfigParser.ConfigParseError, NumberFormatException, JSONException, IOException { HashMap<Connection.TransportType, VpnProfile> profiles = new HashMap<>(); profiles.put(OPENVPN, createProfile(OPENVPN)); if (supportsO...
VpnConfigGenerator { public HashMap<Connection.TransportType, VpnProfile> generateVpnProfiles() throws ConfigParser.ConfigParseError, NumberFormatException, JSONException, IOException { HashMap<Connection.TransportType, VpnProfile> profiles = new HashMap<>(); profiles.put(OPENVPN, createProfile(OPENVPN)); if (supportsO...
VpnConfigGenerator { public HashMap<Connection.TransportType, VpnProfile> generateVpnProfiles() throws ConfigParser.ConfigParseError, NumberFormatException, JSONException, IOException { HashMap<Connection.TransportType, VpnProfile> profiles = new HashMap<>(); profiles.put(OPENVPN, createProfile(OPENVPN)); if (supportsO...
VpnConfigGenerator { public HashMap<Connection.TransportType, VpnProfile> generateVpnProfiles() throws ConfigParser.ConfigParseError, NumberFormatException, JSONException, IOException { HashMap<Connection.TransportType, VpnProfile> profiles = new HashMap<>(); profiles.put(OPENVPN, createProfile(OPENVPN)); if (supportsO...
@Test public void testGenerateVpnProfile_v3_obfs4() throws Exception { gateway = new JSONObject(TestSetupHelper.getInputAsString(getClass().getClassLoader().getResourceAsStream("ptdemo.bitmask.eip-service.json"))).getJSONArray("gateways").getJSONObject(0); vpnConfigGenerator = new VpnConfigGenerator(generalConfig, secr...
public HashMap<Connection.TransportType, VpnProfile> generateVpnProfiles() throws ConfigParser.ConfigParseError, NumberFormatException, JSONException, IOException { HashMap<Connection.TransportType, VpnProfile> profiles = new HashMap<>(); profiles.put(OPENVPN, createProfile(OPENVPN)); if (supportsObfs4()) { profiles.pu...
VpnConfigGenerator { public HashMap<Connection.TransportType, VpnProfile> generateVpnProfiles() throws ConfigParser.ConfigParseError, NumberFormatException, JSONException, IOException { HashMap<Connection.TransportType, VpnProfile> profiles = new HashMap<>(); profiles.put(OPENVPN, createProfile(OPENVPN)); if (supportsO...
VpnConfigGenerator { public HashMap<Connection.TransportType, VpnProfile> generateVpnProfiles() throws ConfigParser.ConfigParseError, NumberFormatException, JSONException, IOException { HashMap<Connection.TransportType, VpnProfile> profiles = new HashMap<>(); profiles.put(OPENVPN, createProfile(OPENVPN)); if (supportsO...
VpnConfigGenerator { public HashMap<Connection.TransportType, VpnProfile> generateVpnProfiles() throws ConfigParser.ConfigParseError, NumberFormatException, JSONException, IOException { HashMap<Connection.TransportType, VpnProfile> profiles = new HashMap<>(); profiles.put(OPENVPN, createProfile(OPENVPN)); if (supportsO...
VpnConfigGenerator { public HashMap<Connection.TransportType, VpnProfile> generateVpnProfiles() throws ConfigParser.ConfigParseError, NumberFormatException, JSONException, IOException { HashMap<Connection.TransportType, VpnProfile> profiles = new HashMap<>(); profiles.put(OPENVPN, createProfile(OPENVPN)); if (supportsO...
@Test public void testGenerateVpnProfile_v3_ovpn_tcp_udp() throws Exception { gateway = new JSONObject(TestSetupHelper.getInputAsString(getClass().getClassLoader().getResourceAsStream("ptdemo_pt_tcp_udp.eip-service.json"))).getJSONArray("gateways").getJSONObject(0); vpnConfigGenerator = new VpnConfigGenerator(generalCo...
public HashMap<Connection.TransportType, VpnProfile> generateVpnProfiles() throws ConfigParser.ConfigParseError, NumberFormatException, JSONException, IOException { HashMap<Connection.TransportType, VpnProfile> profiles = new HashMap<>(); profiles.put(OPENVPN, createProfile(OPENVPN)); if (supportsObfs4()) { profiles.pu...
VpnConfigGenerator { public HashMap<Connection.TransportType, VpnProfile> generateVpnProfiles() throws ConfigParser.ConfigParseError, NumberFormatException, JSONException, IOException { HashMap<Connection.TransportType, VpnProfile> profiles = new HashMap<>(); profiles.put(OPENVPN, createProfile(OPENVPN)); if (supportsO...
VpnConfigGenerator { public HashMap<Connection.TransportType, VpnProfile> generateVpnProfiles() throws ConfigParser.ConfigParseError, NumberFormatException, JSONException, IOException { HashMap<Connection.TransportType, VpnProfile> profiles = new HashMap<>(); profiles.put(OPENVPN, createProfile(OPENVPN)); if (supportsO...
VpnConfigGenerator { public HashMap<Connection.TransportType, VpnProfile> generateVpnProfiles() throws ConfigParser.ConfigParseError, NumberFormatException, JSONException, IOException { HashMap<Connection.TransportType, VpnProfile> profiles = new HashMap<>(); profiles.put(OPENVPN, createProfile(OPENVPN)); if (supportsO...
VpnConfigGenerator { public HashMap<Connection.TransportType, VpnProfile> generateVpnProfiles() throws ConfigParser.ConfigParseError, NumberFormatException, JSONException, IOException { HashMap<Connection.TransportType, VpnProfile> profiles = new HashMap<>(); profiles.put(OPENVPN, createProfile(OPENVPN)); if (supportsO...
@Test public void testGenerateVpnProfile_v3_ovpn_udp_tcp() throws Exception { gateway = new JSONObject(TestSetupHelper.getInputAsString(getClass().getClassLoader().getResourceAsStream("ptdemo_pt_udp_tcp.eip-service.json"))).getJSONArray("gateways").getJSONObject(0); vpnConfigGenerator = new VpnConfigGenerator(generalCo...
public HashMap<Connection.TransportType, VpnProfile> generateVpnProfiles() throws ConfigParser.ConfigParseError, NumberFormatException, JSONException, IOException { HashMap<Connection.TransportType, VpnProfile> profiles = new HashMap<>(); profiles.put(OPENVPN, createProfile(OPENVPN)); if (supportsObfs4()) { profiles.pu...
VpnConfigGenerator { public HashMap<Connection.TransportType, VpnProfile> generateVpnProfiles() throws ConfigParser.ConfigParseError, NumberFormatException, JSONException, IOException { HashMap<Connection.TransportType, VpnProfile> profiles = new HashMap<>(); profiles.put(OPENVPN, createProfile(OPENVPN)); if (supportsO...
VpnConfigGenerator { public HashMap<Connection.TransportType, VpnProfile> generateVpnProfiles() throws ConfigParser.ConfigParseError, NumberFormatException, JSONException, IOException { HashMap<Connection.TransportType, VpnProfile> profiles = new HashMap<>(); profiles.put(OPENVPN, createProfile(OPENVPN)); if (supportsO...
VpnConfigGenerator { public HashMap<Connection.TransportType, VpnProfile> generateVpnProfiles() throws ConfigParser.ConfigParseError, NumberFormatException, JSONException, IOException { HashMap<Connection.TransportType, VpnProfile> profiles = new HashMap<>(); profiles.put(OPENVPN, createProfile(OPENVPN)); if (supportsO...
VpnConfigGenerator { public HashMap<Connection.TransportType, VpnProfile> generateVpnProfiles() throws ConfigParser.ConfigParseError, NumberFormatException, JSONException, IOException { HashMap<Connection.TransportType, VpnProfile> profiles = new HashMap<>(); profiles.put(OPENVPN, createProfile(OPENVPN)); if (supportsO...
@Test public void testGatewayManagerFromCurrentProvider_noProvider_noGateways() { MockHelper.mockProviderObserver(null); GatewaysManager gatewaysManager = new GatewaysManager(mockContext); assertEquals(0, gatewaysManager.size()); }
public int size() { return gateways.size(); }
GatewaysManager { public int size() { return gateways.size(); } }
GatewaysManager { public int size() { return gateways.size(); } GatewaysManager(Context context); }
GatewaysManager { public int size() { return gateways.size(); } GatewaysManager(Context context); Gateway select(int nClosest); int getPosition(VpnProfile profile); boolean isEmpty(); int size(); @Override String toString(); }
GatewaysManager { public int size() { return gateways.size(); } GatewaysManager(Context context); Gateway select(int nClosest); int getPosition(VpnProfile profile); boolean isEmpty(); int size(); @Override String toString(); }
@Test @UseDataProvider("dataProviderTimezones") public void testSelect(int timezone, String expected) { when(ConfigHelper.getCurrentTimezone()).thenReturn(timezone); gatewaySelector = new GatewaySelector(gatewayList); assertEquals(expected, gatewaySelector.select().getName()); }
public Gateway select() { return closestGateway(); }
GatewaySelector { public Gateway select() { return closestGateway(); } }
GatewaySelector { public Gateway select() { return closestGateway(); } GatewaySelector(List<Gateway> gateways); }
GatewaySelector { public Gateway select() { return closestGateway(); } GatewaySelector(List<Gateway> gateways); Gateway select(); Gateway select(int nClosest); }
GatewaySelector { public Gateway select() { return closestGateway(); } GatewaySelector(List<Gateway> gateways); Gateway select(); Gateway select(int nClosest); }
@Test @UseDataProvider("dataProviderSameDistanceTimezones") public void testSelectSameTimezoneDistance(int timezone, String expected1, String expected2) { when(ConfigHelper.getCurrentTimezone()).thenReturn(timezone); gatewaySelector = new GatewaySelector(gatewayList); assertTrue(gatewaySelector.select().getName().equal...
public Gateway select() { return closestGateway(); }
GatewaySelector { public Gateway select() { return closestGateway(); } }
GatewaySelector { public Gateway select() { return closestGateway(); } GatewaySelector(List<Gateway> gateways); }
GatewaySelector { public Gateway select() { return closestGateway(); } GatewaySelector(List<Gateway> gateways); Gateway select(); Gateway select(int nClosest); }
GatewaySelector { public Gateway select() { return closestGateway(); } GatewaySelector(List<Gateway> gateways); Gateway select(); Gateway select(int nClosest); }
@Test @UseDataProvider("dataProviderSameDistanceTimezones") public void testNClostest_SameTimezoneDistance_chooseGatewayWithSameDistance(int timezone, String expected1, String expected2) { when(ConfigHelper.getCurrentTimezone()).thenReturn(timezone); gatewaySelector = new GatewaySelector(gatewayList); ArrayList<String>...
public Gateway select() { return closestGateway(); }
GatewaySelector { public Gateway select() { return closestGateway(); } }
GatewaySelector { public Gateway select() { return closestGateway(); } GatewaySelector(List<Gateway> gateways); }
GatewaySelector { public Gateway select() { return closestGateway(); } GatewaySelector(List<Gateway> gateways); Gateway select(); Gateway select(int nClosest); }
GatewaySelector { public Gateway select() { return closestGateway(); } GatewaySelector(List<Gateway> gateways); Gateway select(); Gateway select(int nClosest); }
@Test public void testNClostest_OneTimezonePerSet_choseSecondClosestTimezone() { when(ConfigHelper.getCurrentTimezone()).thenReturn(-4); gatewaySelector = new GatewaySelector(gatewayList); assertTrue("Frankfurt".equals(gatewaySelector.select(1).getName())); }
public Gateway select() { return closestGateway(); }
GatewaySelector { public Gateway select() { return closestGateway(); } }
GatewaySelector { public Gateway select() { return closestGateway(); } GatewaySelector(List<Gateway> gateways); }
GatewaySelector { public Gateway select() { return closestGateway(); } GatewaySelector(List<Gateway> gateways); Gateway select(); Gateway select(int nClosest); }
GatewaySelector { public Gateway select() { return closestGateway(); } GatewaySelector(List<Gateway> gateways); Gateway select(); Gateway select(int nClosest); }
@Test public void testEquals_sameFields_returnsTrue() throws Exception { Provider p1 = TestSetupHelper.getConfiguredProvider(); Provider p2 = TestSetupHelper.getConfiguredProvider(); assertTrue("Providers should be same:", p1.equals(p2)); }
@Override public boolean equals(Object o) { if (o instanceof Provider) { Provider p = (Provider) o; return p.getDomain().equals(getDomain()) && definition.toString().equals(p.getDefinition().toString()) && eipServiceJson.toString().equals(p.getEipServiceJsonString()) && geoIpJson.toString().equals(p.getGeoIpJsonString(...
Provider implements Parcelable { @Override public boolean equals(Object o) { if (o instanceof Provider) { Provider p = (Provider) o; return p.getDomain().equals(getDomain()) && definition.toString().equals(p.getDefinition().toString()) && eipServiceJson.toString().equals(p.getEipServiceJsonString()) && geoIpJson.toStri...
Provider implements Parcelable { @Override public boolean equals(Object o) { if (o instanceof Provider) { Provider p = (Provider) o; return p.getDomain().equals(getDomain()) && definition.toString().equals(p.getDefinition().toString()) && eipServiceJson.toString().equals(p.getEipServiceJsonString()) && geoIpJson.toStri...
Provider implements Parcelable { @Override public boolean equals(Object o) { if (o instanceof Provider) { Provider p = (Provider) o; return p.getDomain().equals(getDomain()) && definition.toString().equals(p.getDefinition().toString()) && eipServiceJson.toString().equals(p.getEipServiceJsonString()) && geoIpJson.toStri...
Provider implements Parcelable { @Override public boolean equals(Object o) { if (o instanceof Provider) { Provider p = (Provider) o; return p.getDomain().equals(getDomain()) && definition.toString().equals(p.getDefinition().toString()) && eipServiceJson.toString().equals(p.getEipServiceJsonString()) && geoIpJson.toStri...
@Test public void testEqualsThroughSetContains_differentFields_returnsFalse() throws Exception { Provider p1 = TestSetupHelper.getConfiguredProvider(); Provider p2 = TestSetupHelper.getConfiguredProvider(); p2.setMainUrl("http: Provider p3 = new Provider("https: Set<Provider> defaultProviders = new HashSet<>(); default...
public void setMainUrl(URL url) { mainUrl.setUrl(url); }
Provider implements Parcelable { public void setMainUrl(URL url) { mainUrl.setUrl(url); } }
Provider implements Parcelable { public void setMainUrl(URL url) { mainUrl.setUrl(url); } Provider(); Provider(String mainUrl); Provider(String mainUrl, String geoipUrl); Provider(String mainUrl, String providerIp, String providerApiIp); Provider(String mainUrl, String geoipUrl, String providerIp, String providerAp...
Provider implements Parcelable { public void setMainUrl(URL url) { mainUrl.setUrl(url); } Provider(); Provider(String mainUrl); Provider(String mainUrl, String geoipUrl); Provider(String mainUrl, String providerIp, String providerApiIp); Provider(String mainUrl, String geoipUrl, String providerIp, String providerAp...
Provider implements Parcelable { public void setMainUrl(URL url) { mainUrl.setUrl(url); } Provider(); Provider(String mainUrl); Provider(String mainUrl, String geoipUrl); Provider(String mainUrl, String providerIp, String providerApiIp); Provider(String mainUrl, String geoipUrl, String providerIp, String providerAp...
@Test public void testIsPluggableTransportsSupported_Obfs4_returnsTrue() throws Exception { Provider p1 = TestSetupHelper.getProvider( "https: null, null, null, null, null, "ptdemo.bitmask.eip-service.json", null); assertTrue(p1.supportsPluggableTransports()); }
public boolean supportsPluggableTransports() { try { JSONArray gatewayJsons = eipServiceJson.getJSONArray(GATEWAYS); for (int i = 0; i < gatewayJsons.length(); i++) { JSONArray transports = gatewayJsons.getJSONObject(i). getJSONObject(CAPABILITIES). getJSONArray(TRANSPORT); for (int j = 0; j < transports.length(); j++)...
Provider implements Parcelable { public boolean supportsPluggableTransports() { try { JSONArray gatewayJsons = eipServiceJson.getJSONArray(GATEWAYS); for (int i = 0; i < gatewayJsons.length(); i++) { JSONArray transports = gatewayJsons.getJSONObject(i). getJSONObject(CAPABILITIES). getJSONArray(TRANSPORT); for (int j =...
Provider implements Parcelable { public boolean supportsPluggableTransports() { try { JSONArray gatewayJsons = eipServiceJson.getJSONArray(GATEWAYS); for (int i = 0; i < gatewayJsons.length(); i++) { JSONArray transports = gatewayJsons.getJSONObject(i). getJSONObject(CAPABILITIES). getJSONArray(TRANSPORT); for (int j =...
Provider implements Parcelable { public boolean supportsPluggableTransports() { try { JSONArray gatewayJsons = eipServiceJson.getJSONArray(GATEWAYS); for (int i = 0; i < gatewayJsons.length(); i++) { JSONArray transports = gatewayJsons.getJSONObject(i). getJSONObject(CAPABILITIES). getJSONArray(TRANSPORT); for (int j =...
Provider implements Parcelable { public boolean supportsPluggableTransports() { try { JSONArray gatewayJsons = eipServiceJson.getJSONArray(GATEWAYS); for (int i = 0; i < gatewayJsons.length(); i++) { JSONArray transports = gatewayJsons.getJSONObject(i). getJSONObject(CAPABILITIES). getJSONArray(TRANSPORT); for (int j =...
@Test public void testIsPluggableTransportsSupported_noObfs4_returnsFalse() throws Exception { Provider p1 = TestSetupHelper.getProvider( null, null, null, null, null, null, "eip-service-two-gateways.json", null); assertFalse(p1.supportsPluggableTransports()); }
public boolean supportsPluggableTransports() { try { JSONArray gatewayJsons = eipServiceJson.getJSONArray(GATEWAYS); for (int i = 0; i < gatewayJsons.length(); i++) { JSONArray transports = gatewayJsons.getJSONObject(i). getJSONObject(CAPABILITIES). getJSONArray(TRANSPORT); for (int j = 0; j < transports.length(); j++)...
Provider implements Parcelable { public boolean supportsPluggableTransports() { try { JSONArray gatewayJsons = eipServiceJson.getJSONArray(GATEWAYS); for (int i = 0; i < gatewayJsons.length(); i++) { JSONArray transports = gatewayJsons.getJSONObject(i). getJSONObject(CAPABILITIES). getJSONArray(TRANSPORT); for (int j =...
Provider implements Parcelable { public boolean supportsPluggableTransports() { try { JSONArray gatewayJsons = eipServiceJson.getJSONArray(GATEWAYS); for (int i = 0; i < gatewayJsons.length(); i++) { JSONArray transports = gatewayJsons.getJSONObject(i). getJSONObject(CAPABILITIES). getJSONArray(TRANSPORT); for (int j =...
Provider implements Parcelable { public boolean supportsPluggableTransports() { try { JSONArray gatewayJsons = eipServiceJson.getJSONArray(GATEWAYS); for (int i = 0; i < gatewayJsons.length(); i++) { JSONArray transports = gatewayJsons.getJSONObject(i). getJSONObject(CAPABILITIES). getJSONArray(TRANSPORT); for (int j =...
Provider implements Parcelable { public boolean supportsPluggableTransports() { try { JSONArray gatewayJsons = eipServiceJson.getJSONArray(GATEWAYS); for (int i = 0; i < gatewayJsons.length(); i++) { JSONArray transports = gatewayJsons.getJSONObject(i). getJSONObject(CAPABILITIES). getJSONArray(TRANSPORT); for (int j =...
@Test public void testGatewayManagerFromCurrentProvider_misconfiguredProvider_noGateways() throws IOException, NullPointerException { Provider provider = getProvider(null, null, null, null, null, null, "ptdemo_misconfigured_gateway.json", null); MockHelper.mockProviderObserver(provider); GatewaysManager gatewaysManager...
public int size() { return gateways.size(); }
GatewaysManager { public int size() { return gateways.size(); } }
GatewaysManager { public int size() { return gateways.size(); } GatewaysManager(Context context); }
GatewaysManager { public int size() { return gateways.size(); } GatewaysManager(Context context); Gateway select(int nClosest); int getPosition(VpnProfile profile); boolean isEmpty(); int size(); @Override String toString(); }
GatewaysManager { public int size() { return gateways.size(); } GatewaysManager(Context context); Gateway select(int nClosest); int getPosition(VpnProfile profile); boolean isEmpty(); int size(); @Override String toString(); }
@Test public void testGatewayManagerFromCurrentProvider_threeGateways() { Provider provider = getProvider(null, null, null, null,null, null, "ptdemo_three_mixed_gateways.json", null); MockHelper.mockProviderObserver(provider); GatewaysManager gatewaysManager = new GatewaysManager(mockContext); assertEquals(3, gatewaysM...
public int size() { return gateways.size(); }
GatewaysManager { public int size() { return gateways.size(); } }
GatewaysManager { public int size() { return gateways.size(); } GatewaysManager(Context context); }
GatewaysManager { public int size() { return gateways.size(); } GatewaysManager(Context context); Gateway select(int nClosest); int getPosition(VpnProfile profile); boolean isEmpty(); int size(); @Override String toString(); }
GatewaysManager { public int size() { return gateways.size(); } GatewaysManager(Context context); Gateway select(int nClosest); int getPosition(VpnProfile profile); boolean isEmpty(); int size(); @Override String toString(); }
@Test public void TestGetPosition_VpnProfileExtistingObfs4_returnPositionZero() throws JSONException, ConfigParser.ConfigParseError, IOException { Provider provider = getProvider(null, null, null, null, null, null, "ptdemo_three_mixed_gateways.json", null); JSONObject eipServiceJson = provider.getEipServiceJson(); JSON...
public int getPosition(VpnProfile profile) { if (presortedList.size() > 0) { return getPositionFromPresortedList(profile); } return getPositionFromTimezoneCalculatedList(profile); }
GatewaysManager { public int getPosition(VpnProfile profile) { if (presortedList.size() > 0) { return getPositionFromPresortedList(profile); } return getPositionFromTimezoneCalculatedList(profile); } }
GatewaysManager { public int getPosition(VpnProfile profile) { if (presortedList.size() > 0) { return getPositionFromPresortedList(profile); } return getPositionFromTimezoneCalculatedList(profile); } GatewaysManager(Context context); }
GatewaysManager { public int getPosition(VpnProfile profile) { if (presortedList.size() > 0) { return getPositionFromPresortedList(profile); } return getPositionFromTimezoneCalculatedList(profile); } GatewaysManager(Context context); Gateway select(int nClosest); int getPosition(VpnProfile profile); boolean isEmpty(); ...
GatewaysManager { public int getPosition(VpnProfile profile) { if (presortedList.size() > 0) { return getPositionFromPresortedList(profile); } return getPositionFromTimezoneCalculatedList(profile); } GatewaysManager(Context context); Gateway select(int nClosest); int getPosition(VpnProfile profile); boolean isEmpty(); ...
@Test public void TestGetPosition_VpnProfileExtistingOpenvpn_returnPositionZero() throws JSONException, ConfigParser.ConfigParseError, IOException { Provider provider = getProvider(null, null, null, null, null, null, "ptdemo_three_mixed_gateways.json", null); JSONObject eipServiceJson = provider.getEipServiceJson(); JS...
public int getPosition(VpnProfile profile) { if (presortedList.size() > 0) { return getPositionFromPresortedList(profile); } return getPositionFromTimezoneCalculatedList(profile); }
GatewaysManager { public int getPosition(VpnProfile profile) { if (presortedList.size() > 0) { return getPositionFromPresortedList(profile); } return getPositionFromTimezoneCalculatedList(profile); } }
GatewaysManager { public int getPosition(VpnProfile profile) { if (presortedList.size() > 0) { return getPositionFromPresortedList(profile); } return getPositionFromTimezoneCalculatedList(profile); } GatewaysManager(Context context); }
GatewaysManager { public int getPosition(VpnProfile profile) { if (presortedList.size() > 0) { return getPositionFromPresortedList(profile); } return getPositionFromTimezoneCalculatedList(profile); } GatewaysManager(Context context); Gateway select(int nClosest); int getPosition(VpnProfile profile); boolean isEmpty(); ...
GatewaysManager { public int getPosition(VpnProfile profile) { if (presortedList.size() > 0) { return getPositionFromPresortedList(profile); } return getPositionFromTimezoneCalculatedList(profile); } GatewaysManager(Context context); Gateway select(int nClosest); int getPosition(VpnProfile profile); boolean isEmpty(); ...
@Test public void TestGetPosition_VpnProfileExistingObfs4FromPresortedList_returnsPositionOne() throws JSONException, ConfigParser.ConfigParseError, IOException { Provider provider = getProvider(null, null, null, null, null, null, "ptdemo_three_mixed_gateways.json", "ptdemo_three_mixed_gateways.geoip.json"); JSONObject...
public int getPosition(VpnProfile profile) { if (presortedList.size() > 0) { return getPositionFromPresortedList(profile); } return getPositionFromTimezoneCalculatedList(profile); }
GatewaysManager { public int getPosition(VpnProfile profile) { if (presortedList.size() > 0) { return getPositionFromPresortedList(profile); } return getPositionFromTimezoneCalculatedList(profile); } }
GatewaysManager { public int getPosition(VpnProfile profile) { if (presortedList.size() > 0) { return getPositionFromPresortedList(profile); } return getPositionFromTimezoneCalculatedList(profile); } GatewaysManager(Context context); }
GatewaysManager { public int getPosition(VpnProfile profile) { if (presortedList.size() > 0) { return getPositionFromPresortedList(profile); } return getPositionFromTimezoneCalculatedList(profile); } GatewaysManager(Context context); Gateway select(int nClosest); int getPosition(VpnProfile profile); boolean isEmpty(); ...
GatewaysManager { public int getPosition(VpnProfile profile) { if (presortedList.size() > 0) { return getPositionFromPresortedList(profile); } return getPositionFromTimezoneCalculatedList(profile); } GatewaysManager(Context context); Gateway select(int nClosest); int getPosition(VpnProfile profile); boolean isEmpty(); ...
@Test public void TestGetPosition_VpnProfileExistingOpenvpnFromPresortedList_returnsPositionOne() throws JSONException, ConfigParser.ConfigParseError, IOException { Provider provider = getProvider(null, null, null, null, null, null, "ptdemo_three_mixed_gateways.json", "ptdemo_three_mixed_gateways.geoip.json"); JSONObje...
public int getPosition(VpnProfile profile) { if (presortedList.size() > 0) { return getPositionFromPresortedList(profile); } return getPositionFromTimezoneCalculatedList(profile); }
GatewaysManager { public int getPosition(VpnProfile profile) { if (presortedList.size() > 0) { return getPositionFromPresortedList(profile); } return getPositionFromTimezoneCalculatedList(profile); } }
GatewaysManager { public int getPosition(VpnProfile profile) { if (presortedList.size() > 0) { return getPositionFromPresortedList(profile); } return getPositionFromTimezoneCalculatedList(profile); } GatewaysManager(Context context); }
GatewaysManager { public int getPosition(VpnProfile profile) { if (presortedList.size() > 0) { return getPositionFromPresortedList(profile); } return getPositionFromTimezoneCalculatedList(profile); } GatewaysManager(Context context); Gateway select(int nClosest); int getPosition(VpnProfile profile); boolean isEmpty(); ...
GatewaysManager { public int getPosition(VpnProfile profile) { if (presortedList.size() > 0) { return getPositionFromPresortedList(profile); } return getPositionFromTimezoneCalculatedList(profile); } GatewaysManager(Context context); Gateway select(int nClosest); int getPosition(VpnProfile profile); boolean isEmpty(); ...
@Test public void TestGetPosition_VpnProfileDifferentIp_returnMinusOne() throws JSONException, ConfigParser.ConfigParseError, IOException { Provider provider = getProvider(null, null, null, null, null, null, "ptdemo_three_mixed_gateways.json", null); JSONObject eipServiceJson = provider.getEipServiceJson(); JSONObject ...
public int getPosition(VpnProfile profile) { if (presortedList.size() > 0) { return getPositionFromPresortedList(profile); } return getPositionFromTimezoneCalculatedList(profile); }
GatewaysManager { public int getPosition(VpnProfile profile) { if (presortedList.size() > 0) { return getPositionFromPresortedList(profile); } return getPositionFromTimezoneCalculatedList(profile); } }
GatewaysManager { public int getPosition(VpnProfile profile) { if (presortedList.size() > 0) { return getPositionFromPresortedList(profile); } return getPositionFromTimezoneCalculatedList(profile); } GatewaysManager(Context context); }
GatewaysManager { public int getPosition(VpnProfile profile) { if (presortedList.size() > 0) { return getPositionFromPresortedList(profile); } return getPositionFromTimezoneCalculatedList(profile); } GatewaysManager(Context context); Gateway select(int nClosest); int getPosition(VpnProfile profile); boolean isEmpty(); ...
GatewaysManager { public int getPosition(VpnProfile profile) { if (presortedList.size() > 0) { return getPositionFromPresortedList(profile); } return getPositionFromTimezoneCalculatedList(profile); } GatewaysManager(Context context); Gateway select(int nClosest); int getPosition(VpnProfile profile); boolean isEmpty(); ...
@Test public void TestGetPosition_VpnProfileMoscow_returnOne() throws JSONException, ConfigParser.ConfigParseError, IOException { Provider provider = getProvider(null, null, null, null, null, null, "ptdemo_three_mixed_gateways.json", null); JSONObject eipServiceJson = provider.getEipServiceJson(); JSONObject gateway1 =...
public int getPosition(VpnProfile profile) { if (presortedList.size() > 0) { return getPositionFromPresortedList(profile); } return getPositionFromTimezoneCalculatedList(profile); }
GatewaysManager { public int getPosition(VpnProfile profile) { if (presortedList.size() > 0) { return getPositionFromPresortedList(profile); } return getPositionFromTimezoneCalculatedList(profile); } }
GatewaysManager { public int getPosition(VpnProfile profile) { if (presortedList.size() > 0) { return getPositionFromPresortedList(profile); } return getPositionFromTimezoneCalculatedList(profile); } GatewaysManager(Context context); }
GatewaysManager { public int getPosition(VpnProfile profile) { if (presortedList.size() > 0) { return getPositionFromPresortedList(profile); } return getPositionFromTimezoneCalculatedList(profile); } GatewaysManager(Context context); Gateway select(int nClosest); int getPosition(VpnProfile profile); boolean isEmpty(); ...
GatewaysManager { public int getPosition(VpnProfile profile) { if (presortedList.size() > 0) { return getPositionFromPresortedList(profile); } return getPositionFromTimezoneCalculatedList(profile); } GatewaysManager(Context context); Gateway select(int nClosest); int getPosition(VpnProfile profile); boolean isEmpty(); ...
@Test public void testFitHarmonics() throws IOException, StructureException { String name; RotationOrderDetector detector = new RotationOrderDetector(8, HARMONICS); Atom[] ca1; AFPChain alignment; RotationAxis axis; double[] coefs, expectedHarmonics; name = "1MER.A"; ca1 = StructureTools.getRepresentativeAtomArray(Stru...
public double[] tryAllOrders(Atom[] ca, RotationAxis axis,boolean intercept) throws StructureException { if(intercept) { int[] orders = new int[maxOrder+1]; for(int i=0;i<=maxOrder;i++) { orders[i] = i; } return getWeightsForFit(ca, axis, orders); } else { int[] orders = new int[maxOrder]; for(int i=0;i<maxOrder;i++) {...
RotationOrderDetector implements OrderDetector { public double[] tryAllOrders(Atom[] ca, RotationAxis axis,boolean intercept) throws StructureException { if(intercept) { int[] orders = new int[maxOrder+1]; for(int i=0;i<=maxOrder;i++) { orders[i] = i; } return getWeightsForFit(ca, axis, orders); } else { int[] orders =...
RotationOrderDetector implements OrderDetector { public double[] tryAllOrders(Atom[] ca, RotationAxis axis,boolean intercept) throws StructureException { if(intercept) { int[] orders = new int[maxOrder+1]; for(int i=0;i<=maxOrder;i++) { orders[i] = i; } return getWeightsForFit(ca, axis, orders); } else { int[] orders =...
RotationOrderDetector implements OrderDetector { public double[] tryAllOrders(Atom[] ca, RotationAxis axis,boolean intercept) throws StructureException { if(intercept) { int[] orders = new int[maxOrder+1]; for(int i=0;i<=maxOrder;i++) { orders[i] = i; } return getWeightsForFit(ca, axis, orders); } else { int[] orders =...
RotationOrderDetector implements OrderDetector { public double[] tryAllOrders(Atom[] ca, RotationAxis axis,boolean intercept) throws StructureException { if(intercept) { int[] orders = new int[maxOrder+1]; for(int i=0;i<=maxOrder;i++) { orders[i] = i; } return getWeightsForFit(ca, axis, orders); } else { int[] orders =...
@Test public void testParseInput() throws FileNotFoundException { URL url = CeSymmMainTest.class.getResource("/cesymmtest.txt"); String filename = url.getFile(); List<String> names = CeSymmMain.parseInputStructures(filename); assertEquals(6,names.size()); int i = 0; assertEquals("d1ijqa1",names.get(i++)); assertEquals(...
public static List<String> parseInputStructures(String filename) throws FileNotFoundException { File file = new File(filename); Scanner s = new Scanner(file); List<String> structures = new ArrayList<String>(); while (s.hasNext()) { String name = s.next(); if (name.startsWith("#")) { s.nextLine(); } else { structures.ad...
CeSymmMain { public static List<String> parseInputStructures(String filename) throws FileNotFoundException { File file = new File(filename); Scanner s = new Scanner(file); List<String> structures = new ArrayList<String>(); while (s.hasNext()) { String name = s.next(); if (name.startsWith("#")) { s.nextLine(); } else { ...
CeSymmMain { public static List<String> parseInputStructures(String filename) throws FileNotFoundException { File file = new File(filename); Scanner s = new Scanner(file); List<String> structures = new ArrayList<String>(); while (s.hasNext()) { String name = s.next(); if (name.startsWith("#")) { s.nextLine(); } else { ...
CeSymmMain { public static List<String> parseInputStructures(String filename) throws FileNotFoundException { File file = new File(filename); Scanner s = new Scanner(file); List<String> structures = new ArrayList<String>(); while (s.hasNext()) { String name = s.next(); if (name.startsWith("#")) { s.nextLine(); } else { ...
CeSymmMain { public static List<String> parseInputStructures(String filename) throws FileNotFoundException { File file = new File(filename); Scanner s = new Scanner(file); List<String> structures = new ArrayList<String>(); while (s.hasNext()) { String name = s.next(); if (name.startsWith("#")) { s.nextLine(); } else { ...
@Test public void testCalculateOrderByHarmonics() throws IOException, StructureException, RefinerFailedException { String name; RotationOrderDetector detector = new RotationOrderDetector(8, HARMONICS); Atom[] ca1; AFPChain alignment; int order; name = "1MER.A"; ca1 = StructureTools.getRepresentativeAtomArray(StructureT...
@Override public int calculateOrder(AFPChain afpChain, Atom[] ca) throws RefinerFailedException { try { RotationAxis axis = new RotationAxis(afpChain); if(!axis.isDefined()) { return 1; } switch(method) { case HARMONICS: { double[] coefficients = tryAllOrders(ca, axis, false); return maxIndex(coefficients, 1); } case H...
RotationOrderDetector implements OrderDetector { @Override public int calculateOrder(AFPChain afpChain, Atom[] ca) throws RefinerFailedException { try { RotationAxis axis = new RotationAxis(afpChain); if(!axis.isDefined()) { return 1; } switch(method) { case HARMONICS: { double[] coefficients = tryAllOrders(ca, axis, f...
RotationOrderDetector implements OrderDetector { @Override public int calculateOrder(AFPChain afpChain, Atom[] ca) throws RefinerFailedException { try { RotationAxis axis = new RotationAxis(afpChain); if(!axis.isDefined()) { return 1; } switch(method) { case HARMONICS: { double[] coefficients = tryAllOrders(ca, axis, f...
RotationOrderDetector implements OrderDetector { @Override public int calculateOrder(AFPChain afpChain, Atom[] ca) throws RefinerFailedException { try { RotationAxis axis = new RotationAxis(afpChain); if(!axis.isDefined()) { return 1; } switch(method) { case HARMONICS: { double[] coefficients = tryAllOrders(ca, axis, f...
RotationOrderDetector implements OrderDetector { @Override public int calculateOrder(AFPChain afpChain, Atom[] ca) throws RefinerFailedException { try { RotationAxis axis = new RotationAxis(afpChain); if(!axis.isDefined()) { return 1; } switch(method) { case HARMONICS: { double[] coefficients = tryAllOrders(ca, axis, f...
@Test public void testFitHarmonicsFloating() throws IOException, StructureException { String name; RotationOrderDetector detector = new RotationOrderDetector(8, HARMONICS_FLOATING); Atom[] ca1; AFPChain alignment; RotationAxis axis; double[] coefs, expectedHarmonics; name = "1MER.A"; ca1 = StructureTools.getRepresentat...
public double[] tryAllOrders(Atom[] ca, RotationAxis axis,boolean intercept) throws StructureException { if(intercept) { int[] orders = new int[maxOrder+1]; for(int i=0;i<=maxOrder;i++) { orders[i] = i; } return getWeightsForFit(ca, axis, orders); } else { int[] orders = new int[maxOrder]; for(int i=0;i<maxOrder;i++) {...
RotationOrderDetector implements OrderDetector { public double[] tryAllOrders(Atom[] ca, RotationAxis axis,boolean intercept) throws StructureException { if(intercept) { int[] orders = new int[maxOrder+1]; for(int i=0;i<=maxOrder;i++) { orders[i] = i; } return getWeightsForFit(ca, axis, orders); } else { int[] orders =...
RotationOrderDetector implements OrderDetector { public double[] tryAllOrders(Atom[] ca, RotationAxis axis,boolean intercept) throws StructureException { if(intercept) { int[] orders = new int[maxOrder+1]; for(int i=0;i<=maxOrder;i++) { orders[i] = i; } return getWeightsForFit(ca, axis, orders); } else { int[] orders =...
RotationOrderDetector implements OrderDetector { public double[] tryAllOrders(Atom[] ca, RotationAxis axis,boolean intercept) throws StructureException { if(intercept) { int[] orders = new int[maxOrder+1]; for(int i=0;i<=maxOrder;i++) { orders[i] = i; } return getWeightsForFit(ca, axis, orders); } else { int[] orders =...
RotationOrderDetector implements OrderDetector { public double[] tryAllOrders(Atom[] ca, RotationAxis axis,boolean intercept) throws StructureException { if(intercept) { int[] orders = new int[maxOrder+1]; for(int i=0;i<=maxOrder;i++) { orders[i] = i; } return getWeightsForFit(ca, axis, orders); } else { int[] orders =...
@Test public void testCalculateOrderByHarmonicsFloating() throws IOException, StructureException, RefinerFailedException { String name; RotationOrderDetector detector = new RotationOrderDetector(8, HARMONICS_FLOATING); Atom[] ca1; AFPChain alignment; int order; name = "1MER.A"; ca1 = StructureTools.getRepresentativeAto...
@Override public int calculateOrder(AFPChain afpChain, Atom[] ca) throws RefinerFailedException { try { RotationAxis axis = new RotationAxis(afpChain); if(!axis.isDefined()) { return 1; } switch(method) { case HARMONICS: { double[] coefficients = tryAllOrders(ca, axis, false); return maxIndex(coefficients, 1); } case H...
RotationOrderDetector implements OrderDetector { @Override public int calculateOrder(AFPChain afpChain, Atom[] ca) throws RefinerFailedException { try { RotationAxis axis = new RotationAxis(afpChain); if(!axis.isDefined()) { return 1; } switch(method) { case HARMONICS: { double[] coefficients = tryAllOrders(ca, axis, f...
RotationOrderDetector implements OrderDetector { @Override public int calculateOrder(AFPChain afpChain, Atom[] ca) throws RefinerFailedException { try { RotationAxis axis = new RotationAxis(afpChain); if(!axis.isDefined()) { return 1; } switch(method) { case HARMONICS: { double[] coefficients = tryAllOrders(ca, axis, f...
RotationOrderDetector implements OrderDetector { @Override public int calculateOrder(AFPChain afpChain, Atom[] ca) throws RefinerFailedException { try { RotationAxis axis = new RotationAxis(afpChain); if(!axis.isDefined()) { return 1; } switch(method) { case HARMONICS: { double[] coefficients = tryAllOrders(ca, axis, f...
RotationOrderDetector implements OrderDetector { @Override public int calculateOrder(AFPChain afpChain, Atom[] ca) throws RefinerFailedException { try { RotationAxis axis = new RotationAxis(afpChain); if(!axis.isDefined()) { return 1; } switch(method) { case HARMONICS: { double[] coefficients = tryAllOrders(ca, axis, f...
@Test public void testTrySingleHarmonicsFloatingByAmp() throws IOException, StructureException { String name; RotationOrderDetector detector = new RotationOrderDetector(8, SINGLE_HARMONIC_AMP); Atom[] ca1; AFPChain alignment; RotationAxis axis; double[] coefs, expectedHarmonics; name = "1MER.A"; ca1 = StructureTools.ge...
public double[] trySingleOrdersByAmp(Atom[] ca, RotationAxis axis) throws StructureException { double[] amps = new double[maxOrder]; for( int order=1;order <= maxOrder; order++) { double[] weights = getWeightsForFit(ca, axis, new int[] {0,order}); amps[order-1] = weights[1]; } return amps; }
RotationOrderDetector implements OrderDetector { public double[] trySingleOrdersByAmp(Atom[] ca, RotationAxis axis) throws StructureException { double[] amps = new double[maxOrder]; for( int order=1;order <= maxOrder; order++) { double[] weights = getWeightsForFit(ca, axis, new int[] {0,order}); amps[order-1] = weights...
RotationOrderDetector implements OrderDetector { public double[] trySingleOrdersByAmp(Atom[] ca, RotationAxis axis) throws StructureException { double[] amps = new double[maxOrder]; for( int order=1;order <= maxOrder; order++) { double[] weights = getWeightsForFit(ca, axis, new int[] {0,order}); amps[order-1] = weights...
RotationOrderDetector implements OrderDetector { public double[] trySingleOrdersByAmp(Atom[] ca, RotationAxis axis) throws StructureException { double[] amps = new double[maxOrder]; for( int order=1;order <= maxOrder; order++) { double[] weights = getWeightsForFit(ca, axis, new int[] {0,order}); amps[order-1] = weights...
RotationOrderDetector implements OrderDetector { public double[] trySingleOrdersByAmp(Atom[] ca, RotationAxis axis) throws StructureException { double[] amps = new double[maxOrder]; for( int order=1;order <= maxOrder; order++) { double[] weights = getWeightsForFit(ca, axis, new int[] {0,order}); amps[order-1] = weights...
@Test public void testTrySingleHarmonicsFloatingBySSE() throws IOException, StructureException { String name; RotationOrderDetector detector = new RotationOrderDetector(8, SINGLE_HARMONIC_SSE); Atom[] ca1; AFPChain alignment; RotationAxis axis; double[] coefs, expectedHarmonics; name = "1MER.A"; ca1 = StructureTools.ge...
public double[] trySingleOrdersBySSE(Atom[] ca, RotationAxis axis) throws StructureException { double[] sses = new double[maxOrder]; for( int order=1;order <= maxOrder; order++) { sses[order-1] = getSSEForFit(ca, axis, new int[] {0,order}); } return sses; }
RotationOrderDetector implements OrderDetector { public double[] trySingleOrdersBySSE(Atom[] ca, RotationAxis axis) throws StructureException { double[] sses = new double[maxOrder]; for( int order=1;order <= maxOrder; order++) { sses[order-1] = getSSEForFit(ca, axis, new int[] {0,order}); } return sses; } }
RotationOrderDetector implements OrderDetector { public double[] trySingleOrdersBySSE(Atom[] ca, RotationAxis axis) throws StructureException { double[] sses = new double[maxOrder]; for( int order=1;order <= maxOrder; order++) { sses[order-1] = getSSEForFit(ca, axis, new int[] {0,order}); } return sses; } RotationOrder...
RotationOrderDetector implements OrderDetector { public double[] trySingleOrdersBySSE(Atom[] ca, RotationAxis axis) throws StructureException { double[] sses = new double[maxOrder]; for( int order=1;order <= maxOrder; order++) { sses[order-1] = getSSEForFit(ca, axis, new int[] {0,order}); } return sses; } RotationOrder...
RotationOrderDetector implements OrderDetector { public double[] trySingleOrdersBySSE(Atom[] ca, RotationAxis axis) throws StructureException { double[] sses = new double[maxOrder]; for( int order=1;order <= maxOrder; order++) { sses[order-1] = getSSEForFit(ca, axis, new int[] {0,order}); } return sses; } RotationOrder...
@Test public void testTrySingleCuspByAmp() throws IOException, StructureException { String name; RotationOrderDetector detector = new RotationOrderDetector(8, SINGLE_CUSP_AMP); Atom[] ca1; AFPChain alignment; RotationAxis axis; double[] coefs, expectedHarmonics; name = "1MER.A"; ca1 = StructureTools.getRepresentativeAt...
public double[] trySingleOrdersByAmp(Atom[] ca, RotationAxis axis) throws StructureException { double[] amps = new double[maxOrder]; for( int order=1;order <= maxOrder; order++) { double[] weights = getWeightsForFit(ca, axis, new int[] {0,order}); amps[order-1] = weights[1]; } return amps; }
RotationOrderDetector implements OrderDetector { public double[] trySingleOrdersByAmp(Atom[] ca, RotationAxis axis) throws StructureException { double[] amps = new double[maxOrder]; for( int order=1;order <= maxOrder; order++) { double[] weights = getWeightsForFit(ca, axis, new int[] {0,order}); amps[order-1] = weights...
RotationOrderDetector implements OrderDetector { public double[] trySingleOrdersByAmp(Atom[] ca, RotationAxis axis) throws StructureException { double[] amps = new double[maxOrder]; for( int order=1;order <= maxOrder; order++) { double[] weights = getWeightsForFit(ca, axis, new int[] {0,order}); amps[order-1] = weights...
RotationOrderDetector implements OrderDetector { public double[] trySingleOrdersByAmp(Atom[] ca, RotationAxis axis) throws StructureException { double[] amps = new double[maxOrder]; for( int order=1;order <= maxOrder; order++) { double[] weights = getWeightsForFit(ca, axis, new int[] {0,order}); amps[order-1] = weights...
RotationOrderDetector implements OrderDetector { public double[] trySingleOrdersByAmp(Atom[] ca, RotationAxis axis) throws StructureException { double[] amps = new double[maxOrder]; for( int order=1;order <= maxOrder; order++) { double[] weights = getWeightsForFit(ca, axis, new int[] {0,order}); amps[order-1] = weights...
@Test public void testTrySingleCuspBySSE() throws IOException, StructureException { String name; RotationOrderDetector detector = new RotationOrderDetector(8, SINGLE_CUSP_SSE); Atom[] ca1; AFPChain alignment; RotationAxis axis; double[] coefs, expectedHarmonics; name = "1MER.A"; ca1 = StructureTools.getRepresentativeAt...
public double[] trySingleOrdersBySSE(Atom[] ca, RotationAxis axis) throws StructureException { double[] sses = new double[maxOrder]; for( int order=1;order <= maxOrder; order++) { sses[order-1] = getSSEForFit(ca, axis, new int[] {0,order}); } return sses; }
RotationOrderDetector implements OrderDetector { public double[] trySingleOrdersBySSE(Atom[] ca, RotationAxis axis) throws StructureException { double[] sses = new double[maxOrder]; for( int order=1;order <= maxOrder; order++) { sses[order-1] = getSSEForFit(ca, axis, new int[] {0,order}); } return sses; } }
RotationOrderDetector implements OrderDetector { public double[] trySingleOrdersBySSE(Atom[] ca, RotationAxis axis) throws StructureException { double[] sses = new double[maxOrder]; for( int order=1;order <= maxOrder; order++) { sses[order-1] = getSSEForFit(ca, axis, new int[] {0,order}); } return sses; } RotationOrder...
RotationOrderDetector implements OrderDetector { public double[] trySingleOrdersBySSE(Atom[] ca, RotationAxis axis) throws StructureException { double[] sses = new double[maxOrder]; for( int order=1;order <= maxOrder; order++) { sses[order-1] = getSSEForFit(ca, axis, new int[] {0,order}); } return sses; } RotationOrder...
RotationOrderDetector implements OrderDetector { public double[] trySingleOrdersBySSE(Atom[] ca, RotationAxis axis) throws StructureException { double[] sses = new double[maxOrder]; for( int order=1;order <= maxOrder; order++) { sses[order-1] = getSSEForFit(ca, axis, new int[] {0,order}); } return sses; } RotationOrder...
@Test public void testTrySingleCuspFixedByAmp() throws IOException, StructureException { String name; RotationOrderDetector detector = new RotationOrderDetector(8, SINGLE_CUSP_FIXED_AMP); Atom[] ca1; AFPChain alignment; RotationAxis axis; double[] coefs, expectedHarmonics; name = "1MER.A"; ca1 = StructureTools.getAtomC...
public double[] trySingleOrdersByAmp(Atom[] ca, RotationAxis axis) throws StructureException { double[] amps = new double[maxOrder]; for( int order=1;order <= maxOrder; order++) { double[] weights = getWeightsForFit(ca, axis, new int[] {0,order}); amps[order-1] = weights[1]; } return amps; }
RotationOrderDetector implements OrderDetector { public double[] trySingleOrdersByAmp(Atom[] ca, RotationAxis axis) throws StructureException { double[] amps = new double[maxOrder]; for( int order=1;order <= maxOrder; order++) { double[] weights = getWeightsForFit(ca, axis, new int[] {0,order}); amps[order-1] = weights...
RotationOrderDetector implements OrderDetector { public double[] trySingleOrdersByAmp(Atom[] ca, RotationAxis axis) throws StructureException { double[] amps = new double[maxOrder]; for( int order=1;order <= maxOrder; order++) { double[] weights = getWeightsForFit(ca, axis, new int[] {0,order}); amps[order-1] = weights...
RotationOrderDetector implements OrderDetector { public double[] trySingleOrdersByAmp(Atom[] ca, RotationAxis axis) throws StructureException { double[] amps = new double[maxOrder]; for( int order=1;order <= maxOrder; order++) { double[] weights = getWeightsForFit(ca, axis, new int[] {0,order}); amps[order-1] = weights...
RotationOrderDetector implements OrderDetector { public double[] trySingleOrdersByAmp(Atom[] ca, RotationAxis axis) throws StructureException { double[] amps = new double[maxOrder]; for( int order=1;order <= maxOrder; order++) { double[] weights = getWeightsForFit(ca, axis, new int[] {0,order}); amps[order-1] = weights...
@Test public void testTrySingleCuspFixedBySSE() throws IOException, StructureException { String name; RotationOrderDetector detector = new RotationOrderDetector(8, SINGLE_CUSP_FIXED_SSE); Atom[] ca1; AFPChain alignment; RotationAxis axis; double[] coefs, expectedHarmonics; name = "1MER.A"; ca1 = StructureTools.getAtomC...
public double[] trySingleOrdersBySSE(Atom[] ca, RotationAxis axis) throws StructureException { double[] sses = new double[maxOrder]; for( int order=1;order <= maxOrder; order++) { sses[order-1] = getSSEForFit(ca, axis, new int[] {0,order}); } return sses; }
RotationOrderDetector implements OrderDetector { public double[] trySingleOrdersBySSE(Atom[] ca, RotationAxis axis) throws StructureException { double[] sses = new double[maxOrder]; for( int order=1;order <= maxOrder; order++) { sses[order-1] = getSSEForFit(ca, axis, new int[] {0,order}); } return sses; } }
RotationOrderDetector implements OrderDetector { public double[] trySingleOrdersBySSE(Atom[] ca, RotationAxis axis) throws StructureException { double[] sses = new double[maxOrder]; for( int order=1;order <= maxOrder; order++) { sses[order-1] = getSSEForFit(ca, axis, new int[] {0,order}); } return sses; } RotationOrder...
RotationOrderDetector implements OrderDetector { public double[] trySingleOrdersBySSE(Atom[] ca, RotationAxis axis) throws StructureException { double[] sses = new double[maxOrder]; for( int order=1;order <= maxOrder; order++) { sses[order-1] = getSSEForFit(ca, axis, new int[] {0,order}); } return sses; } RotationOrder...
RotationOrderDetector implements OrderDetector { public double[] trySingleOrdersBySSE(Atom[] ca, RotationAxis axis) throws StructureException { double[] sses = new double[maxOrder]; for( int order=1;order <= maxOrder; order++) { sses[order-1] = getSSEForFit(ca, axis, new int[] {0,order}); } return sses; } RotationOrder...
@Test public void testAutoSuggestion() throws Exception { ListRolesRequest request = new ListRolesRequest().withMaxItems(1000); Role role1 = new Role().withRoleName("foobar1"); Role role2 = new Role().withRoleName("afoobar"); Role role3 = new Role().withRoleName("foooobar"); ListRolesResult mockResult = new ListRolesRe...
public List<Principal> autoSuggestion(final String name) { if (name.length() >= 3) { String lowerCaseName = name.toLowerCase(); ListRolesRequest listRolesRequest = new ListRolesRequest(); listRolesRequest.withMaxItems(1000); ListRolesResult result = client.listRoles(listRolesRequest); List<Principal> tmp = result.getRo...
PrincipalAutoSuggestion { public List<Principal> autoSuggestion(final String name) { if (name.length() >= 3) { String lowerCaseName = name.toLowerCase(); ListRolesRequest listRolesRequest = new ListRolesRequest(); listRolesRequest.withMaxItems(1000); ListRolesResult result = client.listRoles(listRolesRequest); List<Pri...
PrincipalAutoSuggestion { public List<Principal> autoSuggestion(final String name) { if (name.length() >= 3) { String lowerCaseName = name.toLowerCase(); ListRolesRequest listRolesRequest = new ListRolesRequest(); listRolesRequest.withMaxItems(1000); ListRolesResult result = client.listRoles(listRolesRequest); List<Pri...
PrincipalAutoSuggestion { public List<Principal> autoSuggestion(final String name) { if (name.length() >= 3) { String lowerCaseName = name.toLowerCase(); ListRolesRequest listRolesRequest = new ListRolesRequest(); listRolesRequest.withMaxItems(1000); ListRolesResult result = client.listRoles(listRolesRequest); List<Pri...
PrincipalAutoSuggestion { public List<Principal> autoSuggestion(final String name) { if (name.length() >= 3) { String lowerCaseName = name.toLowerCase(); ListRolesRequest listRolesRequest = new ListRolesRequest(); listRolesRequest.withMaxItems(1000); ListRolesResult result = client.listRoles(listRolesRequest); List<Pri...
@Test public void getAllStringSecrets() { List<StringSecretEntry> secrets = simpleSecretsGroup.getAllStringSecrets(); StringSecretEntry one = new StringSecretEntry(stringSecretIdentifier2, 1l, stringSecretValue2.asString()); StringSecretEntry two = new StringSecretEntry(stringSecretIdentifier3, 1l, stringSecretValue3.a...
@Override public List<StringSecretEntry> getAllStringSecrets() { return secretsGroup.getLatestActiveVersionOfAllSecrets() .stream() .filter(secretEntry -> secretEntry.secretValue.encoding == Encoding.UTF8) .map(StringSecretEntry::of) .collect(Collectors.toList()); }
DefaultSimpleSecretsGroup implements SimpleSecretsGroup { @Override public List<StringSecretEntry> getAllStringSecrets() { return secretsGroup.getLatestActiveVersionOfAllSecrets() .stream() .filter(secretEntry -> secretEntry.secretValue.encoding == Encoding.UTF8) .map(StringSecretEntry::of) .collect(Collectors.toList()...
DefaultSimpleSecretsGroup implements SimpleSecretsGroup { @Override public List<StringSecretEntry> getAllStringSecrets() { return secretsGroup.getLatestActiveVersionOfAllSecrets() .stream() .filter(secretEntry -> secretEntry.secretValue.encoding == Encoding.UTF8) .map(StringSecretEntry::of) .collect(Collectors.toList()...
DefaultSimpleSecretsGroup implements SimpleSecretsGroup { @Override public List<StringSecretEntry> getAllStringSecrets() { return secretsGroup.getLatestActiveVersionOfAllSecrets() .stream() .filter(secretEntry -> secretEntry.secretValue.encoding == Encoding.UTF8) .map(StringSecretEntry::of) .collect(Collectors.toList()...
DefaultSimpleSecretsGroup implements SimpleSecretsGroup { @Override public List<StringSecretEntry> getAllStringSecrets() { return secretsGroup.getLatestActiveVersionOfAllSecrets() .stream() .filter(secretEntry -> secretEntry.secretValue.encoding == Encoding.UTF8) .map(StringSecretEntry::of) .collect(Collectors.toList()...
@Test public void getAllByteSecrets() { List<ByteSecretEntry> secrets = simpleSecretsGroup.getAllBinarySecrets(); ByteSecretEntry one = new ByteSecretEntry(binarySecretIdentifier2, 1l, binarySecretValue2.asByteArray()); ByteSecretEntry two = new ByteSecretEntry(binarySecretIdentifier3, 1l, binarySecretValue3.asByteArra...
@Override public List<ByteSecretEntry> getAllBinarySecrets() { return secretsGroup.getLatestActiveVersionOfAllSecrets() .stream() .filter(secretEntry -> secretEntry.secretValue.encoding == Encoding.BINARY) .map(ByteSecretEntry::of) .collect(Collectors.toList()); }
DefaultSimpleSecretsGroup implements SimpleSecretsGroup { @Override public List<ByteSecretEntry> getAllBinarySecrets() { return secretsGroup.getLatestActiveVersionOfAllSecrets() .stream() .filter(secretEntry -> secretEntry.secretValue.encoding == Encoding.BINARY) .map(ByteSecretEntry::of) .collect(Collectors.toList());...
DefaultSimpleSecretsGroup implements SimpleSecretsGroup { @Override public List<ByteSecretEntry> getAllBinarySecrets() { return secretsGroup.getLatestActiveVersionOfAllSecrets() .stream() .filter(secretEntry -> secretEntry.secretValue.encoding == Encoding.BINARY) .map(ByteSecretEntry::of) .collect(Collectors.toList());...
DefaultSimpleSecretsGroup implements SimpleSecretsGroup { @Override public List<ByteSecretEntry> getAllBinarySecrets() { return secretsGroup.getLatestActiveVersionOfAllSecrets() .stream() .filter(secretEntry -> secretEntry.secretValue.encoding == Encoding.BINARY) .map(ByteSecretEntry::of) .collect(Collectors.toList());...
DefaultSimpleSecretsGroup implements SimpleSecretsGroup { @Override public List<ByteSecretEntry> getAllBinarySecrets() { return secretsGroup.getLatestActiveVersionOfAllSecrets() .stream() .filter(secretEntry -> secretEntry.secretValue.encoding == Encoding.BINARY) .map(ByteSecretEntry::of) .collect(Collectors.toList());...
@Test public void getStringSecret() { Optional<String> result = simpleSecretsGroup.getStringSecret(stringSecretIdentifier); assertThat(result, is(Optional.of(value1))); }
@Override public Optional<String> getStringSecret(final SecretIdentifier secretIdentifier) { return asString(secretsGroup.getLatestActiveVersion(secretIdentifier)); }
DefaultSimpleSecretsGroup implements SimpleSecretsGroup { @Override public Optional<String> getStringSecret(final SecretIdentifier secretIdentifier) { return asString(secretsGroup.getLatestActiveVersion(secretIdentifier)); } }
DefaultSimpleSecretsGroup implements SimpleSecretsGroup { @Override public Optional<String> getStringSecret(final SecretIdentifier secretIdentifier) { return asString(secretsGroup.getLatestActiveVersion(secretIdentifier)); } DefaultSimpleSecretsGroup(final SecretsGroup secretsGroup); DefaultSimpleSecretsGroup(final Se...
DefaultSimpleSecretsGroup implements SimpleSecretsGroup { @Override public Optional<String> getStringSecret(final SecretIdentifier secretIdentifier) { return asString(secretsGroup.getLatestActiveVersion(secretIdentifier)); } DefaultSimpleSecretsGroup(final SecretsGroup secretsGroup); DefaultSimpleSecretsGroup(final Se...
DefaultSimpleSecretsGroup implements SimpleSecretsGroup { @Override public Optional<String> getStringSecret(final SecretIdentifier secretIdentifier) { return asString(secretsGroup.getLatestActiveVersion(secretIdentifier)); } DefaultSimpleSecretsGroup(final SecretsGroup secretsGroup); DefaultSimpleSecretsGroup(final Se...
@Test public void versioned_getStringSecret() { Optional<String> result = simpleSecretsGroup.getStringSecret(stringSecretIdentifier, version); assertThat(result, is(Optional.of(value2))); }
@Override public Optional<String> getStringSecret(final SecretIdentifier secretIdentifier) { return asString(secretsGroup.getLatestActiveVersion(secretIdentifier)); }
DefaultSimpleSecretsGroup implements SimpleSecretsGroup { @Override public Optional<String> getStringSecret(final SecretIdentifier secretIdentifier) { return asString(secretsGroup.getLatestActiveVersion(secretIdentifier)); } }
DefaultSimpleSecretsGroup implements SimpleSecretsGroup { @Override public Optional<String> getStringSecret(final SecretIdentifier secretIdentifier) { return asString(secretsGroup.getLatestActiveVersion(secretIdentifier)); } DefaultSimpleSecretsGroup(final SecretsGroup secretsGroup); DefaultSimpleSecretsGroup(final Se...
DefaultSimpleSecretsGroup implements SimpleSecretsGroup { @Override public Optional<String> getStringSecret(final SecretIdentifier secretIdentifier) { return asString(secretsGroup.getLatestActiveVersion(secretIdentifier)); } DefaultSimpleSecretsGroup(final SecretsGroup secretsGroup); DefaultSimpleSecretsGroup(final Se...
DefaultSimpleSecretsGroup implements SimpleSecretsGroup { @Override public Optional<String> getStringSecret(final SecretIdentifier secretIdentifier) { return asString(secretsGroup.getLatestActiveVersion(secretIdentifier)); } DefaultSimpleSecretsGroup(final SecretsGroup secretsGroup); DefaultSimpleSecretsGroup(final Se...
@Test public void getBinarySecret() { Optional<byte[]> result = simpleSecretsGroup.getBinarySecret(binarySecretIdentifier); assertThat(result, is(Optional.of(value3))); }
@Override public Optional<byte[]> getBinarySecret(final SecretIdentifier secretIdentifier) { return asBinary(secretsGroup.getLatestActiveVersion(secretIdentifier)); }
DefaultSimpleSecretsGroup implements SimpleSecretsGroup { @Override public Optional<byte[]> getBinarySecret(final SecretIdentifier secretIdentifier) { return asBinary(secretsGroup.getLatestActiveVersion(secretIdentifier)); } }
DefaultSimpleSecretsGroup implements SimpleSecretsGroup { @Override public Optional<byte[]> getBinarySecret(final SecretIdentifier secretIdentifier) { return asBinary(secretsGroup.getLatestActiveVersion(secretIdentifier)); } DefaultSimpleSecretsGroup(final SecretsGroup secretsGroup); DefaultSimpleSecretsGroup(final Se...
DefaultSimpleSecretsGroup implements SimpleSecretsGroup { @Override public Optional<byte[]> getBinarySecret(final SecretIdentifier secretIdentifier) { return asBinary(secretsGroup.getLatestActiveVersion(secretIdentifier)); } DefaultSimpleSecretsGroup(final SecretsGroup secretsGroup); DefaultSimpleSecretsGroup(final Se...
DefaultSimpleSecretsGroup implements SimpleSecretsGroup { @Override public Optional<byte[]> getBinarySecret(final SecretIdentifier secretIdentifier) { return asBinary(secretsGroup.getLatestActiveVersion(secretIdentifier)); } DefaultSimpleSecretsGroup(final SecretsGroup secretsGroup); DefaultSimpleSecretsGroup(final Se...
@Test public void versioned_getBinarySecret() { Optional<byte[]> result = simpleSecretsGroup.getBinarySecret(binarySecretIdentifier, version); assertThat(result, is(Optional.of(value4))); }
@Override public Optional<byte[]> getBinarySecret(final SecretIdentifier secretIdentifier) { return asBinary(secretsGroup.getLatestActiveVersion(secretIdentifier)); }
DefaultSimpleSecretsGroup implements SimpleSecretsGroup { @Override public Optional<byte[]> getBinarySecret(final SecretIdentifier secretIdentifier) { return asBinary(secretsGroup.getLatestActiveVersion(secretIdentifier)); } }
DefaultSimpleSecretsGroup implements SimpleSecretsGroup { @Override public Optional<byte[]> getBinarySecret(final SecretIdentifier secretIdentifier) { return asBinary(secretsGroup.getLatestActiveVersion(secretIdentifier)); } DefaultSimpleSecretsGroup(final SecretsGroup secretsGroup); DefaultSimpleSecretsGroup(final Se...
DefaultSimpleSecretsGroup implements SimpleSecretsGroup { @Override public Optional<byte[]> getBinarySecret(final SecretIdentifier secretIdentifier) { return asBinary(secretsGroup.getLatestActiveVersion(secretIdentifier)); } DefaultSimpleSecretsGroup(final SecretsGroup secretsGroup); DefaultSimpleSecretsGroup(final Se...
DefaultSimpleSecretsGroup implements SimpleSecretsGroup { @Override public Optional<byte[]> getBinarySecret(final SecretIdentifier secretIdentifier) { return asBinary(secretsGroup.getLatestActiveVersion(secretIdentifier)); } DefaultSimpleSecretsGroup(final SecretsGroup secretsGroup); DefaultSimpleSecretsGroup(final Se...
@Test public void not_present_getStringSecret() { Optional<String> result = simpleSecretsGroup.getStringSecret(notPresent); assertThat(result, is(Optional.empty())); }
@Override public Optional<String> getStringSecret(final SecretIdentifier secretIdentifier) { return asString(secretsGroup.getLatestActiveVersion(secretIdentifier)); }
DefaultSimpleSecretsGroup implements SimpleSecretsGroup { @Override public Optional<String> getStringSecret(final SecretIdentifier secretIdentifier) { return asString(secretsGroup.getLatestActiveVersion(secretIdentifier)); } }
DefaultSimpleSecretsGroup implements SimpleSecretsGroup { @Override public Optional<String> getStringSecret(final SecretIdentifier secretIdentifier) { return asString(secretsGroup.getLatestActiveVersion(secretIdentifier)); } DefaultSimpleSecretsGroup(final SecretsGroup secretsGroup); DefaultSimpleSecretsGroup(final Se...
DefaultSimpleSecretsGroup implements SimpleSecretsGroup { @Override public Optional<String> getStringSecret(final SecretIdentifier secretIdentifier) { return asString(secretsGroup.getLatestActiveVersion(secretIdentifier)); } DefaultSimpleSecretsGroup(final SecretsGroup secretsGroup); DefaultSimpleSecretsGroup(final Se...
DefaultSimpleSecretsGroup implements SimpleSecretsGroup { @Override public Optional<String> getStringSecret(final SecretIdentifier secretIdentifier) { return asString(secretsGroup.getLatestActiveVersion(secretIdentifier)); } DefaultSimpleSecretsGroup(final SecretsGroup secretsGroup); DefaultSimpleSecretsGroup(final Se...
@Test public void not_present_versioned_getStringSecret() { Optional<String> result = simpleSecretsGroup.getStringSecret(notPresent, version); assertThat(result, is(Optional.empty())); }
@Override public Optional<String> getStringSecret(final SecretIdentifier secretIdentifier) { return asString(secretsGroup.getLatestActiveVersion(secretIdentifier)); }
DefaultSimpleSecretsGroup implements SimpleSecretsGroup { @Override public Optional<String> getStringSecret(final SecretIdentifier secretIdentifier) { return asString(secretsGroup.getLatestActiveVersion(secretIdentifier)); } }
DefaultSimpleSecretsGroup implements SimpleSecretsGroup { @Override public Optional<String> getStringSecret(final SecretIdentifier secretIdentifier) { return asString(secretsGroup.getLatestActiveVersion(secretIdentifier)); } DefaultSimpleSecretsGroup(final SecretsGroup secretsGroup); DefaultSimpleSecretsGroup(final Se...
DefaultSimpleSecretsGroup implements SimpleSecretsGroup { @Override public Optional<String> getStringSecret(final SecretIdentifier secretIdentifier) { return asString(secretsGroup.getLatestActiveVersion(secretIdentifier)); } DefaultSimpleSecretsGroup(final SecretsGroup secretsGroup); DefaultSimpleSecretsGroup(final Se...
DefaultSimpleSecretsGroup implements SimpleSecretsGroup { @Override public Optional<String> getStringSecret(final SecretIdentifier secretIdentifier) { return asString(secretsGroup.getLatestActiveVersion(secretIdentifier)); } DefaultSimpleSecretsGroup(final SecretsGroup secretsGroup); DefaultSimpleSecretsGroup(final Se...
@Test public void not_present_getBinarySecret() { Optional<byte[]> result = simpleSecretsGroup.getBinarySecret(notPresent); assertThat(result, is(Optional.empty())); }
@Override public Optional<byte[]> getBinarySecret(final SecretIdentifier secretIdentifier) { return asBinary(secretsGroup.getLatestActiveVersion(secretIdentifier)); }
DefaultSimpleSecretsGroup implements SimpleSecretsGroup { @Override public Optional<byte[]> getBinarySecret(final SecretIdentifier secretIdentifier) { return asBinary(secretsGroup.getLatestActiveVersion(secretIdentifier)); } }
DefaultSimpleSecretsGroup implements SimpleSecretsGroup { @Override public Optional<byte[]> getBinarySecret(final SecretIdentifier secretIdentifier) { return asBinary(secretsGroup.getLatestActiveVersion(secretIdentifier)); } DefaultSimpleSecretsGroup(final SecretsGroup secretsGroup); DefaultSimpleSecretsGroup(final Se...
DefaultSimpleSecretsGroup implements SimpleSecretsGroup { @Override public Optional<byte[]> getBinarySecret(final SecretIdentifier secretIdentifier) { return asBinary(secretsGroup.getLatestActiveVersion(secretIdentifier)); } DefaultSimpleSecretsGroup(final SecretsGroup secretsGroup); DefaultSimpleSecretsGroup(final Se...
DefaultSimpleSecretsGroup implements SimpleSecretsGroup { @Override public Optional<byte[]> getBinarySecret(final SecretIdentifier secretIdentifier) { return asBinary(secretsGroup.getLatestActiveVersion(secretIdentifier)); } DefaultSimpleSecretsGroup(final SecretsGroup secretsGroup); DefaultSimpleSecretsGroup(final Se...
@Test public void not_present_versioned_getBinarySecret() { Optional<byte[]> result = simpleSecretsGroup.getBinarySecret(notPresent, version); assertThat(result, is(Optional.empty())); }
@Override public Optional<byte[]> getBinarySecret(final SecretIdentifier secretIdentifier) { return asBinary(secretsGroup.getLatestActiveVersion(secretIdentifier)); }
DefaultSimpleSecretsGroup implements SimpleSecretsGroup { @Override public Optional<byte[]> getBinarySecret(final SecretIdentifier secretIdentifier) { return asBinary(secretsGroup.getLatestActiveVersion(secretIdentifier)); } }
DefaultSimpleSecretsGroup implements SimpleSecretsGroup { @Override public Optional<byte[]> getBinarySecret(final SecretIdentifier secretIdentifier) { return asBinary(secretsGroup.getLatestActiveVersion(secretIdentifier)); } DefaultSimpleSecretsGroup(final SecretsGroup secretsGroup); DefaultSimpleSecretsGroup(final Se...
DefaultSimpleSecretsGroup implements SimpleSecretsGroup { @Override public Optional<byte[]> getBinarySecret(final SecretIdentifier secretIdentifier) { return asBinary(secretsGroup.getLatestActiveVersion(secretIdentifier)); } DefaultSimpleSecretsGroup(final SecretsGroup secretsGroup); DefaultSimpleSecretsGroup(final Se...
DefaultSimpleSecretsGroup implements SimpleSecretsGroup { @Override public Optional<byte[]> getBinarySecret(final SecretIdentifier secretIdentifier) { return asBinary(secretsGroup.getLatestActiveVersion(secretIdentifier)); } DefaultSimpleSecretsGroup(final SecretsGroup secretsGroup); DefaultSimpleSecretsGroup(final Se...
@Test public void testDetachReadonlyRole() throws Exception { Principal principal = new Principal(PrincipalType.ROLE, "awesome-service"); partiallyMockedPolicyManager.detachReadOnly(group, principal); DetachRolePolicyRequest request = new DetachRolePolicyRequest() .withPolicyArn(READONLY_POLICY_ARN) .withRoleName(princ...
public void detachReadOnly(SecretsGroupIdentifier group, Principal principal) { detachPrincipal(group,principal, AccessLevel.READONLY); }
IAMPolicyManager { public void detachReadOnly(SecretsGroupIdentifier group, Principal principal) { detachPrincipal(group,principal, AccessLevel.READONLY); } }
IAMPolicyManager { public void detachReadOnly(SecretsGroupIdentifier group, Principal principal) { detachPrincipal(group,principal, AccessLevel.READONLY); } IAMPolicyManager(AmazonIdentityManagement client, AWSCredentialsProvider awsCredentials, ClientConfiguration clientConfiguration); }
IAMPolicyManager { public void detachReadOnly(SecretsGroupIdentifier group, Principal principal) { detachPrincipal(group,principal, AccessLevel.READONLY); } IAMPolicyManager(AmazonIdentityManagement client, AWSCredentialsProvider awsCredentials, ClientConfiguration clientConfiguration); static IAMPolicyManager fromCred...
IAMPolicyManager { public void detachReadOnly(SecretsGroupIdentifier group, Principal principal) { detachPrincipal(group,principal, AccessLevel.READONLY); } IAMPolicyManager(AmazonIdentityManagement client, AWSCredentialsProvider awsCredentials, ClientConfiguration clientConfiguration); static IAMPolicyManager fromCred...
@Test(expectedExceptions = EncodingException.class) public void getStringSecret_on_binary_secret() { simpleSecretsGroup.getStringSecret(binarySecretIdentifier); }
@Override public Optional<String> getStringSecret(final SecretIdentifier secretIdentifier) { return asString(secretsGroup.getLatestActiveVersion(secretIdentifier)); }
DefaultSimpleSecretsGroup implements SimpleSecretsGroup { @Override public Optional<String> getStringSecret(final SecretIdentifier secretIdentifier) { return asString(secretsGroup.getLatestActiveVersion(secretIdentifier)); } }
DefaultSimpleSecretsGroup implements SimpleSecretsGroup { @Override public Optional<String> getStringSecret(final SecretIdentifier secretIdentifier) { return asString(secretsGroup.getLatestActiveVersion(secretIdentifier)); } DefaultSimpleSecretsGroup(final SecretsGroup secretsGroup); DefaultSimpleSecretsGroup(final Se...
DefaultSimpleSecretsGroup implements SimpleSecretsGroup { @Override public Optional<String> getStringSecret(final SecretIdentifier secretIdentifier) { return asString(secretsGroup.getLatestActiveVersion(secretIdentifier)); } DefaultSimpleSecretsGroup(final SecretsGroup secretsGroup); DefaultSimpleSecretsGroup(final Se...
DefaultSimpleSecretsGroup implements SimpleSecretsGroup { @Override public Optional<String> getStringSecret(final SecretIdentifier secretIdentifier) { return asString(secretsGroup.getLatestActiveVersion(secretIdentifier)); } DefaultSimpleSecretsGroup(final SecretsGroup secretsGroup); DefaultSimpleSecretsGroup(final Se...
@Test(expectedExceptions = EncodingException.class) public void getBinarySecret_on_string_secret() { simpleSecretsGroup.getBinarySecret(stringSecretIdentifier); }
@Override public Optional<byte[]> getBinarySecret(final SecretIdentifier secretIdentifier) { return asBinary(secretsGroup.getLatestActiveVersion(secretIdentifier)); }
DefaultSimpleSecretsGroup implements SimpleSecretsGroup { @Override public Optional<byte[]> getBinarySecret(final SecretIdentifier secretIdentifier) { return asBinary(secretsGroup.getLatestActiveVersion(secretIdentifier)); } }
DefaultSimpleSecretsGroup implements SimpleSecretsGroup { @Override public Optional<byte[]> getBinarySecret(final SecretIdentifier secretIdentifier) { return asBinary(secretsGroup.getLatestActiveVersion(secretIdentifier)); } DefaultSimpleSecretsGroup(final SecretsGroup secretsGroup); DefaultSimpleSecretsGroup(final Se...
DefaultSimpleSecretsGroup implements SimpleSecretsGroup { @Override public Optional<byte[]> getBinarySecret(final SecretIdentifier secretIdentifier) { return asBinary(secretsGroup.getLatestActiveVersion(secretIdentifier)); } DefaultSimpleSecretsGroup(final SecretsGroup secretsGroup); DefaultSimpleSecretsGroup(final Se...
DefaultSimpleSecretsGroup implements SimpleSecretsGroup { @Override public Optional<byte[]> getBinarySecret(final SecretIdentifier secretIdentifier) { return asBinary(secretsGroup.getLatestActiveVersion(secretIdentifier)); } DefaultSimpleSecretsGroup(final SecretsGroup secretsGroup); DefaultSimpleSecretsGroup(final Se...
@Test public void testDetachAllPrincipals() throws Exception { }
public void detachAllPrincipals(SecretsGroupIdentifier group) { try { List<Principal> admins = listAttachedAdmin(group); admins.forEach(p -> detachAdmin(group, p)); } catch (DoesNotExistException e) { } try { List<Principal> readonly = listAttachedReadOnly(group); readonly.forEach(p -> detachReadOnly(group, p)); } catc...
IAMPolicyManager { public void detachAllPrincipals(SecretsGroupIdentifier group) { try { List<Principal> admins = listAttachedAdmin(group); admins.forEach(p -> detachAdmin(group, p)); } catch (DoesNotExistException e) { } try { List<Principal> readonly = listAttachedReadOnly(group); readonly.forEach(p -> detachReadOnly...
IAMPolicyManager { public void detachAllPrincipals(SecretsGroupIdentifier group) { try { List<Principal> admins = listAttachedAdmin(group); admins.forEach(p -> detachAdmin(group, p)); } catch (DoesNotExistException e) { } try { List<Principal> readonly = listAttachedReadOnly(group); readonly.forEach(p -> detachReadOnly...
IAMPolicyManager { public void detachAllPrincipals(SecretsGroupIdentifier group) { try { List<Principal> admins = listAttachedAdmin(group); admins.forEach(p -> detachAdmin(group, p)); } catch (DoesNotExistException e) { } try { List<Principal> readonly = listAttachedReadOnly(group); readonly.forEach(p -> detachReadOnly...
IAMPolicyManager { public void detachAllPrincipals(SecretsGroupIdentifier group) { try { List<Principal> admins = listAttachedAdmin(group); admins.forEach(p -> detachAdmin(group, p)); } catch (DoesNotExistException e) { } try { List<Principal> readonly = listAttachedReadOnly(group); readonly.forEach(p -> detachReadOnly...
@Test public void testListAttachedAdminNoneAttached() throws Exception { ListEntitiesForPolicyRequest request = new ListEntitiesForPolicyRequest() .withPolicyArn(ADMIN_POLICY_ARN); ListEntitiesForPolicyResult result = new ListEntitiesForPolicyResult(); when(mockClient.listEntitiesForPolicy(request)).thenReturn(result);...
public List<Principal> listAttachedAdmin(SecretsGroupIdentifier group) { return listEntities(group, AccessLevel.ADMIN); }
IAMPolicyManager { public List<Principal> listAttachedAdmin(SecretsGroupIdentifier group) { return listEntities(group, AccessLevel.ADMIN); } }
IAMPolicyManager { public List<Principal> listAttachedAdmin(SecretsGroupIdentifier group) { return listEntities(group, AccessLevel.ADMIN); } IAMPolicyManager(AmazonIdentityManagement client, AWSCredentialsProvider awsCredentials, ClientConfiguration clientConfiguration); }
IAMPolicyManager { public List<Principal> listAttachedAdmin(SecretsGroupIdentifier group) { return listEntities(group, AccessLevel.ADMIN); } IAMPolicyManager(AmazonIdentityManagement client, AWSCredentialsProvider awsCredentials, ClientConfiguration clientConfiguration); static IAMPolicyManager fromCredentials(AWSCrede...
IAMPolicyManager { public List<Principal> listAttachedAdmin(SecretsGroupIdentifier group) { return listEntities(group, AccessLevel.ADMIN); } IAMPolicyManager(AmazonIdentityManagement client, AWSCredentialsProvider awsCredentials, ClientConfiguration clientConfiguration); static IAMPolicyManager fromCredentials(AWSCrede...
@Test public void testListAttachedAdmin() throws Exception { ListEntitiesForPolicyRequest request = new ListEntitiesForPolicyRequest() .withPolicyArn(ADMIN_POLICY_ARN); PolicyGroup policyGroup = new PolicyGroup().withGroupName("awesome-group"); PolicyRole policyRole = new PolicyRole().withRoleName("awesome-service"); P...
public List<Principal> listAttachedAdmin(SecretsGroupIdentifier group) { return listEntities(group, AccessLevel.ADMIN); }
IAMPolicyManager { public List<Principal> listAttachedAdmin(SecretsGroupIdentifier group) { return listEntities(group, AccessLevel.ADMIN); } }
IAMPolicyManager { public List<Principal> listAttachedAdmin(SecretsGroupIdentifier group) { return listEntities(group, AccessLevel.ADMIN); } IAMPolicyManager(AmazonIdentityManagement client, AWSCredentialsProvider awsCredentials, ClientConfiguration clientConfiguration); }
IAMPolicyManager { public List<Principal> listAttachedAdmin(SecretsGroupIdentifier group) { return listEntities(group, AccessLevel.ADMIN); } IAMPolicyManager(AmazonIdentityManagement client, AWSCredentialsProvider awsCredentials, ClientConfiguration clientConfiguration); static IAMPolicyManager fromCredentials(AWSCrede...
IAMPolicyManager { public List<Principal> listAttachedAdmin(SecretsGroupIdentifier group) { return listEntities(group, AccessLevel.ADMIN); } IAMPolicyManager(AmazonIdentityManagement client, AWSCredentialsProvider awsCredentials, ClientConfiguration clientConfiguration); static IAMPolicyManager fromCredentials(AWSCrede...
@Test public void testListAttachedReadOnly() throws Exception { ListEntitiesForPolicyRequest request = new ListEntitiesForPolicyRequest() .withPolicyArn(READONLY_POLICY_ARN); PolicyGroup policyGroup = new PolicyGroup().withGroupName("awesome-group"); PolicyRole policyRole = new PolicyRole().withRoleName("awesome-servic...
public List<Principal> listAttachedReadOnly(SecretsGroupIdentifier group) { return listEntities(group, AccessLevel.READONLY); }
IAMPolicyManager { public List<Principal> listAttachedReadOnly(SecretsGroupIdentifier group) { return listEntities(group, AccessLevel.READONLY); } }
IAMPolicyManager { public List<Principal> listAttachedReadOnly(SecretsGroupIdentifier group) { return listEntities(group, AccessLevel.READONLY); } IAMPolicyManager(AmazonIdentityManagement client, AWSCredentialsProvider awsCredentials, ClientConfiguration clientConfiguration); }
IAMPolicyManager { public List<Principal> listAttachedReadOnly(SecretsGroupIdentifier group) { return listEntities(group, AccessLevel.READONLY); } IAMPolicyManager(AmazonIdentityManagement client, AWSCredentialsProvider awsCredentials, ClientConfiguration clientConfiguration); static IAMPolicyManager fromCredentials(AW...
IAMPolicyManager { public List<Principal> listAttachedReadOnly(SecretsGroupIdentifier group) { return listEntities(group, AccessLevel.READONLY); } IAMPolicyManager(AmazonIdentityManagement client, AWSCredentialsProvider awsCredentials, ClientConfiguration clientConfiguration); static IAMPolicyManager fromCredentials(AW...
@Test public void testGetSecretsGroupIdentifiersNoGroups() throws Exception { ListPoliciesRequest request = new ListPoliciesRequest().withMaxItems(1000).withPathPrefix("/strongbox/"); when(mockClient.listPolicies(request)).thenReturn(new ListPoliciesResult()); Set<SecretsGroupIdentifier> identifiers = partiallyMockedPo...
public Set<SecretsGroupIdentifier> getSecretsGroupIdentifiers() { ListPoliciesRequest request = new ListPoliciesRequest(); request.setMaxItems(1000); request.setPathPrefix(PATH_PREFIX); ListPoliciesResult result = client.listPolicies(request); return result.getPolicies().stream() .map(p -> IAMPolicyName.fromString(p.ge...
IAMPolicyManager { public Set<SecretsGroupIdentifier> getSecretsGroupIdentifiers() { ListPoliciesRequest request = new ListPoliciesRequest(); request.setMaxItems(1000); request.setPathPrefix(PATH_PREFIX); ListPoliciesResult result = client.listPolicies(request); return result.getPolicies().stream() .map(p -> IAMPolicyN...
IAMPolicyManager { public Set<SecretsGroupIdentifier> getSecretsGroupIdentifiers() { ListPoliciesRequest request = new ListPoliciesRequest(); request.setMaxItems(1000); request.setPathPrefix(PATH_PREFIX); ListPoliciesResult result = client.listPolicies(request); return result.getPolicies().stream() .map(p -> IAMPolicyN...
IAMPolicyManager { public Set<SecretsGroupIdentifier> getSecretsGroupIdentifiers() { ListPoliciesRequest request = new ListPoliciesRequest(); request.setMaxItems(1000); request.setPathPrefix(PATH_PREFIX); ListPoliciesResult result = client.listPolicies(request); return result.getPolicies().stream() .map(p -> IAMPolicyN...
IAMPolicyManager { public Set<SecretsGroupIdentifier> getSecretsGroupIdentifiers() { ListPoliciesRequest request = new ListPoliciesRequest(); request.setMaxItems(1000); request.setPathPrefix(PATH_PREFIX); ListPoliciesResult result = client.listPolicies(request); return result.getPolicies().stream() .map(p -> IAMPolicyN...
@Test public void testGetSecretsGroupIdentifiers() throws Exception { ListPoliciesRequest request = new ListPoliciesRequest().withMaxItems(1000).withPathPrefix("/strongbox/"); Policy policyUS1 = new Policy().withPolicyName("strongbox_us-west-1_test-group1_admin"); Policy policyUS2 = new Policy().withPolicyName("strongb...
public Set<SecretsGroupIdentifier> getSecretsGroupIdentifiers() { ListPoliciesRequest request = new ListPoliciesRequest(); request.setMaxItems(1000); request.setPathPrefix(PATH_PREFIX); ListPoliciesResult result = client.listPolicies(request); return result.getPolicies().stream() .map(p -> IAMPolicyName.fromString(p.ge...
IAMPolicyManager { public Set<SecretsGroupIdentifier> getSecretsGroupIdentifiers() { ListPoliciesRequest request = new ListPoliciesRequest(); request.setMaxItems(1000); request.setPathPrefix(PATH_PREFIX); ListPoliciesResult result = client.listPolicies(request); return result.getPolicies().stream() .map(p -> IAMPolicyN...
IAMPolicyManager { public Set<SecretsGroupIdentifier> getSecretsGroupIdentifiers() { ListPoliciesRequest request = new ListPoliciesRequest(); request.setMaxItems(1000); request.setPathPrefix(PATH_PREFIX); ListPoliciesResult result = client.listPolicies(request); return result.getPolicies().stream() .map(p -> IAMPolicyN...
IAMPolicyManager { public Set<SecretsGroupIdentifier> getSecretsGroupIdentifiers() { ListPoliciesRequest request = new ListPoliciesRequest(); request.setMaxItems(1000); request.setPathPrefix(PATH_PREFIX); ListPoliciesResult result = client.listPolicies(request); return result.getPolicies().stream() .map(p -> IAMPolicyN...
IAMPolicyManager { public Set<SecretsGroupIdentifier> getSecretsGroupIdentifiers() { ListPoliciesRequest request = new ListPoliciesRequest(); request.setMaxItems(1000); request.setPathPrefix(PATH_PREFIX); ListPoliciesResult result = client.listPolicies(request); return result.getPolicies().stream() .map(p -> IAMPolicyN...
@Test public void testCreateAdminPolicy() throws Exception { String policyDocument = new String(Files.readAllBytes(Paths.get(TEST_DATA_DIR, "test_admin_policy"))); CreatePolicyRequest request = constructCreatePolicyRequest("admin", policyDocument); CreatePolicyResult result = new CreatePolicyResult().withPolicy(new Pol...
public String createAdminPolicy(final SecretsGroupIdentifier group, final KMSEncryptor kmsEncryptor, final Store store) { String adminPolicy = "{\n" + " \"Version\": \"2012-10-17\",\n" + " \"Statement\": [\n" + kmsEncryptor.awsAdminPolicy().get() + ",\n" + storeAdminPolicyString(store) + ",\n" + listAllPolicies() + ",\...
IAMPolicyManager { public String createAdminPolicy(final SecretsGroupIdentifier group, final KMSEncryptor kmsEncryptor, final Store store) { String adminPolicy = "{\n" + " \"Version\": \"2012-10-17\",\n" + " \"Statement\": [\n" + kmsEncryptor.awsAdminPolicy().get() + ",\n" + storeAdminPolicyString(store) + ",\n" + list...
IAMPolicyManager { public String createAdminPolicy(final SecretsGroupIdentifier group, final KMSEncryptor kmsEncryptor, final Store store) { String adminPolicy = "{\n" + " \"Version\": \"2012-10-17\",\n" + " \"Statement\": [\n" + kmsEncryptor.awsAdminPolicy().get() + ",\n" + storeAdminPolicyString(store) + ",\n" + list...
IAMPolicyManager { public String createAdminPolicy(final SecretsGroupIdentifier group, final KMSEncryptor kmsEncryptor, final Store store) { String adminPolicy = "{\n" + " \"Version\": \"2012-10-17\",\n" + " \"Statement\": [\n" + kmsEncryptor.awsAdminPolicy().get() + ",\n" + storeAdminPolicyString(store) + ",\n" + list...
IAMPolicyManager { public String createAdminPolicy(final SecretsGroupIdentifier group, final KMSEncryptor kmsEncryptor, final Store store) { String adminPolicy = "{\n" + " \"Version\": \"2012-10-17\",\n" + " \"Statement\": [\n" + kmsEncryptor.awsAdminPolicy().get() + ",\n" + storeAdminPolicyString(store) + ",\n" + list...
@Test public void testCreateReadOnlyPolicy() throws Exception { String policyDocument = new String(Files.readAllBytes(Paths.get(TEST_DATA_DIR, "test_readonly_policy"))); CreatePolicyRequest request = constructCreatePolicyRequest("readonly", policyDocument); CreatePolicyResult result = new CreatePolicyResult().withPolic...
public String createReadOnlyPolicy(SecretsGroupIdentifier group, KMSEncryptor kmsEncryptor, Store store) { String readOnlyPolicy = "{\n" + " \"Version\": \"2012-10-17\",\n" + " \"Statement\": [\n" + storeReadOnlyPolicyString(store) + ",\n" + kmsEncryptor.awsReadOnlyPolicy().get() + "\n ]\n" + "}"; return createPolicy(g...
IAMPolicyManager { public String createReadOnlyPolicy(SecretsGroupIdentifier group, KMSEncryptor kmsEncryptor, Store store) { String readOnlyPolicy = "{\n" + " \"Version\": \"2012-10-17\",\n" + " \"Statement\": [\n" + storeReadOnlyPolicyString(store) + ",\n" + kmsEncryptor.awsReadOnlyPolicy().get() + "\n ]\n" + "}"; re...
IAMPolicyManager { public String createReadOnlyPolicy(SecretsGroupIdentifier group, KMSEncryptor kmsEncryptor, Store store) { String readOnlyPolicy = "{\n" + " \"Version\": \"2012-10-17\",\n" + " \"Statement\": [\n" + storeReadOnlyPolicyString(store) + ",\n" + kmsEncryptor.awsReadOnlyPolicy().get() + "\n ]\n" + "}"; re...
IAMPolicyManager { public String createReadOnlyPolicy(SecretsGroupIdentifier group, KMSEncryptor kmsEncryptor, Store store) { String readOnlyPolicy = "{\n" + " \"Version\": \"2012-10-17\",\n" + " \"Statement\": [\n" + storeReadOnlyPolicyString(store) + ",\n" + kmsEncryptor.awsReadOnlyPolicy().get() + "\n ]\n" + "}"; re...
IAMPolicyManager { public String createReadOnlyPolicy(SecretsGroupIdentifier group, KMSEncryptor kmsEncryptor, Store store) { String readOnlyPolicy = "{\n" + " \"Version\": \"2012-10-17\",\n" + " \"Statement\": [\n" + storeReadOnlyPolicyString(store) + ",\n" + kmsEncryptor.awsReadOnlyPolicy().get() + "\n ]\n" + "}"; re...
@Test public void testDeleteAdminPolicy() throws Exception { DeletePolicyRequest request = new DeletePolicyRequest().withPolicyArn(ADMIN_POLICY_ARN); partiallyMockedPolicyManager.deleteAdminPolicy(group); verify(mockClient, times(1)).deletePolicy(request); }
public void deleteAdminPolicy(SecretsGroupIdentifier group) { deletePolicy(group, AccessLevel.ADMIN); }
IAMPolicyManager { public void deleteAdminPolicy(SecretsGroupIdentifier group) { deletePolicy(group, AccessLevel.ADMIN); } }
IAMPolicyManager { public void deleteAdminPolicy(SecretsGroupIdentifier group) { deletePolicy(group, AccessLevel.ADMIN); } IAMPolicyManager(AmazonIdentityManagement client, AWSCredentialsProvider awsCredentials, ClientConfiguration clientConfiguration); }
IAMPolicyManager { public void deleteAdminPolicy(SecretsGroupIdentifier group) { deletePolicy(group, AccessLevel.ADMIN); } IAMPolicyManager(AmazonIdentityManagement client, AWSCredentialsProvider awsCredentials, ClientConfiguration clientConfiguration); static IAMPolicyManager fromCredentials(AWSCredentialsProvider aws...
IAMPolicyManager { public void deleteAdminPolicy(SecretsGroupIdentifier group) { deletePolicy(group, AccessLevel.ADMIN); } IAMPolicyManager(AmazonIdentityManagement client, AWSCredentialsProvider awsCredentials, ClientConfiguration clientConfiguration); static IAMPolicyManager fromCredentials(AWSCredentialsProvider aws...
@Test public void testAutoSuggestionShortName() throws Exception { ListRolesRequest request = new ListRolesRequest().withMaxItems(1000); List<Principal> list = partiallyMockedPrincipalAutoSuggestion.autoSuggestion("fo"); assertTrue(list.isEmpty()); verify(mockClient, never()).listRoles(request); }
public List<Principal> autoSuggestion(final String name) { if (name.length() >= 3) { String lowerCaseName = name.toLowerCase(); ListRolesRequest listRolesRequest = new ListRolesRequest(); listRolesRequest.withMaxItems(1000); ListRolesResult result = client.listRoles(listRolesRequest); List<Principal> tmp = result.getRo...
PrincipalAutoSuggestion { public List<Principal> autoSuggestion(final String name) { if (name.length() >= 3) { String lowerCaseName = name.toLowerCase(); ListRolesRequest listRolesRequest = new ListRolesRequest(); listRolesRequest.withMaxItems(1000); ListRolesResult result = client.listRoles(listRolesRequest); List<Pri...
PrincipalAutoSuggestion { public List<Principal> autoSuggestion(final String name) { if (name.length() >= 3) { String lowerCaseName = name.toLowerCase(); ListRolesRequest listRolesRequest = new ListRolesRequest(); listRolesRequest.withMaxItems(1000); ListRolesResult result = client.listRoles(listRolesRequest); List<Pri...
PrincipalAutoSuggestion { public List<Principal> autoSuggestion(final String name) { if (name.length() >= 3) { String lowerCaseName = name.toLowerCase(); ListRolesRequest listRolesRequest = new ListRolesRequest(); listRolesRequest.withMaxItems(1000); ListRolesResult result = client.listRoles(listRolesRequest); List<Pri...
PrincipalAutoSuggestion { public List<Principal> autoSuggestion(final String name) { if (name.length() >= 3) { String lowerCaseName = name.toLowerCase(); ListRolesRequest listRolesRequest = new ListRolesRequest(); listRolesRequest.withMaxItems(1000); ListRolesResult result = client.listRoles(listRolesRequest); List<Pri...