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 void shouldReturnNullWhenToStringAndValueIsNull() { String converted = typeConverter.toString(TestClass.class, null, null); assertThat(converted).isNull(); } | @Override public String toString(Type type, T value, Map<String, String> attributes) { requireNonNull(type, "type cannot be null"); if (value == null) { return null; } try { ObjectWriter objectWriter = objectMapper.writer(); return objectWriter.writeValueAsString(value); } catch (JsonProcessingException e) { throw new ... | JsonConverter implements TypeConverter<T> { @Override public String toString(Type type, T value, Map<String, String> attributes) { requireNonNull(type, "type cannot be null"); if (value == null) { return null; } try { ObjectWriter objectWriter = objectMapper.writer(); return objectWriter.writeValueAsString(value); } ca... | JsonConverter implements TypeConverter<T> { @Override public String toString(Type type, T value, Map<String, String> attributes) { requireNonNull(type, "type cannot be null"); if (value == null) { return null; } try { ObjectWriter objectWriter = objectMapper.writer(); return objectWriter.writeValueAsString(value); } ca... | JsonConverter implements TypeConverter<T> { @Override public String toString(Type type, T value, Map<String, String> attributes) { requireNonNull(type, "type cannot be null"); if (value == null) { return null; } try { ObjectWriter objectWriter = objectMapper.writer(); return objectWriter.writeValueAsString(value); } ca... | JsonConverter implements TypeConverter<T> { @Override public String toString(Type type, T value, Map<String, String> attributes) { requireNonNull(type, "type cannot be null"); if (value == null) { return null; } try { ObjectWriter objectWriter = objectMapper.writer(); return objectWriter.writeValueAsString(value); } ca... |
@Test void shouldThrowExceptionWhenTypeIsNullAndToString() { assertThatThrownBy(() -> typeConverter.toString(null, null, null)) .isExactlyInstanceOf(NullPointerException.class) .hasMessage("type cannot be null"); } | @Override public String toString(Type type, T value, Map<String, String> attributes) { requireNonNull(type, "type cannot be null"); if (value == null) { return null; } try { ObjectWriter objectWriter = objectMapper.writer(); return objectWriter.writeValueAsString(value); } catch (JsonProcessingException e) { throw new ... | JsonConverter implements TypeConverter<T> { @Override public String toString(Type type, T value, Map<String, String> attributes) { requireNonNull(type, "type cannot be null"); if (value == null) { return null; } try { ObjectWriter objectWriter = objectMapper.writer(); return objectWriter.writeValueAsString(value); } ca... | JsonConverter implements TypeConverter<T> { @Override public String toString(Type type, T value, Map<String, String> attributes) { requireNonNull(type, "type cannot be null"); if (value == null) { return null; } try { ObjectWriter objectWriter = objectMapper.writer(); return objectWriter.writeValueAsString(value); } ca... | JsonConverter implements TypeConverter<T> { @Override public String toString(Type type, T value, Map<String, String> attributes) { requireNonNull(type, "type cannot be null"); if (value == null) { return null; } try { ObjectWriter objectWriter = objectMapper.writer(); return objectWriter.writeValueAsString(value); } ca... | JsonConverter implements TypeConverter<T> { @Override public String toString(Type type, T value, Map<String, String> attributes) { requireNonNull(type, "type cannot be null"); if (value == null) { return null; } try { ObjectWriter objectWriter = objectMapper.writer(); return objectWriter.writeValueAsString(value); } ca... |
@Test public void shouldCreateEmptyKeySet() { KeyGenerator keyGenerator = emptyKeyGenerator(); List<String> configurationKeys = emptyList(); KeyGenerator fallbackKeyPrefixGenerator = emptyKeyGenerator(); List<String> keys = KeySetUtils.keySet(keyGenerator, configurationKeys, fallbackKeyPrefixGenerator, null); assertTha... | public static List<String> keySet(KeyGenerator keyGenerator, List<String> keys, KeyGenerator fallbackKeyPrefixGenerator, String fallbackKey) { requireNonNull(keyGenerator, "keyGenerator cannot be null"); requireNonNull(keys, "keys cannot be null"); Set<String> keySet = new LinkedHashSet<>(keyGenerator.computeKeys(keys)... | KeySetUtils { public static List<String> keySet(KeyGenerator keyGenerator, List<String> keys, KeyGenerator fallbackKeyPrefixGenerator, String fallbackKey) { requireNonNull(keyGenerator, "keyGenerator cannot be null"); requireNonNull(keys, "keys cannot be null"); Set<String> keySet = new LinkedHashSet<>(keyGenerator.com... | KeySetUtils { public static List<String> keySet(KeyGenerator keyGenerator, List<String> keys, KeyGenerator fallbackKeyPrefixGenerator, String fallbackKey) { requireNonNull(keyGenerator, "keyGenerator cannot be null"); requireNonNull(keys, "keys cannot be null"); Set<String> keySet = new LinkedHashSet<>(keyGenerator.com... | KeySetUtils { public static List<String> keySet(KeyGenerator keyGenerator, List<String> keys, KeyGenerator fallbackKeyPrefixGenerator, String fallbackKey) { requireNonNull(keyGenerator, "keyGenerator cannot be null"); requireNonNull(keys, "keys cannot be null"); Set<String> keySet = new LinkedHashSet<>(keyGenerator.com... | KeySetUtils { public static List<String> keySet(KeyGenerator keyGenerator, List<String> keys, KeyGenerator fallbackKeyPrefixGenerator, String fallbackKey) { requireNonNull(keyGenerator, "keyGenerator cannot be null"); requireNonNull(keys, "keys cannot be null"); Set<String> keySet = new LinkedHashSet<>(keyGenerator.com... |
@Test public void shouldGenerateKeySet() { KeyGenerator keyGenerator = keyGenerator("fallback", "fallback.p1", "fallback.p1.p2"); List<String> configurationKeys = asList("key", "alternateKey", "duplicate", "duplicate"); KeyGenerator fallbackKeyPrefixGenerator = keyGenerator("fallbackKeyPrefix"); String fallbackKey = "f... | public static List<String> keySet(KeyGenerator keyGenerator, List<String> keys, KeyGenerator fallbackKeyPrefixGenerator, String fallbackKey) { requireNonNull(keyGenerator, "keyGenerator cannot be null"); requireNonNull(keys, "keys cannot be null"); Set<String> keySet = new LinkedHashSet<>(keyGenerator.computeKeys(keys)... | KeySetUtils { public static List<String> keySet(KeyGenerator keyGenerator, List<String> keys, KeyGenerator fallbackKeyPrefixGenerator, String fallbackKey) { requireNonNull(keyGenerator, "keyGenerator cannot be null"); requireNonNull(keys, "keys cannot be null"); Set<String> keySet = new LinkedHashSet<>(keyGenerator.com... | KeySetUtils { public static List<String> keySet(KeyGenerator keyGenerator, List<String> keys, KeyGenerator fallbackKeyPrefixGenerator, String fallbackKey) { requireNonNull(keyGenerator, "keyGenerator cannot be null"); requireNonNull(keys, "keys cannot be null"); Set<String> keySet = new LinkedHashSet<>(keyGenerator.com... | KeySetUtils { public static List<String> keySet(KeyGenerator keyGenerator, List<String> keys, KeyGenerator fallbackKeyPrefixGenerator, String fallbackKey) { requireNonNull(keyGenerator, "keyGenerator cannot be null"); requireNonNull(keys, "keys cannot be null"); Set<String> keySet = new LinkedHashSet<>(keyGenerator.com... | KeySetUtils { public static List<String> keySet(KeyGenerator keyGenerator, List<String> keys, KeyGenerator fallbackKeyPrefixGenerator, String fallbackKey) { requireNonNull(keyGenerator, "keyGenerator cannot be null"); requireNonNull(keys, "keys cannot be null"); Set<String> keySet = new LinkedHashSet<>(keyGenerator.com... |
@Test public void shouldExecuteMainWithoutExceptions() { SpringAnnotationBasedExample.main(new String[0]); } | public static void main(String[] args) { try (AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(SpringAnnotationBasedExample.class)) { context.getBean(SpringAnnotationBasedExample.class).run(); } } | SpringAnnotationBasedExample { public static void main(String[] args) { try (AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(SpringAnnotationBasedExample.class)) { context.getBean(SpringAnnotationBasedExample.class).run(); } } } | SpringAnnotationBasedExample { public static void main(String[] args) { try (AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(SpringAnnotationBasedExample.class)) { context.getBean(SpringAnnotationBasedExample.class).run(); } } } | SpringAnnotationBasedExample { public static void main(String[] args) { try (AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(SpringAnnotationBasedExample.class)) { context.getBean(SpringAnnotationBasedExample.class).run(); } } static void main(String[] args); } | SpringAnnotationBasedExample { public static void main(String[] args) { try (AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(SpringAnnotationBasedExample.class)) { context.getBean(SpringAnnotationBasedExample.class).run(); } } static void main(String[] args); } |
@Test public void shouldProvidePrefixForSubConfiguration() { List<String> prefixes = extractor.getPrefixes(TestConfiguration.class, getMethod(TestConfiguration.class, "getSubConfiguration")); assertThat(prefixes).containsSequence("subConfiguration"); prefixes = extractor.getPrefixes(TestConfiguration.class, getMethod(T... | @Override public List<String> getPrefixes(Class<?> configurationType) { Key keyAnnotation = findAnnotation(configurationType, Key.class); String[] prefixes = (keyAnnotation == null) ? null : keyAnnotation.value(); if (prefixes != null && prefixes.length == 0) { prefixes = new String[]{decapitalize(configurationType.get... | AnnotationMetadataExtractor implements MetadataExtractor { @Override public List<String> getPrefixes(Class<?> configurationType) { Key keyAnnotation = findAnnotation(configurationType, Key.class); String[] prefixes = (keyAnnotation == null) ? null : keyAnnotation.value(); if (prefixes != null && prefixes.length == 0) {... | AnnotationMetadataExtractor implements MetadataExtractor { @Override public List<String> getPrefixes(Class<?> configurationType) { Key keyAnnotation = findAnnotation(configurationType, Key.class); String[] prefixes = (keyAnnotation == null) ? null : keyAnnotation.value(); if (prefixes != null && prefixes.length == 0) {... | AnnotationMetadataExtractor implements MetadataExtractor { @Override public List<String> getPrefixes(Class<?> configurationType) { Key keyAnnotation = findAnnotation(configurationType, Key.class); String[] prefixes = (keyAnnotation == null) ? null : keyAnnotation.value(); if (prefixes != null && prefixes.length == 0) {... | AnnotationMetadataExtractor implements MetadataExtractor { @Override public List<String> getPrefixes(Class<?> configurationType) { Key keyAnnotation = findAnnotation(configurationType, Key.class); String[] prefixes = (keyAnnotation == null) ? null : keyAnnotation.value(); if (prefixes != null && prefixes.length == 0) {... |
@Test public void shouldProvidePrefixForSubConfigurationWithPrefix() { List<String> prefixes = extractor.getPrefixes(TestConfiguration.class, getMethod(TestConfiguration.class, "getSubConfigurationWithPrefix")); assertThat(prefixes).isEmpty(); prefixes = extractor.getPrefixes(TestConfiguration.class, getMethod(TestConf... | @Override public List<String> getPrefixes(Class<?> configurationType) { Key keyAnnotation = findAnnotation(configurationType, Key.class); String[] prefixes = (keyAnnotation == null) ? null : keyAnnotation.value(); if (prefixes != null && prefixes.length == 0) { prefixes = new String[]{decapitalize(configurationType.get... | AnnotationMetadataExtractor implements MetadataExtractor { @Override public List<String> getPrefixes(Class<?> configurationType) { Key keyAnnotation = findAnnotation(configurationType, Key.class); String[] prefixes = (keyAnnotation == null) ? null : keyAnnotation.value(); if (prefixes != null && prefixes.length == 0) {... | AnnotationMetadataExtractor implements MetadataExtractor { @Override public List<String> getPrefixes(Class<?> configurationType) { Key keyAnnotation = findAnnotation(configurationType, Key.class); String[] prefixes = (keyAnnotation == null) ? null : keyAnnotation.value(); if (prefixes != null && prefixes.length == 0) {... | AnnotationMetadataExtractor implements MetadataExtractor { @Override public List<String> getPrefixes(Class<?> configurationType) { Key keyAnnotation = findAnnotation(configurationType, Key.class); String[] prefixes = (keyAnnotation == null) ? null : keyAnnotation.value(); if (prefixes != null && prefixes.length == 0) {... | AnnotationMetadataExtractor implements MetadataExtractor { @Override public List<String> getPrefixes(Class<?> configurationType) { Key keyAnnotation = findAnnotation(configurationType, Key.class); String[] prefixes = (keyAnnotation == null) ? null : keyAnnotation.value(); if (prefixes != null && prefixes.length == 0) {... |
@Test public void shouldProvideDefaultValuesForSubConfigurationList() { List<Map<String, String>> values = extractor.getSubConfigurationListDefaultValues(TestConfiguration.class, getMethod(TestConfiguration.class, "getSubConfigurations")); assertThat(values).hasSize(2); assertThat(values.get(0)).contains( entry("one", ... | @Override public List<Map<String, String>> getSubConfigurationListDefaultValues(Class<?> configurationType, Method method) { Class<?> subConfigurationClazz = getSubConfigurationListElementType(configurationType, method); Annotation[] defaultsAnnotations = getDefaultsAnnotations(subConfigurationClazz, method); return ge... | AnnotationMetadataExtractor implements MetadataExtractor { @Override public List<Map<String, String>> getSubConfigurationListDefaultValues(Class<?> configurationType, Method method) { Class<?> subConfigurationClazz = getSubConfigurationListElementType(configurationType, method); Annotation[] defaultsAnnotations = getDe... | AnnotationMetadataExtractor implements MetadataExtractor { @Override public List<Map<String, String>> getSubConfigurationListDefaultValues(Class<?> configurationType, Method method) { Class<?> subConfigurationClazz = getSubConfigurationListElementType(configurationType, method); Annotation[] defaultsAnnotations = getDe... | AnnotationMetadataExtractor implements MetadataExtractor { @Override public List<Map<String, String>> getSubConfigurationListDefaultValues(Class<?> configurationType, Method method) { Class<?> subConfigurationClazz = getSubConfigurationListElementType(configurationType, method); Annotation[] defaultsAnnotations = getDe... | AnnotationMetadataExtractor implements MetadataExtractor { @Override public List<Map<String, String>> getSubConfigurationListDefaultValues(Class<?> configurationType, Method method) { Class<?> subConfigurationClazz = getSubConfigurationListElementType(configurationType, method); Annotation[] defaultsAnnotations = getDe... |
@Test public void shouldProvideDefaultValuesForSubConfiguration() { Map<String, String> values = extractor.getSubConfigurationDefaultValues(TestConfiguration.class, getMethod(TestConfiguration.class, "getSubConfiguration")); assertThat(values).hasSize(2); assertThat(values).contains( entry("one", "1"), entry("two", "th... | @Override public Map<String, String> getSubConfigurationDefaultValues(Class<?> configurationType, Method method) { if (!isAnnotationDeclaredLocally(method.getReturnType(), DefaultsAnnotation.class)) { return emptyMap(); } Class<?> defaultsAnnotation = findAnnotation(method.getReturnType(), DefaultsAnnotation.class).val... | AnnotationMetadataExtractor implements MetadataExtractor { @Override public Map<String, String> getSubConfigurationDefaultValues(Class<?> configurationType, Method method) { if (!isAnnotationDeclaredLocally(method.getReturnType(), DefaultsAnnotation.class)) { return emptyMap(); } Class<?> defaultsAnnotation = findAnnot... | AnnotationMetadataExtractor implements MetadataExtractor { @Override public Map<String, String> getSubConfigurationDefaultValues(Class<?> configurationType, Method method) { if (!isAnnotationDeclaredLocally(method.getReturnType(), DefaultsAnnotation.class)) { return emptyMap(); } Class<?> defaultsAnnotation = findAnnot... | AnnotationMetadataExtractor implements MetadataExtractor { @Override public Map<String, String> getSubConfigurationDefaultValues(Class<?> configurationType, Method method) { if (!isAnnotationDeclaredLocally(method.getReturnType(), DefaultsAnnotation.class)) { return emptyMap(); } Class<?> defaultsAnnotation = findAnnot... | AnnotationMetadataExtractor implements MetadataExtractor { @Override public Map<String, String> getSubConfigurationDefaultValues(Class<?> configurationType, Method method) { if (!isAnnotationDeclaredLocally(method.getReturnType(), DefaultsAnnotation.class)) { return emptyMap(); } Class<?> defaultsAnnotation = findAnnot... |
@Test public void shouldProvideAttributesForValueProperty() { Map<String, String> attributes = extractor.attributes(TestConfiguration.class, getMethod(TestConfiguration.class, "getUrl")); assertThat(attributes).containsExactly( entry("custom", "url")); } | @Override public Map<String, String> attributes(Class<?> configurationType) { return AttributesUtils.attributes(getMetaAttributes(configurationType)); } | AnnotationMetadataExtractor implements MetadataExtractor { @Override public Map<String, String> attributes(Class<?> configurationType) { return AttributesUtils.attributes(getMetaAttributes(configurationType)); } } | AnnotationMetadataExtractor implements MetadataExtractor { @Override public Map<String, String> attributes(Class<?> configurationType) { return AttributesUtils.attributes(getMetaAttributes(configurationType)); } } | AnnotationMetadataExtractor implements MetadataExtractor { @Override public Map<String, String> attributes(Class<?> configurationType) { return AttributesUtils.attributes(getMetaAttributes(configurationType)); } static MetadataExtractor getInstance(); @Override boolean isConfigurationClass(Class<?> clazz); @Override b... | AnnotationMetadataExtractor implements MetadataExtractor { @Override public Map<String, String> attributes(Class<?> configurationType) { return AttributesUtils.attributes(getMetaAttributes(configurationType)); } static MetadataExtractor getInstance(); @Override boolean isConfigurationClass(Class<?> clazz); @Override b... |
@Test public void shouldProvideAttributesForSubConfigurationProperty() { Map<String, String> attributes = extractor.attributes(TestConfiguration.class, getMethod(TestConfiguration.class, "getSubConfiguration")); assertThat(attributes).containsExactly( entry("custom", "sub-configuration")); } | @Override public Map<String, String> attributes(Class<?> configurationType) { return AttributesUtils.attributes(getMetaAttributes(configurationType)); } | AnnotationMetadataExtractor implements MetadataExtractor { @Override public Map<String, String> attributes(Class<?> configurationType) { return AttributesUtils.attributes(getMetaAttributes(configurationType)); } } | AnnotationMetadataExtractor implements MetadataExtractor { @Override public Map<String, String> attributes(Class<?> configurationType) { return AttributesUtils.attributes(getMetaAttributes(configurationType)); } } | AnnotationMetadataExtractor implements MetadataExtractor { @Override public Map<String, String> attributes(Class<?> configurationType) { return AttributesUtils.attributes(getMetaAttributes(configurationType)); } static MetadataExtractor getInstance(); @Override boolean isConfigurationClass(Class<?> clazz); @Override b... | AnnotationMetadataExtractor implements MetadataExtractor { @Override public Map<String, String> attributes(Class<?> configurationType) { return AttributesUtils.attributes(getMetaAttributes(configurationType)); } static MetadataExtractor getInstance(); @Override boolean isConfigurationClass(Class<?> clazz); @Override b... |
@Test public void shouldProvideAttributesForSubConfigurationListProperty() { Map<String, String> attributes = extractor.attributes(TestConfiguration.class, getMethod(TestConfiguration.class, "getSubConfigurations")); assertThat(attributes).containsExactly( entry("custom", "sub-configuration-list")); } | @Override public Map<String, String> attributes(Class<?> configurationType) { return AttributesUtils.attributes(getMetaAttributes(configurationType)); } | AnnotationMetadataExtractor implements MetadataExtractor { @Override public Map<String, String> attributes(Class<?> configurationType) { return AttributesUtils.attributes(getMetaAttributes(configurationType)); } } | AnnotationMetadataExtractor implements MetadataExtractor { @Override public Map<String, String> attributes(Class<?> configurationType) { return AttributesUtils.attributes(getMetaAttributes(configurationType)); } } | AnnotationMetadataExtractor implements MetadataExtractor { @Override public Map<String, String> attributes(Class<?> configurationType) { return AttributesUtils.attributes(getMetaAttributes(configurationType)); } static MetadataExtractor getInstance(); @Override boolean isConfigurationClass(Class<?> clazz); @Override b... | AnnotationMetadataExtractor implements MetadataExtractor { @Override public Map<String, String> attributes(Class<?> configurationType) { return AttributesUtils.attributes(getMetaAttributes(configurationType)); } static MetadataExtractor getInstance(); @Override boolean isConfigurationClass(Class<?> clazz); @Override b... |
@Test public void shouldProvideAttributesForType() { Map<String, String> attributes = extractor.attributes(TestConfiguration.class); assertThat(attributes).containsExactly( entry("type1", "value1"), entry("type2", "value2")); } | @Override public Map<String, String> attributes(Class<?> configurationType) { return AttributesUtils.attributes(getMetaAttributes(configurationType)); } | AnnotationMetadataExtractor implements MetadataExtractor { @Override public Map<String, String> attributes(Class<?> configurationType) { return AttributesUtils.attributes(getMetaAttributes(configurationType)); } } | AnnotationMetadataExtractor implements MetadataExtractor { @Override public Map<String, String> attributes(Class<?> configurationType) { return AttributesUtils.attributes(getMetaAttributes(configurationType)); } } | AnnotationMetadataExtractor implements MetadataExtractor { @Override public Map<String, String> attributes(Class<?> configurationType) { return AttributesUtils.attributes(getMetaAttributes(configurationType)); } static MetadataExtractor getInstance(); @Override boolean isConfigurationClass(Class<?> clazz); @Override b... | AnnotationMetadataExtractor implements MetadataExtractor { @Override public Map<String, String> attributes(Class<?> configurationType) { return AttributesUtils.attributes(getMetaAttributes(configurationType)); } static MetadataExtractor getInstance(); @Override boolean isConfigurationClass(Class<?> clazz); @Override b... |
@Test public void shouldProvideAttributesForCustomMetaAnnotations() { Map<String, String> attributes = extractor.attributes(TestConfiguration.class, getMethod(TestConfiguration.class, "getCustomMetaAnnotations")); assertThat(attributes).containsOnly( entry("fixed-one", "one"), entry("fixed-two", "two"), entry("custom",... | @Override public Map<String, String> attributes(Class<?> configurationType) { return AttributesUtils.attributes(getMetaAttributes(configurationType)); } | AnnotationMetadataExtractor implements MetadataExtractor { @Override public Map<String, String> attributes(Class<?> configurationType) { return AttributesUtils.attributes(getMetaAttributes(configurationType)); } } | AnnotationMetadataExtractor implements MetadataExtractor { @Override public Map<String, String> attributes(Class<?> configurationType) { return AttributesUtils.attributes(getMetaAttributes(configurationType)); } } | AnnotationMetadataExtractor implements MetadataExtractor { @Override public Map<String, String> attributes(Class<?> configurationType) { return AttributesUtils.attributes(getMetaAttributes(configurationType)); } static MetadataExtractor getInstance(); @Override boolean isConfigurationClass(Class<?> clazz); @Override b... | AnnotationMetadataExtractor implements MetadataExtractor { @Override public Map<String, String> attributes(Class<?> configurationType) { return AttributesUtils.attributes(getMetaAttributes(configurationType)); } static MetadataExtractor getInstance(); @Override boolean isConfigurationClass(Class<?> clazz); @Override b... |
@Test public void shouldExtractAttributesFromFixedAnnotation() { Map<String, String> attributes = getMetaAttributes(FixedAttributesUsage.class); assertThat(attributes).containsOnly( entry("one", "value-one"), entry("two", "value-two") ); } | static Map<String, String> getMetaAttributes(Class<?> clazz) { requireNonNull(clazz, "clazz cannot be null"); return attributesByTypeCache.computeIfAbsent(clazz, c -> getMetaAttributes(getAnnotations(c))); } | AttributesExtractor { static Map<String, String> getMetaAttributes(Class<?> clazz) { requireNonNull(clazz, "clazz cannot be null"); return attributesByTypeCache.computeIfAbsent(clazz, c -> getMetaAttributes(getAnnotations(c))); } } | AttributesExtractor { static Map<String, String> getMetaAttributes(Class<?> clazz) { requireNonNull(clazz, "clazz cannot be null"); return attributesByTypeCache.computeIfAbsent(clazz, c -> getMetaAttributes(getAnnotations(c))); } private AttributesExtractor(); } | AttributesExtractor { static Map<String, String> getMetaAttributes(Class<?> clazz) { requireNonNull(clazz, "clazz cannot be null"); return attributesByTypeCache.computeIfAbsent(clazz, c -> getMetaAttributes(getAnnotations(c))); } private AttributesExtractor(); } | AttributesExtractor { static Map<String, String> getMetaAttributes(Class<?> clazz) { requireNonNull(clazz, "clazz cannot be null"); return attributesByTypeCache.computeIfAbsent(clazz, c -> getMetaAttributes(getAnnotations(c))); } private AttributesExtractor(); } |
@Test public void shouldExecuteMainWithoutExceptions() { SpringExample.main(new String[0]); } | public static void main(String[] args) { new SpringExample().run(); } | SpringExample { public static void main(String[] args) { new SpringExample().run(); } } | SpringExample { public static void main(String[] args) { new SpringExample().run(); } } | SpringExample { public static void main(String[] args) { new SpringExample().run(); } static void main(String[] args); } | SpringExample { public static void main(String[] args) { new SpringExample().run(); } static void main(String[] args); } |
@Test public void shouldExtractAttributesFromFixedAnnotationForMethod() { Map<String, String> attributes = getMetaAttributes(getMethod(FixedAttributesUsage.class, "fixedAnnotationOnly")); assertThat(attributes).containsOnly( entry("one", "value-one"), entry("two", "value-two") ); } | static Map<String, String> getMetaAttributes(Class<?> clazz) { requireNonNull(clazz, "clazz cannot be null"); return attributesByTypeCache.computeIfAbsent(clazz, c -> getMetaAttributes(getAnnotations(c))); } | AttributesExtractor { static Map<String, String> getMetaAttributes(Class<?> clazz) { requireNonNull(clazz, "clazz cannot be null"); return attributesByTypeCache.computeIfAbsent(clazz, c -> getMetaAttributes(getAnnotations(c))); } } | AttributesExtractor { static Map<String, String> getMetaAttributes(Class<?> clazz) { requireNonNull(clazz, "clazz cannot be null"); return attributesByTypeCache.computeIfAbsent(clazz, c -> getMetaAttributes(getAnnotations(c))); } private AttributesExtractor(); } | AttributesExtractor { static Map<String, String> getMetaAttributes(Class<?> clazz) { requireNonNull(clazz, "clazz cannot be null"); return attributesByTypeCache.computeIfAbsent(clazz, c -> getMetaAttributes(getAnnotations(c))); } private AttributesExtractor(); } | AttributesExtractor { static Map<String, String> getMetaAttributes(Class<?> clazz) { requireNonNull(clazz, "clazz cannot be null"); return attributesByTypeCache.computeIfAbsent(clazz, c -> getMetaAttributes(getAnnotations(c))); } private AttributesExtractor(); } |
@Test public void shouldExtractAttributesFromFixedAnnotationAndMetaForMethod() { Map<String, String> attributes = getMetaAttributes(getMethod(FixedAttributesUsage.class, "fixedAnnotationAndMeta")); assertThat(attributes).containsOnly( entry("one", "value-one"), entry("two", "value-two"), entry("another-meta", "anotherV... | static Map<String, String> getMetaAttributes(Class<?> clazz) { requireNonNull(clazz, "clazz cannot be null"); return attributesByTypeCache.computeIfAbsent(clazz, c -> getMetaAttributes(getAnnotations(c))); } | AttributesExtractor { static Map<String, String> getMetaAttributes(Class<?> clazz) { requireNonNull(clazz, "clazz cannot be null"); return attributesByTypeCache.computeIfAbsent(clazz, c -> getMetaAttributes(getAnnotations(c))); } } | AttributesExtractor { static Map<String, String> getMetaAttributes(Class<?> clazz) { requireNonNull(clazz, "clazz cannot be null"); return attributesByTypeCache.computeIfAbsent(clazz, c -> getMetaAttributes(getAnnotations(c))); } private AttributesExtractor(); } | AttributesExtractor { static Map<String, String> getMetaAttributes(Class<?> clazz) { requireNonNull(clazz, "clazz cannot be null"); return attributesByTypeCache.computeIfAbsent(clazz, c -> getMetaAttributes(getAnnotations(c))); } private AttributesExtractor(); } | AttributesExtractor { static Map<String, String> getMetaAttributes(Class<?> clazz) { requireNonNull(clazz, "clazz cannot be null"); return attributesByTypeCache.computeIfAbsent(clazz, c -> getMetaAttributes(getAnnotations(c))); } private AttributesExtractor(); } |
@Test public void shouldExtractAttributesFromCustomizableForType() { Map<String, String> attributes = getMetaAttributes(CustomizableValueUsage.class); assertThat(attributes).containsOnly( entry("name", "type-level") ); } | static Map<String, String> getMetaAttributes(Class<?> clazz) { requireNonNull(clazz, "clazz cannot be null"); return attributesByTypeCache.computeIfAbsent(clazz, c -> getMetaAttributes(getAnnotations(c))); } | AttributesExtractor { static Map<String, String> getMetaAttributes(Class<?> clazz) { requireNonNull(clazz, "clazz cannot be null"); return attributesByTypeCache.computeIfAbsent(clazz, c -> getMetaAttributes(getAnnotations(c))); } } | AttributesExtractor { static Map<String, String> getMetaAttributes(Class<?> clazz) { requireNonNull(clazz, "clazz cannot be null"); return attributesByTypeCache.computeIfAbsent(clazz, c -> getMetaAttributes(getAnnotations(c))); } private AttributesExtractor(); } | AttributesExtractor { static Map<String, String> getMetaAttributes(Class<?> clazz) { requireNonNull(clazz, "clazz cannot be null"); return attributesByTypeCache.computeIfAbsent(clazz, c -> getMetaAttributes(getAnnotations(c))); } private AttributesExtractor(); } | AttributesExtractor { static Map<String, String> getMetaAttributes(Class<?> clazz) { requireNonNull(clazz, "clazz cannot be null"); return attributesByTypeCache.computeIfAbsent(clazz, c -> getMetaAttributes(getAnnotations(c))); } private AttributesExtractor(); } |
@Test public void shouldExtractAttributesFromCustomizableForMethod() { Map<String, String> attributes = getMetaAttributes(getMethod(CustomizableValueUsage.class, "customizableOnly")); assertThat(attributes).containsOnly( entry("name", "method-level") ); } | static Map<String, String> getMetaAttributes(Class<?> clazz) { requireNonNull(clazz, "clazz cannot be null"); return attributesByTypeCache.computeIfAbsent(clazz, c -> getMetaAttributes(getAnnotations(c))); } | AttributesExtractor { static Map<String, String> getMetaAttributes(Class<?> clazz) { requireNonNull(clazz, "clazz cannot be null"); return attributesByTypeCache.computeIfAbsent(clazz, c -> getMetaAttributes(getAnnotations(c))); } } | AttributesExtractor { static Map<String, String> getMetaAttributes(Class<?> clazz) { requireNonNull(clazz, "clazz cannot be null"); return attributesByTypeCache.computeIfAbsent(clazz, c -> getMetaAttributes(getAnnotations(c))); } private AttributesExtractor(); } | AttributesExtractor { static Map<String, String> getMetaAttributes(Class<?> clazz) { requireNonNull(clazz, "clazz cannot be null"); return attributesByTypeCache.computeIfAbsent(clazz, c -> getMetaAttributes(getAnnotations(c))); } private AttributesExtractor(); } | AttributesExtractor { static Map<String, String> getMetaAttributes(Class<?> clazz) { requireNonNull(clazz, "clazz cannot be null"); return attributesByTypeCache.computeIfAbsent(clazz, c -> getMetaAttributes(getAnnotations(c))); } private AttributesExtractor(); } |
@Test public void shouldExtractAttributesFromCustomizableAndMetaForMethod() { Map<String, String> attributes = getMetaAttributes(getMethod(CustomizableValueUsage.class, "customizableAndMeta")); assertThat(attributes).containsOnly( entry("name", "method-level-with-additional-meta"), entry("another-meta", "anotherValue")... | static Map<String, String> getMetaAttributes(Class<?> clazz) { requireNonNull(clazz, "clazz cannot be null"); return attributesByTypeCache.computeIfAbsent(clazz, c -> getMetaAttributes(getAnnotations(c))); } | AttributesExtractor { static Map<String, String> getMetaAttributes(Class<?> clazz) { requireNonNull(clazz, "clazz cannot be null"); return attributesByTypeCache.computeIfAbsent(clazz, c -> getMetaAttributes(getAnnotations(c))); } } | AttributesExtractor { static Map<String, String> getMetaAttributes(Class<?> clazz) { requireNonNull(clazz, "clazz cannot be null"); return attributesByTypeCache.computeIfAbsent(clazz, c -> getMetaAttributes(getAnnotations(c))); } private AttributesExtractor(); } | AttributesExtractor { static Map<String, String> getMetaAttributes(Class<?> clazz) { requireNonNull(clazz, "clazz cannot be null"); return attributesByTypeCache.computeIfAbsent(clazz, c -> getMetaAttributes(getAnnotations(c))); } private AttributesExtractor(); } | AttributesExtractor { static Map<String, String> getMetaAttributes(Class<?> clazz) { requireNonNull(clazz, "clazz cannot be null"); return attributesByTypeCache.computeIfAbsent(clazz, c -> getMetaAttributes(getAnnotations(c))); } private AttributesExtractor(); } |
@Test public void shouldExtractAttributesFromMultipleAttributesForType() { Map<String, String> attributes = getMetaAttributes(MultipleAttributesUsage.class); assertThat(attributes).containsOnly( entry("first", "first-attribute-value"), entry("second", "second-attribute-value") ); } | static Map<String, String> getMetaAttributes(Class<?> clazz) { requireNonNull(clazz, "clazz cannot be null"); return attributesByTypeCache.computeIfAbsent(clazz, c -> getMetaAttributes(getAnnotations(c))); } | AttributesExtractor { static Map<String, String> getMetaAttributes(Class<?> clazz) { requireNonNull(clazz, "clazz cannot be null"); return attributesByTypeCache.computeIfAbsent(clazz, c -> getMetaAttributes(getAnnotations(c))); } } | AttributesExtractor { static Map<String, String> getMetaAttributes(Class<?> clazz) { requireNonNull(clazz, "clazz cannot be null"); return attributesByTypeCache.computeIfAbsent(clazz, c -> getMetaAttributes(getAnnotations(c))); } private AttributesExtractor(); } | AttributesExtractor { static Map<String, String> getMetaAttributes(Class<?> clazz) { requireNonNull(clazz, "clazz cannot be null"); return attributesByTypeCache.computeIfAbsent(clazz, c -> getMetaAttributes(getAnnotations(c))); } private AttributesExtractor(); } | AttributesExtractor { static Map<String, String> getMetaAttributes(Class<?> clazz) { requireNonNull(clazz, "clazz cannot be null"); return attributesByTypeCache.computeIfAbsent(clazz, c -> getMetaAttributes(getAnnotations(c))); } private AttributesExtractor(); } |
@Test public void shouldExtractAttributesFromMultipleAttributesForMethod() { Map<String, String> attributes = getMetaAttributes(getMethod(MultipleAttributesUsage.class, "customizableOnly")); assertThat(attributes).containsOnly( entry("first", "first-attribute-value"), entry("second", "second-attribute-value") ); } | static Map<String, String> getMetaAttributes(Class<?> clazz) { requireNonNull(clazz, "clazz cannot be null"); return attributesByTypeCache.computeIfAbsent(clazz, c -> getMetaAttributes(getAnnotations(c))); } | AttributesExtractor { static Map<String, String> getMetaAttributes(Class<?> clazz) { requireNonNull(clazz, "clazz cannot be null"); return attributesByTypeCache.computeIfAbsent(clazz, c -> getMetaAttributes(getAnnotations(c))); } } | AttributesExtractor { static Map<String, String> getMetaAttributes(Class<?> clazz) { requireNonNull(clazz, "clazz cannot be null"); return attributesByTypeCache.computeIfAbsent(clazz, c -> getMetaAttributes(getAnnotations(c))); } private AttributesExtractor(); } | AttributesExtractor { static Map<String, String> getMetaAttributes(Class<?> clazz) { requireNonNull(clazz, "clazz cannot be null"); return attributesByTypeCache.computeIfAbsent(clazz, c -> getMetaAttributes(getAnnotations(c))); } private AttributesExtractor(); } | AttributesExtractor { static Map<String, String> getMetaAttributes(Class<?> clazz) { requireNonNull(clazz, "clazz cannot be null"); return attributesByTypeCache.computeIfAbsent(clazz, c -> getMetaAttributes(getAnnotations(c))); } private AttributesExtractor(); } |
@Test public void shouldExtractAttributesFromMultipleAttributesAndMetaForMethod() { Map<String, String> attributes = getMetaAttributes(getMethod(MultipleAttributesUsage.class, "customizableAndMeta")); assertThat(attributes).containsOnly( entry("first", "first-attribute-value"), entry("second", "defaultSecondValue"), en... | static Map<String, String> getMetaAttributes(Class<?> clazz) { requireNonNull(clazz, "clazz cannot be null"); return attributesByTypeCache.computeIfAbsent(clazz, c -> getMetaAttributes(getAnnotations(c))); } | AttributesExtractor { static Map<String, String> getMetaAttributes(Class<?> clazz) { requireNonNull(clazz, "clazz cannot be null"); return attributesByTypeCache.computeIfAbsent(clazz, c -> getMetaAttributes(getAnnotations(c))); } } | AttributesExtractor { static Map<String, String> getMetaAttributes(Class<?> clazz) { requireNonNull(clazz, "clazz cannot be null"); return attributesByTypeCache.computeIfAbsent(clazz, c -> getMetaAttributes(getAnnotations(c))); } private AttributesExtractor(); } | AttributesExtractor { static Map<String, String> getMetaAttributes(Class<?> clazz) { requireNonNull(clazz, "clazz cannot be null"); return attributesByTypeCache.computeIfAbsent(clazz, c -> getMetaAttributes(getAnnotations(c))); } private AttributesExtractor(); } | AttributesExtractor { static Map<String, String> getMetaAttributes(Class<?> clazz) { requireNonNull(clazz, "clazz cannot be null"); return attributesByTypeCache.computeIfAbsent(clazz, c -> getMetaAttributes(getAnnotations(c))); } private AttributesExtractor(); } |
@Test public void shouldExtractAttributesFromManyAnnotationsForMethod() { Map<String, String> attributes = getMetaAttributes(MultipleAnnotationsUsage.class); assertThat(attributes).containsOnly( entry("one", "value-one"), entry("two", "value-two"), entry("name", "custom-value"), entry("first", "first"), entry("second",... | static Map<String, String> getMetaAttributes(Class<?> clazz) { requireNonNull(clazz, "clazz cannot be null"); return attributesByTypeCache.computeIfAbsent(clazz, c -> getMetaAttributes(getAnnotations(c))); } | AttributesExtractor { static Map<String, String> getMetaAttributes(Class<?> clazz) { requireNonNull(clazz, "clazz cannot be null"); return attributesByTypeCache.computeIfAbsent(clazz, c -> getMetaAttributes(getAnnotations(c))); } } | AttributesExtractor { static Map<String, String> getMetaAttributes(Class<?> clazz) { requireNonNull(clazz, "clazz cannot be null"); return attributesByTypeCache.computeIfAbsent(clazz, c -> getMetaAttributes(getAnnotations(c))); } private AttributesExtractor(); } | AttributesExtractor { static Map<String, String> getMetaAttributes(Class<?> clazz) { requireNonNull(clazz, "clazz cannot be null"); return attributesByTypeCache.computeIfAbsent(clazz, c -> getMetaAttributes(getAnnotations(c))); } private AttributesExtractor(); } | AttributesExtractor { static Map<String, String> getMetaAttributes(Class<?> clazz) { requireNonNull(clazz, "clazz cannot be null"); return attributesByTypeCache.computeIfAbsent(clazz, c -> getMetaAttributes(getAnnotations(c))); } private AttributesExtractor(); } |
@Test public void shouldFindAllMetaDataInTheHierarchy() { Map<String, String> attributes; attributes = getMetaAttributes(BaseConfiguration.class); assertThat(attributes).containsOnly( entry("name", "type-base"), entry("base", "type-base") ); attributes = getMetaAttributes(ChildConfiguration.class); assertThat(attribute... | static Map<String, String> getMetaAttributes(Class<?> clazz) { requireNonNull(clazz, "clazz cannot be null"); return attributesByTypeCache.computeIfAbsent(clazz, c -> getMetaAttributes(getAnnotations(c))); } | AttributesExtractor { static Map<String, String> getMetaAttributes(Class<?> clazz) { requireNonNull(clazz, "clazz cannot be null"); return attributesByTypeCache.computeIfAbsent(clazz, c -> getMetaAttributes(getAnnotations(c))); } } | AttributesExtractor { static Map<String, String> getMetaAttributes(Class<?> clazz) { requireNonNull(clazz, "clazz cannot be null"); return attributesByTypeCache.computeIfAbsent(clazz, c -> getMetaAttributes(getAnnotations(c))); } private AttributesExtractor(); } | AttributesExtractor { static Map<String, String> getMetaAttributes(Class<?> clazz) { requireNonNull(clazz, "clazz cannot be null"); return attributesByTypeCache.computeIfAbsent(clazz, c -> getMetaAttributes(getAnnotations(c))); } private AttributesExtractor(); } | AttributesExtractor { static Map<String, String> getMetaAttributes(Class<?> clazz) { requireNonNull(clazz, "clazz cannot be null"); return attributesByTypeCache.computeIfAbsent(clazz, c -> getMetaAttributes(getAnnotations(c))); } private AttributesExtractor(); } |
@Test public void shouldExecuteMainWithoutExceptions() { CoreExample.main(new String[0]); } | public static void main(String[] args) { new CoreExample().run(); } | CoreExample { public static void main(String[] args) { new CoreExample().run(); } } | CoreExample { public static void main(String[] args) { new CoreExample().run(); } } | CoreExample { public static void main(String[] args) { new CoreExample().run(); } static void main(String[] args); } | CoreExample { public static void main(String[] args) { new CoreExample().run(); } static void main(String[] args); } |
@Test public void shouldFailIfNotAllAttributesAreAnnotated() { assertThrows(IllegalArgumentException.class, () -> getMetaAttributes(NotAllAttributesAreAnnotatedUsage.class), "All @com.sabre.oss.conf4j.internal.model.provider.annotation.AttributesExtractorTest$NotAllAttributesAreAnnotated(annotated=annotatedValue, notAn... | static Map<String, String> getMetaAttributes(Class<?> clazz) { requireNonNull(clazz, "clazz cannot be null"); return attributesByTypeCache.computeIfAbsent(clazz, c -> getMetaAttributes(getAnnotations(c))); } | AttributesExtractor { static Map<String, String> getMetaAttributes(Class<?> clazz) { requireNonNull(clazz, "clazz cannot be null"); return attributesByTypeCache.computeIfAbsent(clazz, c -> getMetaAttributes(getAnnotations(c))); } } | AttributesExtractor { static Map<String, String> getMetaAttributes(Class<?> clazz) { requireNonNull(clazz, "clazz cannot be null"); return attributesByTypeCache.computeIfAbsent(clazz, c -> getMetaAttributes(getAnnotations(c))); } private AttributesExtractor(); } | AttributesExtractor { static Map<String, String> getMetaAttributes(Class<?> clazz) { requireNonNull(clazz, "clazz cannot be null"); return attributesByTypeCache.computeIfAbsent(clazz, c -> getMetaAttributes(getAnnotations(c))); } private AttributesExtractor(); } | AttributesExtractor { static Map<String, String> getMetaAttributes(Class<?> clazz) { requireNonNull(clazz, "clazz cannot be null"); return attributesByTypeCache.computeIfAbsent(clazz, c -> getMetaAttributes(getAnnotations(c))); } private AttributesExtractor(); } |
@Test public void shouldFailIfMoreThanAttributeIsDefined() { assertThrows(IllegalArgumentException.class, () -> getMetaAttributes(TooManyAttributesUsage.class), "@com.sabre.oss.conf4j.internal.model.provider.annotation.AttributesExtractorTest$TooManyAttributes(attribute=attribute, anotherAttribute=anotherAttribute) " +... | static Map<String, String> getMetaAttributes(Class<?> clazz) { requireNonNull(clazz, "clazz cannot be null"); return attributesByTypeCache.computeIfAbsent(clazz, c -> getMetaAttributes(getAnnotations(c))); } | AttributesExtractor { static Map<String, String> getMetaAttributes(Class<?> clazz) { requireNonNull(clazz, "clazz cannot be null"); return attributesByTypeCache.computeIfAbsent(clazz, c -> getMetaAttributes(getAnnotations(c))); } } | AttributesExtractor { static Map<String, String> getMetaAttributes(Class<?> clazz) { requireNonNull(clazz, "clazz cannot be null"); return attributesByTypeCache.computeIfAbsent(clazz, c -> getMetaAttributes(getAnnotations(c))); } private AttributesExtractor(); } | AttributesExtractor { static Map<String, String> getMetaAttributes(Class<?> clazz) { requireNonNull(clazz, "clazz cannot be null"); return attributesByTypeCache.computeIfAbsent(clazz, c -> getMetaAttributes(getAnnotations(c))); } private AttributesExtractor(); } | AttributesExtractor { static Map<String, String> getMetaAttributes(Class<?> clazz) { requireNonNull(clazz, "clazz cannot be null"); return attributesByTypeCache.computeIfAbsent(clazz, c -> getMetaAttributes(getAnnotations(c))); } private AttributesExtractor(); } |
@Test public void shouldFailIfInvalidAttributeType() { assertThrows(IllegalArgumentException.class, () -> getMetaAttributes(InvalidAttributeTypeUsage.class), "@com.sabre.oss.conf4j.internal.model.provider.annotation.AttributesExtractorTest$InvalidAttributeType(attribute=[1, 2]) " + "annotation is meta-annotated with @c... | static Map<String, String> getMetaAttributes(Class<?> clazz) { requireNonNull(clazz, "clazz cannot be null"); return attributesByTypeCache.computeIfAbsent(clazz, c -> getMetaAttributes(getAnnotations(c))); } | AttributesExtractor { static Map<String, String> getMetaAttributes(Class<?> clazz) { requireNonNull(clazz, "clazz cannot be null"); return attributesByTypeCache.computeIfAbsent(clazz, c -> getMetaAttributes(getAnnotations(c))); } } | AttributesExtractor { static Map<String, String> getMetaAttributes(Class<?> clazz) { requireNonNull(clazz, "clazz cannot be null"); return attributesByTypeCache.computeIfAbsent(clazz, c -> getMetaAttributes(getAnnotations(c))); } private AttributesExtractor(); } | AttributesExtractor { static Map<String, String> getMetaAttributes(Class<?> clazz) { requireNonNull(clazz, "clazz cannot be null"); return attributesByTypeCache.computeIfAbsent(clazz, c -> getMetaAttributes(getAnnotations(c))); } private AttributesExtractor(); } | AttributesExtractor { static Map<String, String> getMetaAttributes(Class<?> clazz) { requireNonNull(clazz, "clazz cannot be null"); return attributesByTypeCache.computeIfAbsent(clazz, c -> getMetaAttributes(getAnnotations(c))); } private AttributesExtractor(); } |
@Test public void shouldFindPublicAbstractMethodInClass() throws NoSuchMethodException { abstract class TestClass { public abstract int propertyA(); } Collection<Method> methods = methodsProvider.getAllDeclaredMethods(TestClass.class); assertThat(methods).contains(TestClass.class.getMethod("propertyA")); } | public Collection<Method> getAllDeclaredMethods(Class<?> configurationType) { Class<?> type = configurationType; Set<MethodWrapper> methods = new LinkedHashSet<>(addMethods(type.getMethods())); if (type.getSuperclass() != null) { do { methods.addAll(addMethods(type.getDeclaredMethods())); type = type.getSuperclass(); }... | MethodsProvider { public Collection<Method> getAllDeclaredMethods(Class<?> configurationType) { Class<?> type = configurationType; Set<MethodWrapper> methods = new LinkedHashSet<>(addMethods(type.getMethods())); if (type.getSuperclass() != null) { do { methods.addAll(addMethods(type.getDeclaredMethods())); type = type.... | MethodsProvider { public Collection<Method> getAllDeclaredMethods(Class<?> configurationType) { Class<?> type = configurationType; Set<MethodWrapper> methods = new LinkedHashSet<>(addMethods(type.getMethods())); if (type.getSuperclass() != null) { do { methods.addAll(addMethods(type.getDeclaredMethods())); type = type.... | MethodsProvider { public Collection<Method> getAllDeclaredMethods(Class<?> configurationType) { Class<?> type = configurationType; Set<MethodWrapper> methods = new LinkedHashSet<>(addMethods(type.getMethods())); if (type.getSuperclass() != null) { do { methods.addAll(addMethods(type.getDeclaredMethods())); type = type.... | MethodsProvider { public Collection<Method> getAllDeclaredMethods(Class<?> configurationType) { Class<?> type = configurationType; Set<MethodWrapper> methods = new LinkedHashSet<>(addMethods(type.getMethods())); if (type.getSuperclass() != null) { do { methods.addAll(addMethods(type.getDeclaredMethods())); type = type.... |
@Test public void shouldFindPublicAbstractMethodInheritedFromAbstractMethod() throws NoSuchMethodException { abstract class AbstractClass { public abstract int propertyA(); } abstract class TestClass extends AbstractClass { public abstract int propertyB(); } Collection<Method> methods = methodsProvider.getAllDeclaredMe... | public Collection<Method> getAllDeclaredMethods(Class<?> configurationType) { Class<?> type = configurationType; Set<MethodWrapper> methods = new LinkedHashSet<>(addMethods(type.getMethods())); if (type.getSuperclass() != null) { do { methods.addAll(addMethods(type.getDeclaredMethods())); type = type.getSuperclass(); }... | MethodsProvider { public Collection<Method> getAllDeclaredMethods(Class<?> configurationType) { Class<?> type = configurationType; Set<MethodWrapper> methods = new LinkedHashSet<>(addMethods(type.getMethods())); if (type.getSuperclass() != null) { do { methods.addAll(addMethods(type.getDeclaredMethods())); type = type.... | MethodsProvider { public Collection<Method> getAllDeclaredMethods(Class<?> configurationType) { Class<?> type = configurationType; Set<MethodWrapper> methods = new LinkedHashSet<>(addMethods(type.getMethods())); if (type.getSuperclass() != null) { do { methods.addAll(addMethods(type.getDeclaredMethods())); type = type.... | MethodsProvider { public Collection<Method> getAllDeclaredMethods(Class<?> configurationType) { Class<?> type = configurationType; Set<MethodWrapper> methods = new LinkedHashSet<>(addMethods(type.getMethods())); if (type.getSuperclass() != null) { do { methods.addAll(addMethods(type.getDeclaredMethods())); type = type.... | MethodsProvider { public Collection<Method> getAllDeclaredMethods(Class<?> configurationType) { Class<?> type = configurationType; Set<MethodWrapper> methods = new LinkedHashSet<>(addMethods(type.getMethods())); if (type.getSuperclass() != null) { do { methods.addAll(addMethods(type.getDeclaredMethods())); type = type.... |
@Test public void shouldFindMethodInheritedFromInterface() throws NoSuchMethodException { abstract class TestClass implements TestInterface { public abstract int propertyB(); } Collection<Method> methods = methodsProvider.getAllDeclaredMethods(TestClass.class); assertThat(methods).contains(TestInterface.class.getMethod... | public Collection<Method> getAllDeclaredMethods(Class<?> configurationType) { Class<?> type = configurationType; Set<MethodWrapper> methods = new LinkedHashSet<>(addMethods(type.getMethods())); if (type.getSuperclass() != null) { do { methods.addAll(addMethods(type.getDeclaredMethods())); type = type.getSuperclass(); }... | MethodsProvider { public Collection<Method> getAllDeclaredMethods(Class<?> configurationType) { Class<?> type = configurationType; Set<MethodWrapper> methods = new LinkedHashSet<>(addMethods(type.getMethods())); if (type.getSuperclass() != null) { do { methods.addAll(addMethods(type.getDeclaredMethods())); type = type.... | MethodsProvider { public Collection<Method> getAllDeclaredMethods(Class<?> configurationType) { Class<?> type = configurationType; Set<MethodWrapper> methods = new LinkedHashSet<>(addMethods(type.getMethods())); if (type.getSuperclass() != null) { do { methods.addAll(addMethods(type.getDeclaredMethods())); type = type.... | MethodsProvider { public Collection<Method> getAllDeclaredMethods(Class<?> configurationType) { Class<?> type = configurationType; Set<MethodWrapper> methods = new LinkedHashSet<>(addMethods(type.getMethods())); if (type.getSuperclass() != null) { do { methods.addAll(addMethods(type.getDeclaredMethods())); type = type.... | MethodsProvider { public Collection<Method> getAllDeclaredMethods(Class<?> configurationType) { Class<?> type = configurationType; Set<MethodWrapper> methods = new LinkedHashSet<>(addMethods(type.getMethods())); if (type.getSuperclass() != null) { do { methods.addAll(addMethods(type.getDeclaredMethods())); type = type.... |
@Test public void shouldHandleMethodFromSubclass() throws NoSuchMethodException { abstract class BaseConf { public abstract Integer propertyA(); } abstract class SpecificConf extends BaseConf { @Override public abstract Integer propertyA(); } abstract class AbstractClass { public abstract BaseConf propertyB(); } abstra... | public Collection<Method> getAllDeclaredMethods(Class<?> configurationType) { Class<?> type = configurationType; Set<MethodWrapper> methods = new LinkedHashSet<>(addMethods(type.getMethods())); if (type.getSuperclass() != null) { do { methods.addAll(addMethods(type.getDeclaredMethods())); type = type.getSuperclass(); }... | MethodsProvider { public Collection<Method> getAllDeclaredMethods(Class<?> configurationType) { Class<?> type = configurationType; Set<MethodWrapper> methods = new LinkedHashSet<>(addMethods(type.getMethods())); if (type.getSuperclass() != null) { do { methods.addAll(addMethods(type.getDeclaredMethods())); type = type.... | MethodsProvider { public Collection<Method> getAllDeclaredMethods(Class<?> configurationType) { Class<?> type = configurationType; Set<MethodWrapper> methods = new LinkedHashSet<>(addMethods(type.getMethods())); if (type.getSuperclass() != null) { do { methods.addAll(addMethods(type.getDeclaredMethods())); type = type.... | MethodsProvider { public Collection<Method> getAllDeclaredMethods(Class<?> configurationType) { Class<?> type = configurationType; Set<MethodWrapper> methods = new LinkedHashSet<>(addMethods(type.getMethods())); if (type.getSuperclass() != null) { do { methods.addAll(addMethods(type.getDeclaredMethods())); type = type.... | MethodsProvider { public Collection<Method> getAllDeclaredMethods(Class<?> configurationType) { Class<?> type = configurationType; Set<MethodWrapper> methods = new LinkedHashSet<>(addMethods(type.getMethods())); if (type.getSuperclass() != null) { do { methods.addAll(addMethods(type.getDeclaredMethods())); type = type.... |
@Test public void shouldReturnFromFallbackKey() { when(source.getValue("fallback.p1.p2.key", null)).thenReturn(present("value")); OptionalValue<String> result = provider.getConfigurationValue(typeConverter, source, metadata(getKeySet(), defaultValue, notEncrypted)); assertThat(result).isEqualTo(present("value")); } | @Override public <T> OptionalValue<T> getConfigurationValue(TypeConverter<T> typeConverter, ConfigurationSource configurationSource, PropertyMetadata metadata) { requireNonNull(typeConverter, "typeConverter cannot be null"); requireNonNull(metadata, "metadata cannot be null"); OptionalValue<String> value = absent(); St... | DefaultConfigurationValueProvider implements ConfigurationValueProvider { @Override public <T> OptionalValue<T> getConfigurationValue(TypeConverter<T> typeConverter, ConfigurationSource configurationSource, PropertyMetadata metadata) { requireNonNull(typeConverter, "typeConverter cannot be null"); requireNonNull(metada... | DefaultConfigurationValueProvider implements ConfigurationValueProvider { @Override public <T> OptionalValue<T> getConfigurationValue(TypeConverter<T> typeConverter, ConfigurationSource configurationSource, PropertyMetadata metadata) { requireNonNull(typeConverter, "typeConverter cannot be null"); requireNonNull(metada... | DefaultConfigurationValueProvider implements ConfigurationValueProvider { @Override public <T> OptionalValue<T> getConfigurationValue(TypeConverter<T> typeConverter, ConfigurationSource configurationSource, PropertyMetadata metadata) { requireNonNull(typeConverter, "typeConverter cannot be null"); requireNonNull(metada... | DefaultConfigurationValueProvider implements ConfigurationValueProvider { @Override public <T> OptionalValue<T> getConfigurationValue(TypeConverter<T> typeConverter, ConfigurationSource configurationSource, PropertyMetadata metadata) { requireNonNull(typeConverter, "typeConverter cannot be null"); requireNonNull(metada... |
@Test public void shouldReturnFromFallbackAlternateKey() { when(source.getValue("fallback.p1.p2.alternateKey", null)).thenReturn(present("value")); OptionalValue<String> result = provider.getConfigurationValue(typeConverter, source, metadata(getKeySet(), defaultValue, notEncrypted)); assertThat(result).isEqualTo(presen... | @Override public <T> OptionalValue<T> getConfigurationValue(TypeConverter<T> typeConverter, ConfigurationSource configurationSource, PropertyMetadata metadata) { requireNonNull(typeConverter, "typeConverter cannot be null"); requireNonNull(metadata, "metadata cannot be null"); OptionalValue<String> value = absent(); St... | DefaultConfigurationValueProvider implements ConfigurationValueProvider { @Override public <T> OptionalValue<T> getConfigurationValue(TypeConverter<T> typeConverter, ConfigurationSource configurationSource, PropertyMetadata metadata) { requireNonNull(typeConverter, "typeConverter cannot be null"); requireNonNull(metada... | DefaultConfigurationValueProvider implements ConfigurationValueProvider { @Override public <T> OptionalValue<T> getConfigurationValue(TypeConverter<T> typeConverter, ConfigurationSource configurationSource, PropertyMetadata metadata) { requireNonNull(typeConverter, "typeConverter cannot be null"); requireNonNull(metada... | DefaultConfigurationValueProvider implements ConfigurationValueProvider { @Override public <T> OptionalValue<T> getConfigurationValue(TypeConverter<T> typeConverter, ConfigurationSource configurationSource, PropertyMetadata metadata) { requireNonNull(typeConverter, "typeConverter cannot be null"); requireNonNull(metada... | DefaultConfigurationValueProvider implements ConfigurationValueProvider { @Override public <T> OptionalValue<T> getConfigurationValue(TypeConverter<T> typeConverter, ConfigurationSource configurationSource, PropertyMetadata metadata) { requireNonNull(typeConverter, "typeConverter cannot be null"); requireNonNull(metada... |
@Test public void shouldReturnFromFallbackPrefix() { when(source.getValue("fallback.key", null)).thenReturn(present("value")); OptionalValue<String> result = provider.getConfigurationValue(typeConverter, source, metadata(getKeySet(), defaultValue, notEncrypted)); assertThat(result).isEqualTo(present("value")); } | @Override public <T> OptionalValue<T> getConfigurationValue(TypeConverter<T> typeConverter, ConfigurationSource configurationSource, PropertyMetadata metadata) { requireNonNull(typeConverter, "typeConverter cannot be null"); requireNonNull(metadata, "metadata cannot be null"); OptionalValue<String> value = absent(); St... | DefaultConfigurationValueProvider implements ConfigurationValueProvider { @Override public <T> OptionalValue<T> getConfigurationValue(TypeConverter<T> typeConverter, ConfigurationSource configurationSource, PropertyMetadata metadata) { requireNonNull(typeConverter, "typeConverter cannot be null"); requireNonNull(metada... | DefaultConfigurationValueProvider implements ConfigurationValueProvider { @Override public <T> OptionalValue<T> getConfigurationValue(TypeConverter<T> typeConverter, ConfigurationSource configurationSource, PropertyMetadata metadata) { requireNonNull(typeConverter, "typeConverter cannot be null"); requireNonNull(metada... | DefaultConfigurationValueProvider implements ConfigurationValueProvider { @Override public <T> OptionalValue<T> getConfigurationValue(TypeConverter<T> typeConverter, ConfigurationSource configurationSource, PropertyMetadata metadata) { requireNonNull(typeConverter, "typeConverter cannot be null"); requireNonNull(metada... | DefaultConfigurationValueProvider implements ConfigurationValueProvider { @Override public <T> OptionalValue<T> getConfigurationValue(TypeConverter<T> typeConverter, ConfigurationSource configurationSource, PropertyMetadata metadata) { requireNonNull(typeConverter, "typeConverter cannot be null"); requireNonNull(metada... |
@Test public void shouldResolvePropertyPlaceholdersSetWithCorrectOrder() { assertThat(source.getValue("property.only.in.A", null)).isEqualTo(present("A")); assertThat(source.getValue("property.only.in.B", null)).isEqualTo(present("B")); assertThat(source.getValue("property.in.A.and.B", null)).isEqualTo(present("B")); } | @Override public OptionalValue<String> getValue(String key, Map<String, String> attributes) { requireNonNull(key, "key cannot be null"); for (PropertySource<?> propertySource : flattenedPropertySources) { OptionalValue<String> value = getProperty(propertySource, key); if (value.isPresent()) { return value; } } return a... | PropertySourceConfigurationSource implements ConfigurationSource, BeanFactoryAware, EnvironmentAware, InitializingBean { @Override public OptionalValue<String> getValue(String key, Map<String, String> attributes) { requireNonNull(key, "key cannot be null"); for (PropertySource<?> propertySource : flattenedPropertySourc... | PropertySourceConfigurationSource implements ConfigurationSource, BeanFactoryAware, EnvironmentAware, InitializingBean { @Override public OptionalValue<String> getValue(String key, Map<String, String> attributes) { requireNonNull(key, "key cannot be null"); for (PropertySource<?> propertySource : flattenedPropertySourc... | PropertySourceConfigurationSource implements ConfigurationSource, BeanFactoryAware, EnvironmentAware, InitializingBean { @Override public OptionalValue<String> getValue(String key, Map<String, String> attributes) { requireNonNull(key, "key cannot be null"); for (PropertySource<?> propertySource : flattenedPropertySourc... | PropertySourceConfigurationSource implements ConfigurationSource, BeanFactoryAware, EnvironmentAware, InitializingBean { @Override public OptionalValue<String> getValue(String key, Map<String, String> attributes) { requireNonNull(key, "key cannot be null"); for (PropertySource<?> propertySource : flattenedPropertySourc... |
@Test public void shouldReturnFromFallbackKeyPrefix() { Mockito.lenient().when(source.getValue("fallbackKeyPrefix.key", null)).thenReturn(present("value")); OptionalValue<String> result = provider.getConfigurationValue(typeConverter, source, metadata(getKeySet(), defaultValue, notEncrypted)); assertThat(result).isEqual... | @Override public <T> OptionalValue<T> getConfigurationValue(TypeConverter<T> typeConverter, ConfigurationSource configurationSource, PropertyMetadata metadata) { requireNonNull(typeConverter, "typeConverter cannot be null"); requireNonNull(metadata, "metadata cannot be null"); OptionalValue<String> value = absent(); St... | DefaultConfigurationValueProvider implements ConfigurationValueProvider { @Override public <T> OptionalValue<T> getConfigurationValue(TypeConverter<T> typeConverter, ConfigurationSource configurationSource, PropertyMetadata metadata) { requireNonNull(typeConverter, "typeConverter cannot be null"); requireNonNull(metada... | DefaultConfigurationValueProvider implements ConfigurationValueProvider { @Override public <T> OptionalValue<T> getConfigurationValue(TypeConverter<T> typeConverter, ConfigurationSource configurationSource, PropertyMetadata metadata) { requireNonNull(typeConverter, "typeConverter cannot be null"); requireNonNull(metada... | DefaultConfigurationValueProvider implements ConfigurationValueProvider { @Override public <T> OptionalValue<T> getConfigurationValue(TypeConverter<T> typeConverter, ConfigurationSource configurationSource, PropertyMetadata metadata) { requireNonNull(typeConverter, "typeConverter cannot be null"); requireNonNull(metada... | DefaultConfigurationValueProvider implements ConfigurationValueProvider { @Override public <T> OptionalValue<T> getConfigurationValue(TypeConverter<T> typeConverter, ConfigurationSource configurationSource, PropertyMetadata metadata) { requireNonNull(typeConverter, "typeConverter cannot be null"); requireNonNull(metada... |
@Test public void shouldNotReturnFallbackKeyPrefixValueWhenFallbackKeyPrefixIsEmpty() { Mockito.lenient().when(source.getValue(".key", null)).thenReturn(present("value")); fallbackKeyPrefixGenerator = emptyKeyGenerator(); OptionalValue<String> result = provider.getConfigurationValue(typeConverter, source, metadata(getK... | @Override public <T> OptionalValue<T> getConfigurationValue(TypeConverter<T> typeConverter, ConfigurationSource configurationSource, PropertyMetadata metadata) { requireNonNull(typeConverter, "typeConverter cannot be null"); requireNonNull(metadata, "metadata cannot be null"); OptionalValue<String> value = absent(); St... | DefaultConfigurationValueProvider implements ConfigurationValueProvider { @Override public <T> OptionalValue<T> getConfigurationValue(TypeConverter<T> typeConverter, ConfigurationSource configurationSource, PropertyMetadata metadata) { requireNonNull(typeConverter, "typeConverter cannot be null"); requireNonNull(metada... | DefaultConfigurationValueProvider implements ConfigurationValueProvider { @Override public <T> OptionalValue<T> getConfigurationValue(TypeConverter<T> typeConverter, ConfigurationSource configurationSource, PropertyMetadata metadata) { requireNonNull(typeConverter, "typeConverter cannot be null"); requireNonNull(metada... | DefaultConfigurationValueProvider implements ConfigurationValueProvider { @Override public <T> OptionalValue<T> getConfigurationValue(TypeConverter<T> typeConverter, ConfigurationSource configurationSource, PropertyMetadata metadata) { requireNonNull(typeConverter, "typeConverter cannot be null"); requireNonNull(metada... | DefaultConfigurationValueProvider implements ConfigurationValueProvider { @Override public <T> OptionalValue<T> getConfigurationValue(TypeConverter<T> typeConverter, ConfigurationSource configurationSource, PropertyMetadata metadata) { requireNonNull(typeConverter, "typeConverter cannot be null"); requireNonNull(metada... |
@Test public void shouldReturnFallbackKeyValue() { when(source.getValue("fallbackKey", null)).thenReturn(present("value")); OptionalValue<String> result = provider.getConfigurationValue(typeConverter, source, metadata(getKeySet(), defaultValue, notEncrypted)); assertThat(result).isEqualTo(present("value")); } | @Override public <T> OptionalValue<T> getConfigurationValue(TypeConverter<T> typeConverter, ConfigurationSource configurationSource, PropertyMetadata metadata) { requireNonNull(typeConverter, "typeConverter cannot be null"); requireNonNull(metadata, "metadata cannot be null"); OptionalValue<String> value = absent(); St... | DefaultConfigurationValueProvider implements ConfigurationValueProvider { @Override public <T> OptionalValue<T> getConfigurationValue(TypeConverter<T> typeConverter, ConfigurationSource configurationSource, PropertyMetadata metadata) { requireNonNull(typeConverter, "typeConverter cannot be null"); requireNonNull(metada... | DefaultConfigurationValueProvider implements ConfigurationValueProvider { @Override public <T> OptionalValue<T> getConfigurationValue(TypeConverter<T> typeConverter, ConfigurationSource configurationSource, PropertyMetadata metadata) { requireNonNull(typeConverter, "typeConverter cannot be null"); requireNonNull(metada... | DefaultConfigurationValueProvider implements ConfigurationValueProvider { @Override public <T> OptionalValue<T> getConfigurationValue(TypeConverter<T> typeConverter, ConfigurationSource configurationSource, PropertyMetadata metadata) { requireNonNull(typeConverter, "typeConverter cannot be null"); requireNonNull(metada... | DefaultConfigurationValueProvider implements ConfigurationValueProvider { @Override public <T> OptionalValue<T> getConfigurationValue(TypeConverter<T> typeConverter, ConfigurationSource configurationSource, PropertyMetadata metadata) { requireNonNull(typeConverter, "typeConverter cannot be null"); requireNonNull(metada... |
@Test public void shouldNotReturnFallbackKeyValueWhenFallbackKeyIsEmpty() { Mockito.lenient().when(source.getValue("", null)).thenReturn(present("value")); fallbackKey = null; OptionalValue<String> result = provider.getConfigurationValue(typeConverter, source, metadata(getKeySet(), defaultValue, notEncrypted)); assertT... | @Override public <T> OptionalValue<T> getConfigurationValue(TypeConverter<T> typeConverter, ConfigurationSource configurationSource, PropertyMetadata metadata) { requireNonNull(typeConverter, "typeConverter cannot be null"); requireNonNull(metadata, "metadata cannot be null"); OptionalValue<String> value = absent(); St... | DefaultConfigurationValueProvider implements ConfigurationValueProvider { @Override public <T> OptionalValue<T> getConfigurationValue(TypeConverter<T> typeConverter, ConfigurationSource configurationSource, PropertyMetadata metadata) { requireNonNull(typeConverter, "typeConverter cannot be null"); requireNonNull(metada... | DefaultConfigurationValueProvider implements ConfigurationValueProvider { @Override public <T> OptionalValue<T> getConfigurationValue(TypeConverter<T> typeConverter, ConfigurationSource configurationSource, PropertyMetadata metadata) { requireNonNull(typeConverter, "typeConverter cannot be null"); requireNonNull(metada... | DefaultConfigurationValueProvider implements ConfigurationValueProvider { @Override public <T> OptionalValue<T> getConfigurationValue(TypeConverter<T> typeConverter, ConfigurationSource configurationSource, PropertyMetadata metadata) { requireNonNull(typeConverter, "typeConverter cannot be null"); requireNonNull(metada... | DefaultConfigurationValueProvider implements ConfigurationValueProvider { @Override public <T> OptionalValue<T> getConfigurationValue(TypeConverter<T> typeConverter, ConfigurationSource configurationSource, PropertyMetadata metadata) { requireNonNull(typeConverter, "typeConverter cannot be null"); requireNonNull(metada... |
@Test public void shouldReturnMethodDefaultValue() { OptionalValue<String> result = provider.getConfigurationValue(typeConverter, source, metadata(getKeySet(), defaultValue, notEncrypted)); assertThat(result).isEqualTo(present("methodDefaultValue")); } | @Override public <T> OptionalValue<T> getConfigurationValue(TypeConverter<T> typeConverter, ConfigurationSource configurationSource, PropertyMetadata metadata) { requireNonNull(typeConverter, "typeConverter cannot be null"); requireNonNull(metadata, "metadata cannot be null"); OptionalValue<String> value = absent(); St... | DefaultConfigurationValueProvider implements ConfigurationValueProvider { @Override public <T> OptionalValue<T> getConfigurationValue(TypeConverter<T> typeConverter, ConfigurationSource configurationSource, PropertyMetadata metadata) { requireNonNull(typeConverter, "typeConverter cannot be null"); requireNonNull(metada... | DefaultConfigurationValueProvider implements ConfigurationValueProvider { @Override public <T> OptionalValue<T> getConfigurationValue(TypeConverter<T> typeConverter, ConfigurationSource configurationSource, PropertyMetadata metadata) { requireNonNull(typeConverter, "typeConverter cannot be null"); requireNonNull(metada... | DefaultConfigurationValueProvider implements ConfigurationValueProvider { @Override public <T> OptionalValue<T> getConfigurationValue(TypeConverter<T> typeConverter, ConfigurationSource configurationSource, PropertyMetadata metadata) { requireNonNull(typeConverter, "typeConverter cannot be null"); requireNonNull(metada... | DefaultConfigurationValueProvider implements ConfigurationValueProvider { @Override public <T> OptionalValue<T> getConfigurationValue(TypeConverter<T> typeConverter, ConfigurationSource configurationSource, PropertyMetadata metadata) { requireNonNull(typeConverter, "typeConverter cannot be null"); requireNonNull(metada... |
@Test public void shouldCallValueProcessor() { ConfigurationValueProcessor configurationValueProcessor = mock(ConfigurationValueProcessor.class); when(configurationValueProcessor.process(any(ConfigurationValue.class))).thenAnswer(invocation -> invocation.getArguments()[0]); when(source.getValue("fallback.key", null)).t... | @Override public <T> OptionalValue<T> getConfigurationValue(TypeConverter<T> typeConverter, ConfigurationSource configurationSource, PropertyMetadata metadata) { requireNonNull(typeConverter, "typeConverter cannot be null"); requireNonNull(metadata, "metadata cannot be null"); OptionalValue<String> value = absent(); St... | DefaultConfigurationValueProvider implements ConfigurationValueProvider { @Override public <T> OptionalValue<T> getConfigurationValue(TypeConverter<T> typeConverter, ConfigurationSource configurationSource, PropertyMetadata metadata) { requireNonNull(typeConverter, "typeConverter cannot be null"); requireNonNull(metada... | DefaultConfigurationValueProvider implements ConfigurationValueProvider { @Override public <T> OptionalValue<T> getConfigurationValue(TypeConverter<T> typeConverter, ConfigurationSource configurationSource, PropertyMetadata metadata) { requireNonNull(typeConverter, "typeConverter cannot be null"); requireNonNull(metada... | DefaultConfigurationValueProvider implements ConfigurationValueProvider { @Override public <T> OptionalValue<T> getConfigurationValue(TypeConverter<T> typeConverter, ConfigurationSource configurationSource, PropertyMetadata metadata) { requireNonNull(typeConverter, "typeConverter cannot be null"); requireNonNull(metada... | DefaultConfigurationValueProvider implements ConfigurationValueProvider { @Override public <T> OptionalValue<T> getConfigurationValue(TypeConverter<T> typeConverter, ConfigurationSource configurationSource, PropertyMetadata metadata) { requireNonNull(typeConverter, "typeConverter cannot be null"); requireNonNull(metada... |
@Test public void shouldReturnNullWhenPropertiesAreNull() { Map<String, String> properties = null; Map<String, String> attributes = attributes(properties); assertThat(attributes).isNull(); } | public static Map<String, String> attributes(Map<String, String> attributes) { return getCached(attributes, true); } | AttributesUtils implements Serializable { public static Map<String, String> attributes(Map<String, String> attributes) { return getCached(attributes, true); } } | AttributesUtils implements Serializable { public static Map<String, String> attributes(Map<String, String> attributes) { return getCached(attributes, true); } private AttributesUtils(); } | AttributesUtils implements Serializable { public static Map<String, String> attributes(Map<String, String> attributes) { return getCached(attributes, true); } private AttributesUtils(); static Map<String, String> attributes(Map<String, String> attributes); static Map<String, String> mergeAttributes(Map<String, String>... | AttributesUtils implements Serializable { public static Map<String, String> attributes(Map<String, String> attributes) { return getCached(attributes, true); } private AttributesUtils(); static Map<String, String> attributes(Map<String, String> attributes); static Map<String, String> mergeAttributes(Map<String, String>... |
@Test public void shouldConstructFromMap() { Map<String, String> properties = MapUtils.of("key1", "val1", "key2", "val2"); Map<String, String> attributes = attributes(properties); assertThat(attributes).isNotNull(); assertThat(attributes).contains(entry("key1", "val1"), entry("key2", "val2")); } | public static Map<String, String> attributes(Map<String, String> attributes) { return getCached(attributes, true); } | AttributesUtils implements Serializable { public static Map<String, String> attributes(Map<String, String> attributes) { return getCached(attributes, true); } } | AttributesUtils implements Serializable { public static Map<String, String> attributes(Map<String, String> attributes) { return getCached(attributes, true); } private AttributesUtils(); } | AttributesUtils implements Serializable { public static Map<String, String> attributes(Map<String, String> attributes) { return getCached(attributes, true); } private AttributesUtils(); static Map<String, String> attributes(Map<String, String> attributes); static Map<String, String> mergeAttributes(Map<String, String>... | AttributesUtils implements Serializable { public static Map<String, String> attributes(Map<String, String> attributes) { return getCached(attributes, true); } private AttributesUtils(); static Map<String, String> attributes(Map<String, String> attributes); static Map<String, String> mergeAttributes(Map<String, String>... |
@Test public void shouldBeImmutable() { assertThrows(UnsupportedOperationException.class, () -> attributes(MapUtils.of("key", "value")).put("anything", "value") ); } | public static Map<String, String> attributes(Map<String, String> attributes) { return getCached(attributes, true); } | AttributesUtils implements Serializable { public static Map<String, String> attributes(Map<String, String> attributes) { return getCached(attributes, true); } } | AttributesUtils implements Serializable { public static Map<String, String> attributes(Map<String, String> attributes) { return getCached(attributes, true); } private AttributesUtils(); } | AttributesUtils implements Serializable { public static Map<String, String> attributes(Map<String, String> attributes) { return getCached(attributes, true); } private AttributesUtils(); static Map<String, String> attributes(Map<String, String> attributes); static Map<String, String> mergeAttributes(Map<String, String>... | AttributesUtils implements Serializable { public static Map<String, String> attributes(Map<String, String> attributes) { return getCached(attributes, true); } private AttributesUtils(); static Map<String, String> attributes(Map<String, String> attributes); static Map<String, String> mergeAttributes(Map<String, String>... |
@Test public void shouldMergeToNullWhenBothAreNull() { Map<String, String> merged = mergeAttributes(null, null); assertThat(merged).isNull(); } | public static Map<String, String> mergeAttributes(Map<String, String> parent, Map<String, String> child) { if (parent == null) { return getCached(child, true); } if (child == null) { return getCached(parent, true); } Map<String, String> merged = new LinkedHashMap<>(parent.size() + child.size()); merged.putAll(parent); ... | AttributesUtils implements Serializable { public static Map<String, String> mergeAttributes(Map<String, String> parent, Map<String, String> child) { if (parent == null) { return getCached(child, true); } if (child == null) { return getCached(parent, true); } Map<String, String> merged = new LinkedHashMap<>(parent.size(... | AttributesUtils implements Serializable { public static Map<String, String> mergeAttributes(Map<String, String> parent, Map<String, String> child) { if (parent == null) { return getCached(child, true); } if (child == null) { return getCached(parent, true); } Map<String, String> merged = new LinkedHashMap<>(parent.size(... | AttributesUtils implements Serializable { public static Map<String, String> mergeAttributes(Map<String, String> parent, Map<String, String> child) { if (parent == null) { return getCached(child, true); } if (child == null) { return getCached(parent, true); } Map<String, String> merged = new LinkedHashMap<>(parent.size(... | AttributesUtils implements Serializable { public static Map<String, String> mergeAttributes(Map<String, String> parent, Map<String, String> child) { if (parent == null) { return getCached(child, true); } if (child == null) { return getCached(parent, true); } Map<String, String> merged = new LinkedHashMap<>(parent.size(... |
@Test public void shouldIntegrateWithSpring() { try (AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(SpringConfiguration.class)) { TypeConverter<?> typeConverter = context.getBean(TypeConverter.class); assertThat(typeConverter).isInstanceOf(CachingTypeConverter.class); Long val = (Lo... | @SuppressWarnings("unchecked") @Override public T fromString(Type type, String value, Map<String, String> attributes) { requireNonNull(type, "type cannot be null"); SimpleKey key = new SimpleKey(type, attributes, value); ValueWrapper valueWrapper = cache.get(key); if (valueWrapper != null) { return (T) valueWrapper.get... | CachingTypeConverter implements TypeConverter<T>, InitializingBean { @SuppressWarnings("unchecked") @Override public T fromString(Type type, String value, Map<String, String> attributes) { requireNonNull(type, "type cannot be null"); SimpleKey key = new SimpleKey(type, attributes, value); ValueWrapper valueWrapper = ca... | CachingTypeConverter implements TypeConverter<T>, InitializingBean { @SuppressWarnings("unchecked") @Override public T fromString(Type type, String value, Map<String, String> attributes) { requireNonNull(type, "type cannot be null"); SimpleKey key = new SimpleKey(type, attributes, value); ValueWrapper valueWrapper = ca... | CachingTypeConverter implements TypeConverter<T>, InitializingBean { @SuppressWarnings("unchecked") @Override public T fromString(Type type, String value, Map<String, String> attributes) { requireNonNull(type, "type cannot be null"); SimpleKey key = new SimpleKey(type, attributes, value); ValueWrapper valueWrapper = ca... | CachingTypeConverter implements TypeConverter<T>, InitializingBean { @SuppressWarnings("unchecked") @Override public T fromString(Type type, String value, Map<String, String> attributes) { requireNonNull(type, "type cannot be null"); SimpleKey key = new SimpleKey(type, attributes, value); ValueWrapper valueWrapper = ca... |
@Test public void shouldProvideSameInstanceForSameProperties() { Map<String, String> properties = MapUtils.of("key1", "value1", "key2", "value2"); Map<String, String> sameProperties = new HashMap<>(properties); Map<String, String> attributes = attributes(properties); Map<String, String> attributesForSameProperties = at... | public static Map<String, String> attributes(Map<String, String> attributes) { return getCached(attributes, true); } | AttributesUtils implements Serializable { public static Map<String, String> attributes(Map<String, String> attributes) { return getCached(attributes, true); } } | AttributesUtils implements Serializable { public static Map<String, String> attributes(Map<String, String> attributes) { return getCached(attributes, true); } private AttributesUtils(); } | AttributesUtils implements Serializable { public static Map<String, String> attributes(Map<String, String> attributes) { return getCached(attributes, true); } private AttributesUtils(); static Map<String, String> attributes(Map<String, String> attributes); static Map<String, String> mergeAttributes(Map<String, String>... | AttributesUtils implements Serializable { public static Map<String, String> attributes(Map<String, String> attributes) { return getCached(attributes, true); } private AttributesUtils(); static Map<String, String> attributes(Map<String, String> attributes); static Map<String, String> mergeAttributes(Map<String, String>... |
@Test public void shouldGetProperties() { Bean bean = new Bean(); assertThat(getProperty(bean, "intValue")).isEqualTo(0); assertThat(getProperty(bean, "stringValue")).isNull(); assertThat(getProperty(bean, "beanValue")).isNull(); bean.setIntValue(1); assertThat(getProperty(bean, "intValue")).isEqualTo(bean.getIntValue(... | public static Object getProperty(Object bean, String name) { requireNonNull(bean, "bean cannot be null"); requireNonNull(name, "name cannot be null"); Class<?> beanClass = bean.getClass(); try { PropertyDescriptor descriptor = findPropertyDescriptor(beanClass, name); Method readMethod = descriptor.getReadMethod(); retu... | PropertyUtils { public static Object getProperty(Object bean, String name) { requireNonNull(bean, "bean cannot be null"); requireNonNull(name, "name cannot be null"); Class<?> beanClass = bean.getClass(); try { PropertyDescriptor descriptor = findPropertyDescriptor(beanClass, name); Method readMethod = descriptor.getRe... | PropertyUtils { public static Object getProperty(Object bean, String name) { requireNonNull(bean, "bean cannot be null"); requireNonNull(name, "name cannot be null"); Class<?> beanClass = bean.getClass(); try { PropertyDescriptor descriptor = findPropertyDescriptor(beanClass, name); Method readMethod = descriptor.getRe... | PropertyUtils { public static Object getProperty(Object bean, String name) { requireNonNull(bean, "bean cannot be null"); requireNonNull(name, "name cannot be null"); Class<?> beanClass = bean.getClass(); try { PropertyDescriptor descriptor = findPropertyDescriptor(beanClass, name); Method readMethod = descriptor.getRe... | PropertyUtils { public static Object getProperty(Object bean, String name) { requireNonNull(bean, "bean cannot be null"); requireNonNull(name, "name cannot be null"); Class<?> beanClass = bean.getClass(); try { PropertyDescriptor descriptor = findPropertyDescriptor(beanClass, name); Method readMethod = descriptor.getRe... |
@Test public void shouldSetProperties() { Bean bean = new Bean(); setProperty(bean, "intValue", 1); assertThat(bean.getIntValue()).isEqualTo(1); setProperty(bean, "stringValue", "string"); assertThat(bean.getStringValue()).isEqualTo("string"); Bean beanValue = new Bean(); setProperty(bean, "beanValue", beanValue); asse... | public static void setProperty(Object bean, String name, Object value) { requireNonNull(bean, "bean cannot be null"); requireNonNull(name, "name cannot be null"); Class<?> beanClass = bean.getClass(); try { PropertyDescriptor descriptor = findPropertyDescriptor(beanClass, name); Method writeMethod = descriptor.getWrite... | PropertyUtils { public static void setProperty(Object bean, String name, Object value) { requireNonNull(bean, "bean cannot be null"); requireNonNull(name, "name cannot be null"); Class<?> beanClass = bean.getClass(); try { PropertyDescriptor descriptor = findPropertyDescriptor(beanClass, name); Method writeMethod = des... | PropertyUtils { public static void setProperty(Object bean, String name, Object value) { requireNonNull(bean, "bean cannot be null"); requireNonNull(name, "name cannot be null"); Class<?> beanClass = bean.getClass(); try { PropertyDescriptor descriptor = findPropertyDescriptor(beanClass, name); Method writeMethod = des... | PropertyUtils { public static void setProperty(Object bean, String name, Object value) { requireNonNull(bean, "bean cannot be null"); requireNonNull(name, "name cannot be null"); Class<?> beanClass = bean.getClass(); try { PropertyDescriptor descriptor = findPropertyDescriptor(beanClass, name); Method writeMethod = des... | PropertyUtils { public static void setProperty(Object bean, String name, Object value) { requireNonNull(bean, "bean cannot be null"); requireNonNull(name, "name cannot be null"); Class<?> beanClass = bean.getClass(); try { PropertyDescriptor descriptor = findPropertyDescriptor(beanClass, name); Method writeMethod = des... |
@Test public void getPropertyShouldThrowNoSuchMethodExceptionWhenPropertyNotFound() { assertThrows(IllegalArgumentException.class, () -> getProperty(new Bean(), "unknownProperty")); } | public static Object getProperty(Object bean, String name) { requireNonNull(bean, "bean cannot be null"); requireNonNull(name, "name cannot be null"); Class<?> beanClass = bean.getClass(); try { PropertyDescriptor descriptor = findPropertyDescriptor(beanClass, name); Method readMethod = descriptor.getReadMethod(); retu... | PropertyUtils { public static Object getProperty(Object bean, String name) { requireNonNull(bean, "bean cannot be null"); requireNonNull(name, "name cannot be null"); Class<?> beanClass = bean.getClass(); try { PropertyDescriptor descriptor = findPropertyDescriptor(beanClass, name); Method readMethod = descriptor.getRe... | PropertyUtils { public static Object getProperty(Object bean, String name) { requireNonNull(bean, "bean cannot be null"); requireNonNull(name, "name cannot be null"); Class<?> beanClass = bean.getClass(); try { PropertyDescriptor descriptor = findPropertyDescriptor(beanClass, name); Method readMethod = descriptor.getRe... | PropertyUtils { public static Object getProperty(Object bean, String name) { requireNonNull(bean, "bean cannot be null"); requireNonNull(name, "name cannot be null"); Class<?> beanClass = bean.getClass(); try { PropertyDescriptor descriptor = findPropertyDescriptor(beanClass, name); Method readMethod = descriptor.getRe... | PropertyUtils { public static Object getProperty(Object bean, String name) { requireNonNull(bean, "bean cannot be null"); requireNonNull(name, "name cannot be null"); Class<?> beanClass = bean.getClass(); try { PropertyDescriptor descriptor = findPropertyDescriptor(beanClass, name); Method readMethod = descriptor.getRe... |
@Test public void getPropertyShouldThrowNoSuchMethodExceptionWhenPropertyIsCapitalized() { assertThrows(IllegalArgumentException.class, () -> getProperty(new Bean(), "BeanValue")); } | public static Object getProperty(Object bean, String name) { requireNonNull(bean, "bean cannot be null"); requireNonNull(name, "name cannot be null"); Class<?> beanClass = bean.getClass(); try { PropertyDescriptor descriptor = findPropertyDescriptor(beanClass, name); Method readMethod = descriptor.getReadMethod(); retu... | PropertyUtils { public static Object getProperty(Object bean, String name) { requireNonNull(bean, "bean cannot be null"); requireNonNull(name, "name cannot be null"); Class<?> beanClass = bean.getClass(); try { PropertyDescriptor descriptor = findPropertyDescriptor(beanClass, name); Method readMethod = descriptor.getRe... | PropertyUtils { public static Object getProperty(Object bean, String name) { requireNonNull(bean, "bean cannot be null"); requireNonNull(name, "name cannot be null"); Class<?> beanClass = bean.getClass(); try { PropertyDescriptor descriptor = findPropertyDescriptor(beanClass, name); Method readMethod = descriptor.getRe... | PropertyUtils { public static Object getProperty(Object bean, String name) { requireNonNull(bean, "bean cannot be null"); requireNonNull(name, "name cannot be null"); Class<?> beanClass = bean.getClass(); try { PropertyDescriptor descriptor = findPropertyDescriptor(beanClass, name); Method readMethod = descriptor.getRe... | PropertyUtils { public static Object getProperty(Object bean, String name) { requireNonNull(bean, "bean cannot be null"); requireNonNull(name, "name cannot be null"); Class<?> beanClass = bean.getClass(); try { PropertyDescriptor descriptor = findPropertyDescriptor(beanClass, name); Method readMethod = descriptor.getRe... |
@Test public void getPropertyShouldThrowNullPointerExceptionWhenNullBean() { assertThrows(NullPointerException.class, () -> getProperty(null, "intValue")); } | public static Object getProperty(Object bean, String name) { requireNonNull(bean, "bean cannot be null"); requireNonNull(name, "name cannot be null"); Class<?> beanClass = bean.getClass(); try { PropertyDescriptor descriptor = findPropertyDescriptor(beanClass, name); Method readMethod = descriptor.getReadMethod(); retu... | PropertyUtils { public static Object getProperty(Object bean, String name) { requireNonNull(bean, "bean cannot be null"); requireNonNull(name, "name cannot be null"); Class<?> beanClass = bean.getClass(); try { PropertyDescriptor descriptor = findPropertyDescriptor(beanClass, name); Method readMethod = descriptor.getRe... | PropertyUtils { public static Object getProperty(Object bean, String name) { requireNonNull(bean, "bean cannot be null"); requireNonNull(name, "name cannot be null"); Class<?> beanClass = bean.getClass(); try { PropertyDescriptor descriptor = findPropertyDescriptor(beanClass, name); Method readMethod = descriptor.getRe... | PropertyUtils { public static Object getProperty(Object bean, String name) { requireNonNull(bean, "bean cannot be null"); requireNonNull(name, "name cannot be null"); Class<?> beanClass = bean.getClass(); try { PropertyDescriptor descriptor = findPropertyDescriptor(beanClass, name); Method readMethod = descriptor.getRe... | PropertyUtils { public static Object getProperty(Object bean, String name) { requireNonNull(bean, "bean cannot be null"); requireNonNull(name, "name cannot be null"); Class<?> beanClass = bean.getClass(); try { PropertyDescriptor descriptor = findPropertyDescriptor(beanClass, name); Method readMethod = descriptor.getRe... |
@Test public void getPropertyShouldThrowNullPointerExceptionWhenNullPropertyName() { assertThrows(NullPointerException.class, () -> getProperty(new Bean(), null)); } | public static Object getProperty(Object bean, String name) { requireNonNull(bean, "bean cannot be null"); requireNonNull(name, "name cannot be null"); Class<?> beanClass = bean.getClass(); try { PropertyDescriptor descriptor = findPropertyDescriptor(beanClass, name); Method readMethod = descriptor.getReadMethod(); retu... | PropertyUtils { public static Object getProperty(Object bean, String name) { requireNonNull(bean, "bean cannot be null"); requireNonNull(name, "name cannot be null"); Class<?> beanClass = bean.getClass(); try { PropertyDescriptor descriptor = findPropertyDescriptor(beanClass, name); Method readMethod = descriptor.getRe... | PropertyUtils { public static Object getProperty(Object bean, String name) { requireNonNull(bean, "bean cannot be null"); requireNonNull(name, "name cannot be null"); Class<?> beanClass = bean.getClass(); try { PropertyDescriptor descriptor = findPropertyDescriptor(beanClass, name); Method readMethod = descriptor.getRe... | PropertyUtils { public static Object getProperty(Object bean, String name) { requireNonNull(bean, "bean cannot be null"); requireNonNull(name, "name cannot be null"); Class<?> beanClass = bean.getClass(); try { PropertyDescriptor descriptor = findPropertyDescriptor(beanClass, name); Method readMethod = descriptor.getRe... | PropertyUtils { public static Object getProperty(Object bean, String name) { requireNonNull(bean, "bean cannot be null"); requireNonNull(name, "name cannot be null"); Class<?> beanClass = bean.getClass(); try { PropertyDescriptor descriptor = findPropertyDescriptor(beanClass, name); Method readMethod = descriptor.getRe... |
@Test public void setPropertyShouldThrowExceptionWhenPropertyTypeMismatch() { assertThrows(IllegalArgumentException.class, () -> setProperty(new Bean(), "beanValue", "invalid-type")); } | public static void setProperty(Object bean, String name, Object value) { requireNonNull(bean, "bean cannot be null"); requireNonNull(name, "name cannot be null"); Class<?> beanClass = bean.getClass(); try { PropertyDescriptor descriptor = findPropertyDescriptor(beanClass, name); Method writeMethod = descriptor.getWrite... | PropertyUtils { public static void setProperty(Object bean, String name, Object value) { requireNonNull(bean, "bean cannot be null"); requireNonNull(name, "name cannot be null"); Class<?> beanClass = bean.getClass(); try { PropertyDescriptor descriptor = findPropertyDescriptor(beanClass, name); Method writeMethod = des... | PropertyUtils { public static void setProperty(Object bean, String name, Object value) { requireNonNull(bean, "bean cannot be null"); requireNonNull(name, "name cannot be null"); Class<?> beanClass = bean.getClass(); try { PropertyDescriptor descriptor = findPropertyDescriptor(beanClass, name); Method writeMethod = des... | PropertyUtils { public static void setProperty(Object bean, String name, Object value) { requireNonNull(bean, "bean cannot be null"); requireNonNull(name, "name cannot be null"); Class<?> beanClass = bean.getClass(); try { PropertyDescriptor descriptor = findPropertyDescriptor(beanClass, name); Method writeMethod = des... | PropertyUtils { public static void setProperty(Object bean, String name, Object value) { requireNonNull(bean, "bean cannot be null"); requireNonNull(name, "name cannot be null"); Class<?> beanClass = bean.getClass(); try { PropertyDescriptor descriptor = findPropertyDescriptor(beanClass, name); Method writeMethod = des... |
@Test public void setPropertyShouldThrowNoSuchMethodExceptionWhenPropertyNotFound() { assertThrows(IllegalArgumentException.class, () -> setProperty(new Bean(), "unknownProperty", null)); } | public static void setProperty(Object bean, String name, Object value) { requireNonNull(bean, "bean cannot be null"); requireNonNull(name, "name cannot be null"); Class<?> beanClass = bean.getClass(); try { PropertyDescriptor descriptor = findPropertyDescriptor(beanClass, name); Method writeMethod = descriptor.getWrite... | PropertyUtils { public static void setProperty(Object bean, String name, Object value) { requireNonNull(bean, "bean cannot be null"); requireNonNull(name, "name cannot be null"); Class<?> beanClass = bean.getClass(); try { PropertyDescriptor descriptor = findPropertyDescriptor(beanClass, name); Method writeMethod = des... | PropertyUtils { public static void setProperty(Object bean, String name, Object value) { requireNonNull(bean, "bean cannot be null"); requireNonNull(name, "name cannot be null"); Class<?> beanClass = bean.getClass(); try { PropertyDescriptor descriptor = findPropertyDescriptor(beanClass, name); Method writeMethod = des... | PropertyUtils { public static void setProperty(Object bean, String name, Object value) { requireNonNull(bean, "bean cannot be null"); requireNonNull(name, "name cannot be null"); Class<?> beanClass = bean.getClass(); try { PropertyDescriptor descriptor = findPropertyDescriptor(beanClass, name); Method writeMethod = des... | PropertyUtils { public static void setProperty(Object bean, String name, Object value) { requireNonNull(bean, "bean cannot be null"); requireNonNull(name, "name cannot be null"); Class<?> beanClass = bean.getClass(); try { PropertyDescriptor descriptor = findPropertyDescriptor(beanClass, name); Method writeMethod = des... |
@Test public void setPropertyShouldThrowNoSuchMethodExceptionWhenPropertyIsCapitalized() { assertThrows(IllegalArgumentException.class, () -> setProperty(new Bean(), "BeanValue", null)); } | public static void setProperty(Object bean, String name, Object value) { requireNonNull(bean, "bean cannot be null"); requireNonNull(name, "name cannot be null"); Class<?> beanClass = bean.getClass(); try { PropertyDescriptor descriptor = findPropertyDescriptor(beanClass, name); Method writeMethod = descriptor.getWrite... | PropertyUtils { public static void setProperty(Object bean, String name, Object value) { requireNonNull(bean, "bean cannot be null"); requireNonNull(name, "name cannot be null"); Class<?> beanClass = bean.getClass(); try { PropertyDescriptor descriptor = findPropertyDescriptor(beanClass, name); Method writeMethod = des... | PropertyUtils { public static void setProperty(Object bean, String name, Object value) { requireNonNull(bean, "bean cannot be null"); requireNonNull(name, "name cannot be null"); Class<?> beanClass = bean.getClass(); try { PropertyDescriptor descriptor = findPropertyDescriptor(beanClass, name); Method writeMethod = des... | PropertyUtils { public static void setProperty(Object bean, String name, Object value) { requireNonNull(bean, "bean cannot be null"); requireNonNull(name, "name cannot be null"); Class<?> beanClass = bean.getClass(); try { PropertyDescriptor descriptor = findPropertyDescriptor(beanClass, name); Method writeMethod = des... | PropertyUtils { public static void setProperty(Object bean, String name, Object value) { requireNonNull(bean, "bean cannot be null"); requireNonNull(name, "name cannot be null"); Class<?> beanClass = bean.getClass(); try { PropertyDescriptor descriptor = findPropertyDescriptor(beanClass, name); Method writeMethod = des... |
@Test public void shouldBeApplicableForMultipleXmlTypes() { assertThat(jaxbTypeConverter.isApplicable(XmlRootConfiguration01.class, null)).isTrue(); assertThat(jaxbTypeConverter.isApplicable(XmlRootConfiguration02.class, null)).isTrue(); } | @Override public boolean isApplicable(Type type, Map<String, String> attributes) { requireNonNull(type, "type cannot be null"); return type instanceof Class && ((AnnotatedElement) type).getAnnotation(XmlRootElement.class) != null; } | JaxbConverter implements TypeConverter<T> { @Override public boolean isApplicable(Type type, Map<String, String> attributes) { requireNonNull(type, "type cannot be null"); return type instanceof Class && ((AnnotatedElement) type).getAnnotation(XmlRootElement.class) != null; } } | JaxbConverter implements TypeConverter<T> { @Override public boolean isApplicable(Type type, Map<String, String> attributes) { requireNonNull(type, "type cannot be null"); return type instanceof Class && ((AnnotatedElement) type).getAnnotation(XmlRootElement.class) != null; } } | JaxbConverter implements TypeConverter<T> { @Override public boolean isApplicable(Type type, Map<String, String> attributes) { requireNonNull(type, "type cannot be null"); return type instanceof Class && ((AnnotatedElement) type).getAnnotation(XmlRootElement.class) != null; } @Override boolean isApplicable(Type type, ... | JaxbConverter implements TypeConverter<T> { @Override public boolean isApplicable(Type type, Map<String, String> attributes) { requireNonNull(type, "type cannot be null"); return type instanceof Class && ((AnnotatedElement) type).getAnnotation(XmlRootElement.class) != null; } @Override boolean isApplicable(Type type, ... |
@Test public void setPropertyShouldThrowNullPointerExceptionWhenNullBean() { assertThrows(NullPointerException.class, () -> setProperty(null, "intValue", 1)); } | public static void setProperty(Object bean, String name, Object value) { requireNonNull(bean, "bean cannot be null"); requireNonNull(name, "name cannot be null"); Class<?> beanClass = bean.getClass(); try { PropertyDescriptor descriptor = findPropertyDescriptor(beanClass, name); Method writeMethod = descriptor.getWrite... | PropertyUtils { public static void setProperty(Object bean, String name, Object value) { requireNonNull(bean, "bean cannot be null"); requireNonNull(name, "name cannot be null"); Class<?> beanClass = bean.getClass(); try { PropertyDescriptor descriptor = findPropertyDescriptor(beanClass, name); Method writeMethod = des... | PropertyUtils { public static void setProperty(Object bean, String name, Object value) { requireNonNull(bean, "bean cannot be null"); requireNonNull(name, "name cannot be null"); Class<?> beanClass = bean.getClass(); try { PropertyDescriptor descriptor = findPropertyDescriptor(beanClass, name); Method writeMethod = des... | PropertyUtils { public static void setProperty(Object bean, String name, Object value) { requireNonNull(bean, "bean cannot be null"); requireNonNull(name, "name cannot be null"); Class<?> beanClass = bean.getClass(); try { PropertyDescriptor descriptor = findPropertyDescriptor(beanClass, name); Method writeMethod = des... | PropertyUtils { public static void setProperty(Object bean, String name, Object value) { requireNonNull(bean, "bean cannot be null"); requireNonNull(name, "name cannot be null"); Class<?> beanClass = bean.getClass(); try { PropertyDescriptor descriptor = findPropertyDescriptor(beanClass, name); Method writeMethod = des... |
@Test public void setPropertyShouldThrowNullPointerExceptionWhenNullPropertyName() { assertThrows(NullPointerException.class, () -> setProperty(new Bean(), null, null)); } | public static void setProperty(Object bean, String name, Object value) { requireNonNull(bean, "bean cannot be null"); requireNonNull(name, "name cannot be null"); Class<?> beanClass = bean.getClass(); try { PropertyDescriptor descriptor = findPropertyDescriptor(beanClass, name); Method writeMethod = descriptor.getWrite... | PropertyUtils { public static void setProperty(Object bean, String name, Object value) { requireNonNull(bean, "bean cannot be null"); requireNonNull(name, "name cannot be null"); Class<?> beanClass = bean.getClass(); try { PropertyDescriptor descriptor = findPropertyDescriptor(beanClass, name); Method writeMethod = des... | PropertyUtils { public static void setProperty(Object bean, String name, Object value) { requireNonNull(bean, "bean cannot be null"); requireNonNull(name, "name cannot be null"); Class<?> beanClass = bean.getClass(); try { PropertyDescriptor descriptor = findPropertyDescriptor(beanClass, name); Method writeMethod = des... | PropertyUtils { public static void setProperty(Object bean, String name, Object value) { requireNonNull(bean, "bean cannot be null"); requireNonNull(name, "name cannot be null"); Class<?> beanClass = bean.getClass(); try { PropertyDescriptor descriptor = findPropertyDescriptor(beanClass, name); Method writeMethod = des... | PropertyUtils { public static void setProperty(Object bean, String name, Object value) { requireNonNull(bean, "bean cannot be null"); requireNonNull(name, "name cannot be null"); Class<?> beanClass = bean.getClass(); try { PropertyDescriptor descriptor = findPropertyDescriptor(beanClass, name); Method writeMethod = des... |
@Test public void getPropertyNameShouldProvidePropertyNameFromValidAccessor() { assertThat(getPropertyName(getMethod(Bean.class, "getIntValue"))).isEqualTo("intValue"); assertThat(getPropertyName(getMethod(Bean.class, "setIntValue"))).isEqualTo("intValue"); assertThat(getPropertyName(getMethod(Bean.class, "getStringVal... | public static String getPropertyName(Method method) { requireNonNull(method, "method cannot be null"); String name = method.getName(); if (name.startsWith("set")) { if (method.getParameterCount() != 1) { throw new IllegalArgumentException("Method " + method + " is not a valid setter."); } name = name.substring(3); } el... | PropertyUtils { public static String getPropertyName(Method method) { requireNonNull(method, "method cannot be null"); String name = method.getName(); if (name.startsWith("set")) { if (method.getParameterCount() != 1) { throw new IllegalArgumentException("Method " + method + " is not a valid setter."); } name = name.su... | PropertyUtils { public static String getPropertyName(Method method) { requireNonNull(method, "method cannot be null"); String name = method.getName(); if (name.startsWith("set")) { if (method.getParameterCount() != 1) { throw new IllegalArgumentException("Method " + method + " is not a valid setter."); } name = name.su... | PropertyUtils { public static String getPropertyName(Method method) { requireNonNull(method, "method cannot be null"); String name = method.getName(); if (name.startsWith("set")) { if (method.getParameterCount() != 1) { throw new IllegalArgumentException("Method " + method + " is not a valid setter."); } name = name.su... | PropertyUtils { public static String getPropertyName(Method method) { requireNonNull(method, "method cannot be null"); String name = method.getName(); if (name.startsWith("set")) { if (method.getParameterCount() != 1) { throw new IllegalArgumentException("Method " + method + " is not a valid setter."); } name = name.su... |
@Test public void getPropertyNameShouldThrowNPEWhenMethodIsNull() { assertThrows(NullPointerException.class, () -> getPropertyName(null)); } | public static String getPropertyName(Method method) { requireNonNull(method, "method cannot be null"); String name = method.getName(); if (name.startsWith("set")) { if (method.getParameterCount() != 1) { throw new IllegalArgumentException("Method " + method + " is not a valid setter."); } name = name.substring(3); } el... | PropertyUtils { public static String getPropertyName(Method method) { requireNonNull(method, "method cannot be null"); String name = method.getName(); if (name.startsWith("set")) { if (method.getParameterCount() != 1) { throw new IllegalArgumentException("Method " + method + " is not a valid setter."); } name = name.su... | PropertyUtils { public static String getPropertyName(Method method) { requireNonNull(method, "method cannot be null"); String name = method.getName(); if (name.startsWith("set")) { if (method.getParameterCount() != 1) { throw new IllegalArgumentException("Method " + method + " is not a valid setter."); } name = name.su... | PropertyUtils { public static String getPropertyName(Method method) { requireNonNull(method, "method cannot be null"); String name = method.getName(); if (name.startsWith("set")) { if (method.getParameterCount() != 1) { throw new IllegalArgumentException("Method " + method + " is not a valid setter."); } name = name.su... | PropertyUtils { public static String getPropertyName(Method method) { requireNonNull(method, "method cannot be null"); String name = method.getName(); if (name.startsWith("set")) { if (method.getParameterCount() != 1) { throw new IllegalArgumentException("Method " + method + " is not a valid setter."); } name = name.su... |
@Test public void getPropertyNameShouldThrowIAEWhenMethodIsNotGetterNorSetter() { assertThrows(IllegalArgumentException.class, () -> getPropertyName(getMethod(Bean.class, "equals"))); } | public static String getPropertyName(Method method) { requireNonNull(method, "method cannot be null"); String name = method.getName(); if (name.startsWith("set")) { if (method.getParameterCount() != 1) { throw new IllegalArgumentException("Method " + method + " is not a valid setter."); } name = name.substring(3); } el... | PropertyUtils { public static String getPropertyName(Method method) { requireNonNull(method, "method cannot be null"); String name = method.getName(); if (name.startsWith("set")) { if (method.getParameterCount() != 1) { throw new IllegalArgumentException("Method " + method + " is not a valid setter."); } name = name.su... | PropertyUtils { public static String getPropertyName(Method method) { requireNonNull(method, "method cannot be null"); String name = method.getName(); if (name.startsWith("set")) { if (method.getParameterCount() != 1) { throw new IllegalArgumentException("Method " + method + " is not a valid setter."); } name = name.su... | PropertyUtils { public static String getPropertyName(Method method) { requireNonNull(method, "method cannot be null"); String name = method.getName(); if (name.startsWith("set")) { if (method.getParameterCount() != 1) { throw new IllegalArgumentException("Method " + method + " is not a valid setter."); } name = name.su... | PropertyUtils { public static String getPropertyName(Method method) { requireNonNull(method, "method cannot be null"); String name = method.getName(); if (name.startsWith("set")) { if (method.getParameterCount() != 1) { throw new IllegalArgumentException("Method " + method + " is not a valid setter."); } name = name.su... |
@Test public void shouldReturnValuesFromProperSource() { assertThat(source.getValue(A_KEY, null).get()).isEqualTo(A_KEY); assertThat(source.getValue(B_KEY, null).get()).isEqualTo(B_KEY); } | @Override public OptionalValue<String> getValue(String key, Map<String, String> attributes) { requireNonNull(key, "key cannot be null"); for (ConfigurationSource source : sources) { OptionalValue<String> value = source.getValue(key, attributes); if (value.isPresent()) { return value; } } return absent(); } | MultiConfigurationSource implements ConfigurationSource { @Override public OptionalValue<String> getValue(String key, Map<String, String> attributes) { requireNonNull(key, "key cannot be null"); for (ConfigurationSource source : sources) { OptionalValue<String> value = source.getValue(key, attributes); if (value.isPres... | MultiConfigurationSource implements ConfigurationSource { @Override public OptionalValue<String> getValue(String key, Map<String, String> attributes) { requireNonNull(key, "key cannot be null"); for (ConfigurationSource source : sources) { OptionalValue<String> value = source.getValue(key, attributes); if (value.isPres... | MultiConfigurationSource implements ConfigurationSource { @Override public OptionalValue<String> getValue(String key, Map<String, String> attributes) { requireNonNull(key, "key cannot be null"); for (ConfigurationSource source : sources) { OptionalValue<String> value = source.getValue(key, attributes); if (value.isPres... | MultiConfigurationSource implements ConfigurationSource { @Override public OptionalValue<String> getValue(String key, Map<String, String> attributes) { requireNonNull(key, "key cannot be null"); for (ConfigurationSource source : sources) { OptionalValue<String> value = source.getValue(key, attributes); if (value.isPres... |
@Test public void shouldFindValuesInProperSource() { assertThat(source.findEntry(asList("NotExistingKey", B_KEY), null)).isEqualTo(new ConfigurationEntry(B_KEY, B_KEY)); } | @Override public ConfigurationEntry findEntry(Collection<String> keys, Map<String, String> attributes) { requireNonNull(keys, "keys cannot be null"); for (ConfigurationSource source : sources) { ConfigurationEntry entry = source.findEntry(keys, attributes); if (entry != null) { return entry; } } return null; } | MultiConfigurationSource implements ConfigurationSource { @Override public ConfigurationEntry findEntry(Collection<String> keys, Map<String, String> attributes) { requireNonNull(keys, "keys cannot be null"); for (ConfigurationSource source : sources) { ConfigurationEntry entry = source.findEntry(keys, attributes); if (... | MultiConfigurationSource implements ConfigurationSource { @Override public ConfigurationEntry findEntry(Collection<String> keys, Map<String, String> attributes) { requireNonNull(keys, "keys cannot be null"); for (ConfigurationSource source : sources) { ConfigurationEntry entry = source.findEntry(keys, attributes); if (... | MultiConfigurationSource implements ConfigurationSource { @Override public ConfigurationEntry findEntry(Collection<String> keys, Map<String, String> attributes) { requireNonNull(keys, "keys cannot be null"); for (ConfigurationSource source : sources) { ConfigurationEntry entry = source.findEntry(keys, attributes); if (... | MultiConfigurationSource implements ConfigurationSource { @Override public ConfigurationEntry findEntry(Collection<String> keys, Map<String, String> attributes) { requireNonNull(keys, "keys cannot be null"); for (ConfigurationSource source : sources) { ConfigurationEntry entry = source.findEntry(keys, attributes); if (... |
@Test public void shouldGetSingleValueFromUnderlyingMap() { ConfigurationSource source = new MapConfigurationSource(of("key1", "value1", "key2", "value2")); String value = source.getValue("key2", null).get(); assertThat(value).isEqualTo("value2"); } | @Override public OptionalValue<String> getValue(String key, Map<String, String> attributes) { requireNonNull(key, "key cannot be null"); String value = source.get(key); return value != null || source.containsKey(key) ? present(value) : absent(); } | MapConfigurationSource implements IterableConfigurationSource { @Override public OptionalValue<String> getValue(String key, Map<String, String> attributes) { requireNonNull(key, "key cannot be null"); String value = source.get(key); return value != null || source.containsKey(key) ? present(value) : absent(); } } | MapConfigurationSource implements IterableConfigurationSource { @Override public OptionalValue<String> getValue(String key, Map<String, String> attributes) { requireNonNull(key, "key cannot be null"); String value = source.get(key); return value != null || source.containsKey(key) ? present(value) : absent(); } MapConfi... | MapConfigurationSource implements IterableConfigurationSource { @Override public OptionalValue<String> getValue(String key, Map<String, String> attributes) { requireNonNull(key, "key cannot be null"); String value = source.get(key); return value != null || source.containsKey(key) ? present(value) : absent(); } MapConfi... | MapConfigurationSource implements IterableConfigurationSource { @Override public OptionalValue<String> getValue(String key, Map<String, String> attributes) { requireNonNull(key, "key cannot be null"); String value = source.get(key); return value != null || source.containsKey(key) ? present(value) : absent(); } MapConfi... |
@Test public void shouldIterateOver() { MapConfigurationSource source = new MapConfigurationSource(of("key1", "value1", "key2", "value2")); Iterable<ConfigurationEntry> iterable = source.getAllConfigurationEntries(); assertThat(iterable).containsExactly(new ConfigurationEntry("key1", "value1"), new ConfigurationEntry("... | @Override public Iterable<ConfigurationEntry> getAllConfigurationEntries() { return new MapConfigurationEntryIterable(source); } | MapConfigurationSource implements IterableConfigurationSource { @Override public Iterable<ConfigurationEntry> getAllConfigurationEntries() { return new MapConfigurationEntryIterable(source); } } | MapConfigurationSource implements IterableConfigurationSource { @Override public Iterable<ConfigurationEntry> getAllConfigurationEntries() { return new MapConfigurationEntryIterable(source); } MapConfigurationSource(Map<String, String> source); } | MapConfigurationSource implements IterableConfigurationSource { @Override public Iterable<ConfigurationEntry> getAllConfigurationEntries() { return new MapConfigurationEntryIterable(source); } MapConfigurationSource(Map<String, String> source); @Override OptionalValue<String> getValue(String key, Map<String, String> at... | MapConfigurationSource implements IterableConfigurationSource { @Override public Iterable<ConfigurationEntry> getAllConfigurationEntries() { return new MapConfigurationEntryIterable(source); } MapConfigurationSource(Map<String, String> source); @Override OptionalValue<String> getValue(String key, Map<String, String> at... |
@Test public void shouldSetAndGetValue() { WritableConfigurationSource mapConfigurationSource = new WritableMapConfigurationSource(new HashMap<>()); mapConfigurationSource.setValue("key", "value", null); OptionalValue<String> value = mapConfigurationSource.getValue("key", null); assertThat(value.isPresent()).isTrue(); ... | @Override public void setValue(String key, String value, Map<String, String> attributes) { requireNonNull(key, "key cannot be null"); source.put(key, value); } | WritableMapConfigurationSource extends MapConfigurationSource implements WritableConfigurationSource { @Override public void setValue(String key, String value, Map<String, String> attributes) { requireNonNull(key, "key cannot be null"); source.put(key, value); } } | WritableMapConfigurationSource extends MapConfigurationSource implements WritableConfigurationSource { @Override public void setValue(String key, String value, Map<String, String> attributes) { requireNonNull(key, "key cannot be null"); source.put(key, value); } WritableMapConfigurationSource(Map<String, String> source... | WritableMapConfigurationSource extends MapConfigurationSource implements WritableConfigurationSource { @Override public void setValue(String key, String value, Map<String, String> attributes) { requireNonNull(key, "key cannot be null"); source.put(key, value); } WritableMapConfigurationSource(Map<String, String> source... | WritableMapConfigurationSource extends MapConfigurationSource implements WritableConfigurationSource { @Override public void setValue(String key, String value, Map<String, String> attributes) { requireNonNull(key, "key cannot be null"); source.put(key, value); } WritableMapConfigurationSource(Map<String, String> source... |
@Test public void shouldNotBeApplicableForNonXmlTypes() { assertThat(jaxbTypeConverter.isApplicable(NonXmlConfiguration.class, null)).isFalse(); } | @Override public boolean isApplicable(Type type, Map<String, String> attributes) { requireNonNull(type, "type cannot be null"); return type instanceof Class && ((AnnotatedElement) type).getAnnotation(XmlRootElement.class) != null; } | JaxbConverter implements TypeConverter<T> { @Override public boolean isApplicable(Type type, Map<String, String> attributes) { requireNonNull(type, "type cannot be null"); return type instanceof Class && ((AnnotatedElement) type).getAnnotation(XmlRootElement.class) != null; } } | JaxbConverter implements TypeConverter<T> { @Override public boolean isApplicable(Type type, Map<String, String> attributes) { requireNonNull(type, "type cannot be null"); return type instanceof Class && ((AnnotatedElement) type).getAnnotation(XmlRootElement.class) != null; } } | JaxbConverter implements TypeConverter<T> { @Override public boolean isApplicable(Type type, Map<String, String> attributes) { requireNonNull(type, "type cannot be null"); return type instanceof Class && ((AnnotatedElement) type).getAnnotation(XmlRootElement.class) != null; } @Override boolean isApplicable(Type type, ... | JaxbConverter implements TypeConverter<T> { @Override public boolean isApplicable(Type type, Map<String, String> attributes) { requireNonNull(type, "type cannot be null"); return type instanceof Class && ((AnnotatedElement) type).getAnnotation(XmlRootElement.class) != null; } @Override boolean isApplicable(Type type, ... |
@Test public void shouldClearFieldAndDisabledButtonWhenMatchingChangeoverNormWasnotFound() throws Exception { when(changeoverNormsService.getMatchingChangeoverNorms(fromTechnology, toTechnology, productionLine)).thenReturn(null); when(view.getComponentByReference(NUMBER)).thenReturn(number); when(view.getComponentByRef... | public void matchingChangeoverNorm(final ViewDefinitionState viewDefinitionState, final ComponentState state, final String[] args) { Entity fromTechnology = ((LookupComponent) viewDefinitionState.getComponentByReference(MATCHING_FROM_TECHNOLOGY)) .getEntity(); Entity toTechnology = ((LookupComponent) viewDefinitionStat... | MatchingChangeoverNormsDetailsListeners { public void matchingChangeoverNorm(final ViewDefinitionState viewDefinitionState, final ComponentState state, final String[] args) { Entity fromTechnology = ((LookupComponent) viewDefinitionState.getComponentByReference(MATCHING_FROM_TECHNOLOGY)) .getEntity(); Entity toTechnolo... | MatchingChangeoverNormsDetailsListeners { public void matchingChangeoverNorm(final ViewDefinitionState viewDefinitionState, final ComponentState state, final String[] args) { Entity fromTechnology = ((LookupComponent) viewDefinitionState.getComponentByReference(MATCHING_FROM_TECHNOLOGY)) .getEntity(); Entity toTechnolo... | MatchingChangeoverNormsDetailsListeners { public void matchingChangeoverNorm(final ViewDefinitionState viewDefinitionState, final ComponentState state, final String[] args) { Entity fromTechnology = ((LookupComponent) viewDefinitionState.getComponentByReference(MATCHING_FROM_TECHNOLOGY)) .getEntity(); Entity toTechnolo... | MatchingChangeoverNormsDetailsListeners { public void matchingChangeoverNorm(final ViewDefinitionState viewDefinitionState, final ComponentState state, final String[] args) { Entity fromTechnology = ((LookupComponent) viewDefinitionState.getComponentByReference(MATCHING_FROM_TECHNOLOGY)) .getEntity(); Entity toTechnolo... |
@Test public final void shouldNotPerformEntityStateChangeIfOwnerHasValidationErrors() { AlmostRealStateChangeService stateChangeService = new AlmostRealStateChangeService(); given(stateChangeContext.isOwnerValid()).willReturn(true, false); stateChangeService.changeState(stateChangeContext); verify(stateChangeContext).s... | @Override public void changeState(final StateChangeContext stateChangeContext) { try { performStateChange(stateChangeContext); } catch (Exception exception) { LOGGER.warn("Can't perform state change", exception); stateChangeContext.setStatus(StateChangeStatus.FAILURE); stateChangeContext.addMessage("states.messages.cha... | AbstractStateChangeAspect implements StateChangeService { @Override public void changeState(final StateChangeContext stateChangeContext) { try { performStateChange(stateChangeContext); } catch (Exception exception) { LOGGER.warn("Can't perform state change", exception); stateChangeContext.setStatus(StateChangeStatus.FA... | AbstractStateChangeAspect implements StateChangeService { @Override public void changeState(final StateChangeContext stateChangeContext) { try { performStateChange(stateChangeContext); } catch (Exception exception) { LOGGER.warn("Can't perform state change", exception); stateChangeContext.setStatus(StateChangeStatus.FA... | AbstractStateChangeAspect implements StateChangeService { @Override public void changeState(final StateChangeContext stateChangeContext) { try { performStateChange(stateChangeContext); } catch (Exception exception) { LOGGER.warn("Can't perform state change", exception); stateChangeContext.setStatus(StateChangeStatus.FA... | AbstractStateChangeAspect implements StateChangeService { @Override public void changeState(final StateChangeContext stateChangeContext) { try { performStateChange(stateChangeContext); } catch (Exception exception) { LOGGER.warn("Can't perform state change", exception); stateChangeContext.setStatus(StateChangeStatus.FA... |
@Test public final void shouldMarkStateChangeAsFailureAndRethrowExceptionWhenStateChangePhaseThrowsException() { ExceptionThrowingStateChangeService stateChangeService = new ExceptionThrowingStateChangeService(); try { stateChangeService.changeState(stateChangeContext); } catch (StateChangeException e) { verify(stateCh... | @Override public void changeState(final StateChangeContext stateChangeContext) { try { performStateChange(stateChangeContext); } catch (Exception exception) { LOGGER.warn("Can't perform state change", exception); stateChangeContext.setStatus(StateChangeStatus.FAILURE); stateChangeContext.addMessage("states.messages.cha... | AbstractStateChangeAspect implements StateChangeService { @Override public void changeState(final StateChangeContext stateChangeContext) { try { performStateChange(stateChangeContext); } catch (Exception exception) { LOGGER.warn("Can't perform state change", exception); stateChangeContext.setStatus(StateChangeStatus.FA... | AbstractStateChangeAspect implements StateChangeService { @Override public void changeState(final StateChangeContext stateChangeContext) { try { performStateChange(stateChangeContext); } catch (Exception exception) { LOGGER.warn("Can't perform state change", exception); stateChangeContext.setStatus(StateChangeStatus.FA... | AbstractStateChangeAspect implements StateChangeService { @Override public void changeState(final StateChangeContext stateChangeContext) { try { performStateChange(stateChangeContext); } catch (Exception exception) { LOGGER.warn("Can't perform state change", exception); stateChangeContext.setStatus(StateChangeStatus.FA... | AbstractStateChangeAspect implements StateChangeService { @Override public void changeState(final StateChangeContext stateChangeContext) { try { performStateChange(stateChangeContext); } catch (Exception exception) { LOGGER.warn("Can't perform state change", exception); stateChangeContext.setStatus(StateChangeStatus.FA... |
@Test public final void shouldMarkStateChangeAsFailureAndRethrowExceptionWhenOwnerEntityValidatorThrowException() { AlmostRealStateChangeService stateChangeService = new AlmostRealStateChangeService(); given(ownerDD.callValidators(Mockito.any(Entity.class))).willThrow(new RuntimeException()); try { stateChangeService.c... | @Override public void changeState(final StateChangeContext stateChangeContext) { try { performStateChange(stateChangeContext); } catch (Exception exception) { LOGGER.warn("Can't perform state change", exception); stateChangeContext.setStatus(StateChangeStatus.FAILURE); stateChangeContext.addMessage("states.messages.cha... | AbstractStateChangeAspect implements StateChangeService { @Override public void changeState(final StateChangeContext stateChangeContext) { try { performStateChange(stateChangeContext); } catch (Exception exception) { LOGGER.warn("Can't perform state change", exception); stateChangeContext.setStatus(StateChangeStatus.FA... | AbstractStateChangeAspect implements StateChangeService { @Override public void changeState(final StateChangeContext stateChangeContext) { try { performStateChange(stateChangeContext); } catch (Exception exception) { LOGGER.warn("Can't perform state change", exception); stateChangeContext.setStatus(StateChangeStatus.FA... | AbstractStateChangeAspect implements StateChangeService { @Override public void changeState(final StateChangeContext stateChangeContext) { try { performStateChange(stateChangeContext); } catch (Exception exception) { LOGGER.warn("Can't perform state change", exception); stateChangeContext.setStatus(StateChangeStatus.FA... | AbstractStateChangeAspect implements StateChangeService { @Override public void changeState(final StateChangeContext stateChangeContext) { try { performStateChange(stateChangeContext); } catch (Exception exception) { LOGGER.warn("Can't perform state change", exception); stateChangeContext.setStatus(StateChangeStatus.FA... |
@Test public final void shouldMarkStateChangeAsFailureWhenOwnerIsInvalid() { AlmostRealStateChangeService stateChangeService = new AlmostRealStateChangeService(); given(owner.isValid()).willReturn(false); given(ownerDD.callValidators(owner)).willReturn(false); stateChangeService.changeState(stateChangeContext); verify(... | @Override public void changeState(final StateChangeContext stateChangeContext) { try { performStateChange(stateChangeContext); } catch (Exception exception) { LOGGER.warn("Can't perform state change", exception); stateChangeContext.setStatus(StateChangeStatus.FAILURE); stateChangeContext.addMessage("states.messages.cha... | AbstractStateChangeAspect implements StateChangeService { @Override public void changeState(final StateChangeContext stateChangeContext) { try { performStateChange(stateChangeContext); } catch (Exception exception) { LOGGER.warn("Can't perform state change", exception); stateChangeContext.setStatus(StateChangeStatus.FA... | AbstractStateChangeAspect implements StateChangeService { @Override public void changeState(final StateChangeContext stateChangeContext) { try { performStateChange(stateChangeContext); } catch (Exception exception) { LOGGER.warn("Can't perform state change", exception); stateChangeContext.setStatus(StateChangeStatus.FA... | AbstractStateChangeAspect implements StateChangeService { @Override public void changeState(final StateChangeContext stateChangeContext) { try { performStateChange(stateChangeContext); } catch (Exception exception) { LOGGER.warn("Can't perform state change", exception); stateChangeContext.setStatus(StateChangeStatus.FA... | AbstractStateChangeAspect implements StateChangeService { @Override public void changeState(final StateChangeContext stateChangeContext) { try { performStateChange(stateChangeContext); } catch (Exception exception) { LOGGER.warn("Can't perform state change", exception); stateChangeContext.setStatus(StateChangeStatus.FA... |
@Test public void shouldSetStateToDraftWhenInitializeTrackingDetailsViewIfProductionTrackingIsntSaved() { given(productionTrackingForm.getEntityId()).willReturn(null); given(productionTrackingForm.getEntity()).willReturn(productionTracking); given(productionTracking.getField(ProductionTrackingFields.STATE)).willReturn(... | public void initializeProductionTrackingDetailsView(final ViewDefinitionState view) { FormComponent productionTrackingForm = (FormComponent) view.getComponentByReference(L_FORM); FieldComponent stateField = (FieldComponent) view.getComponentByReference(ProductionTrackingFields.STATE); LookupComponent orderLookup = (Loo... | ProductionTrackingDetailsHooks { public void initializeProductionTrackingDetailsView(final ViewDefinitionState view) { FormComponent productionTrackingForm = (FormComponent) view.getComponentByReference(L_FORM); FieldComponent stateField = (FieldComponent) view.getComponentByReference(ProductionTrackingFields.STATE); L... | ProductionTrackingDetailsHooks { public void initializeProductionTrackingDetailsView(final ViewDefinitionState view) { FormComponent productionTrackingForm = (FormComponent) view.getComponentByReference(L_FORM); FieldComponent stateField = (FieldComponent) view.getComponentByReference(ProductionTrackingFields.STATE); L... | ProductionTrackingDetailsHooks { public void initializeProductionTrackingDetailsView(final ViewDefinitionState view) { FormComponent productionTrackingForm = (FormComponent) view.getComponentByReference(L_FORM); FieldComponent stateField = (FieldComponent) view.getComponentByReference(ProductionTrackingFields.STATE); L... | ProductionTrackingDetailsHooks { public void initializeProductionTrackingDetailsView(final ViewDefinitionState view) { FormComponent productionTrackingForm = (FormComponent) view.getComponentByReference(L_FORM); FieldComponent stateField = (FieldComponent) view.getComponentByReference(ProductionTrackingFields.STATE); L... |
@Test public void shouldSetStateToAcceptedWhenInitializeTrackingDetailsViewIfProductionTrackingIsSaved() { given(productionTrackingForm.getEntityId()).willReturn(1L); given(productionTrackingForm.getEntity()).willReturn(productionTracking); given(productionTracking.getField(ProductionTrackingFields.STATE)).willReturn( ... | public void initializeProductionTrackingDetailsView(final ViewDefinitionState view) { FormComponent productionTrackingForm = (FormComponent) view.getComponentByReference(L_FORM); FieldComponent stateField = (FieldComponent) view.getComponentByReference(ProductionTrackingFields.STATE); LookupComponent orderLookup = (Loo... | ProductionTrackingDetailsHooks { public void initializeProductionTrackingDetailsView(final ViewDefinitionState view) { FormComponent productionTrackingForm = (FormComponent) view.getComponentByReference(L_FORM); FieldComponent stateField = (FieldComponent) view.getComponentByReference(ProductionTrackingFields.STATE); L... | ProductionTrackingDetailsHooks { public void initializeProductionTrackingDetailsView(final ViewDefinitionState view) { FormComponent productionTrackingForm = (FormComponent) view.getComponentByReference(L_FORM); FieldComponent stateField = (FieldComponent) view.getComponentByReference(ProductionTrackingFields.STATE); L... | ProductionTrackingDetailsHooks { public void initializeProductionTrackingDetailsView(final ViewDefinitionState view) { FormComponent productionTrackingForm = (FormComponent) view.getComponentByReference(L_FORM); FieldComponent stateField = (FieldComponent) view.getComponentByReference(ProductionTrackingFields.STATE); L... | ProductionTrackingDetailsHooks { public void initializeProductionTrackingDetailsView(final ViewDefinitionState view) { FormComponent productionTrackingForm = (FormComponent) view.getComponentByReference(L_FORM); FieldComponent stateField = (FieldComponent) view.getComponentByReference(ProductionTrackingFields.STATE); L... |
@Test public void shouldNotSetTimeAndPieceworkTabVisibleIfTypeIsBasic() { String typeOfProductionRecording = TypeOfProductionRecording.BASIC.getStringValue(); given(order.getStringField(OrderFieldsPC.TYPE_OF_PRODUCTION_RECORDING)).willReturn(typeOfProductionRecording); given(order.getBooleanField(OrderFieldsPC.REGISTER... | @Override public void setTimeAndPieceworkComponentsVisible(final ViewDefinitionState view, final Entity order) { String recordingType = order.getStringField(OrderFieldsPC.TYPE_OF_PRODUCTION_RECORDING); boolean recordingTypeEqualsForEach = TypeOfProductionRecording.FOR_EACH.getStringValue().equals(recordingType); boolea... | ProductionTrackingServiceImpl implements ProductionTrackingService { @Override public void setTimeAndPieceworkComponentsVisible(final ViewDefinitionState view, final Entity order) { String recordingType = order.getStringField(OrderFieldsPC.TYPE_OF_PRODUCTION_RECORDING); boolean recordingTypeEqualsForEach = TypeOfProduc... | ProductionTrackingServiceImpl implements ProductionTrackingService { @Override public void setTimeAndPieceworkComponentsVisible(final ViewDefinitionState view, final Entity order) { String recordingType = order.getStringField(OrderFieldsPC.TYPE_OF_PRODUCTION_RECORDING); boolean recordingTypeEqualsForEach = TypeOfProduc... | ProductionTrackingServiceImpl implements ProductionTrackingService { @Override public void setTimeAndPieceworkComponentsVisible(final ViewDefinitionState view, final Entity order) { String recordingType = order.getStringField(OrderFieldsPC.TYPE_OF_PRODUCTION_RECORDING); boolean recordingTypeEqualsForEach = TypeOfProduc... | ProductionTrackingServiceImpl implements ProductionTrackingService { @Override public void setTimeAndPieceworkComponentsVisible(final ViewDefinitionState view, final Entity order) { String recordingType = order.getStringField(OrderFieldsPC.TYPE_OF_PRODUCTION_RECORDING); boolean recordingTypeEqualsForEach = TypeOfProduc... |
@Test public void shoulsSetTimeAndPieceworkTabVisibleIfTypeIsCumulated() { String typeOfProductionRecording = TypeOfProductionRecording.CUMULATED.getStringValue(); given(order.getStringField(OrderFieldsPC.TYPE_OF_PRODUCTION_RECORDING)).willReturn(typeOfProductionRecording); given(order.getBooleanField(OrderFieldsPC.REG... | @Override public void setTimeAndPieceworkComponentsVisible(final ViewDefinitionState view, final Entity order) { String recordingType = order.getStringField(OrderFieldsPC.TYPE_OF_PRODUCTION_RECORDING); boolean recordingTypeEqualsForEach = TypeOfProductionRecording.FOR_EACH.getStringValue().equals(recordingType); boolea... | ProductionTrackingServiceImpl implements ProductionTrackingService { @Override public void setTimeAndPieceworkComponentsVisible(final ViewDefinitionState view, final Entity order) { String recordingType = order.getStringField(OrderFieldsPC.TYPE_OF_PRODUCTION_RECORDING); boolean recordingTypeEqualsForEach = TypeOfProduc... | ProductionTrackingServiceImpl implements ProductionTrackingService { @Override public void setTimeAndPieceworkComponentsVisible(final ViewDefinitionState view, final Entity order) { String recordingType = order.getStringField(OrderFieldsPC.TYPE_OF_PRODUCTION_RECORDING); boolean recordingTypeEqualsForEach = TypeOfProduc... | ProductionTrackingServiceImpl implements ProductionTrackingService { @Override public void setTimeAndPieceworkComponentsVisible(final ViewDefinitionState view, final Entity order) { String recordingType = order.getStringField(OrderFieldsPC.TYPE_OF_PRODUCTION_RECORDING); boolean recordingTypeEqualsForEach = TypeOfProduc... | ProductionTrackingServiceImpl implements ProductionTrackingService { @Override public void setTimeAndPieceworkComponentsVisible(final ViewDefinitionState view, final Entity order) { String recordingType = order.getStringField(OrderFieldsPC.TYPE_OF_PRODUCTION_RECORDING); boolean recordingTypeEqualsForEach = TypeOfProduc... |
@Test public void shoulsSetTimeAndPieceworkTabVisibleIfTypeIsForEach() { String typeOfProductionRecording = TypeOfProductionRecording.FOR_EACH.getStringValue(); given(order.getStringField(OrderFieldsPC.TYPE_OF_PRODUCTION_RECORDING)).willReturn(typeOfProductionRecording); given(order.getBooleanField(OrderFieldsPC.REGIST... | @Override public void setTimeAndPieceworkComponentsVisible(final ViewDefinitionState view, final Entity order) { String recordingType = order.getStringField(OrderFieldsPC.TYPE_OF_PRODUCTION_RECORDING); boolean recordingTypeEqualsForEach = TypeOfProductionRecording.FOR_EACH.getStringValue().equals(recordingType); boolea... | ProductionTrackingServiceImpl implements ProductionTrackingService { @Override public void setTimeAndPieceworkComponentsVisible(final ViewDefinitionState view, final Entity order) { String recordingType = order.getStringField(OrderFieldsPC.TYPE_OF_PRODUCTION_RECORDING); boolean recordingTypeEqualsForEach = TypeOfProduc... | ProductionTrackingServiceImpl implements ProductionTrackingService { @Override public void setTimeAndPieceworkComponentsVisible(final ViewDefinitionState view, final Entity order) { String recordingType = order.getStringField(OrderFieldsPC.TYPE_OF_PRODUCTION_RECORDING); boolean recordingTypeEqualsForEach = TypeOfProduc... | ProductionTrackingServiceImpl implements ProductionTrackingService { @Override public void setTimeAndPieceworkComponentsVisible(final ViewDefinitionState view, final Entity order) { String recordingType = order.getStringField(OrderFieldsPC.TYPE_OF_PRODUCTION_RECORDING); boolean recordingTypeEqualsForEach = TypeOfProduc... | ProductionTrackingServiceImpl implements ProductionTrackingService { @Override public void setTimeAndPieceworkComponentsVisible(final ViewDefinitionState view, final Entity order) { String recordingType = order.getStringField(OrderFieldsPC.TYPE_OF_PRODUCTION_RECORDING); boolean recordingTypeEqualsForEach = TypeOfProduc... |
@Test public final void shouldOrderCanBeClosedWhenTypeIsCummulativeAndAcceptingLastRecord() { orderHasEnabledAutoClose(); stubTypeOfProductionRecording(TypeOfProductionRecording.CUMULATED); productionTrackingIsLast(); boolean shouldClose = orderClosingHelper.orderShouldBeClosed(productionTracking); assertTrue(shouldClo... | public boolean orderShouldBeClosed(final Entity productionTracking) { Entity order = productionTracking.getBelongsToField(ProductionTrackingFields.ORDER); if (order == null) { return false; } Boolean autoCloseOrder = order.getBooleanField(OrderFieldsPC.AUTO_CLOSE_ORDER); Boolean isLastRecord = productionTracking.getBoo... | OrderClosingHelper { public boolean orderShouldBeClosed(final Entity productionTracking) { Entity order = productionTracking.getBelongsToField(ProductionTrackingFields.ORDER); if (order == null) { return false; } Boolean autoCloseOrder = order.getBooleanField(OrderFieldsPC.AUTO_CLOSE_ORDER); Boolean isLastRecord = prod... | OrderClosingHelper { public boolean orderShouldBeClosed(final Entity productionTracking) { Entity order = productionTracking.getBelongsToField(ProductionTrackingFields.ORDER); if (order == null) { return false; } Boolean autoCloseOrder = order.getBooleanField(OrderFieldsPC.AUTO_CLOSE_ORDER); Boolean isLastRecord = prod... | OrderClosingHelper { public boolean orderShouldBeClosed(final Entity productionTracking) { Entity order = productionTracking.getBelongsToField(ProductionTrackingFields.ORDER); if (order == null) { return false; } Boolean autoCloseOrder = order.getBooleanField(OrderFieldsPC.AUTO_CLOSE_ORDER); Boolean isLastRecord = prod... | OrderClosingHelper { public boolean orderShouldBeClosed(final Entity productionTracking) { Entity order = productionTracking.getBelongsToField(ProductionTrackingFields.ORDER); if (order == null) { return false; } Boolean autoCloseOrder = order.getBooleanField(OrderFieldsPC.AUTO_CLOSE_ORDER); Boolean isLastRecord = prod... |
@Test public void shouldEnabledButtonForCopyNorms() throws Exception { String averageLaborHourlyCostValue = "50"; when(averageLaborHourlyCost.getFieldValue()).thenReturn(averageLaborHourlyCostValue); orderDetailsHooks.enabledButtonForCopyNorms(view); Mockito.verify(copyToOperationsNorms).setEnabled(true); } | public void enabledButtonForCopyNorms(final ViewDefinitionState view) { WindowComponent window = (WindowComponent) view.getComponentByReference("window"); RibbonActionItem copyToOperationsNorms = window.getRibbon().getGroupByName("hourlyCostNorms") .getItemByName("copyToOperationsNorms"); FieldComponent averageLaborHou... | AvgLaborCostCalcForOrderDetailsHooks { public void enabledButtonForCopyNorms(final ViewDefinitionState view) { WindowComponent window = (WindowComponent) view.getComponentByReference("window"); RibbonActionItem copyToOperationsNorms = window.getRibbon().getGroupByName("hourlyCostNorms") .getItemByName("copyToOperations... | AvgLaborCostCalcForOrderDetailsHooks { public void enabledButtonForCopyNorms(final ViewDefinitionState view) { WindowComponent window = (WindowComponent) view.getComponentByReference("window"); RibbonActionItem copyToOperationsNorms = window.getRibbon().getGroupByName("hourlyCostNorms") .getItemByName("copyToOperations... | AvgLaborCostCalcForOrderDetailsHooks { public void enabledButtonForCopyNorms(final ViewDefinitionState view) { WindowComponent window = (WindowComponent) view.getComponentByReference("window"); RibbonActionItem copyToOperationsNorms = window.getRibbon().getGroupByName("hourlyCostNorms") .getItemByName("copyToOperations... | AvgLaborCostCalcForOrderDetailsHooks { public void enabledButtonForCopyNorms(final ViewDefinitionState view) { WindowComponent window = (WindowComponent) view.getComponentByReference("window"); RibbonActionItem copyToOperationsNorms = window.getRibbon().getGroupByName("hourlyCostNorms") .getItemByName("copyToOperations... |
@Test public final void shouldOrderCanNotBeClosedWhenTypeIsCummulativeAndAcceptingLastRecordButAutoCloseIsNotEnabled() { stubTypeOfProductionRecording(TypeOfProductionRecording.CUMULATED); productionTrackingIsLast(); boolean shouldClose = orderClosingHelper.orderShouldBeClosed(productionTracking); assertFalse(shouldClo... | public boolean orderShouldBeClosed(final Entity productionTracking) { Entity order = productionTracking.getBelongsToField(ProductionTrackingFields.ORDER); if (order == null) { return false; } Boolean autoCloseOrder = order.getBooleanField(OrderFieldsPC.AUTO_CLOSE_ORDER); Boolean isLastRecord = productionTracking.getBoo... | OrderClosingHelper { public boolean orderShouldBeClosed(final Entity productionTracking) { Entity order = productionTracking.getBelongsToField(ProductionTrackingFields.ORDER); if (order == null) { return false; } Boolean autoCloseOrder = order.getBooleanField(OrderFieldsPC.AUTO_CLOSE_ORDER); Boolean isLastRecord = prod... | OrderClosingHelper { public boolean orderShouldBeClosed(final Entity productionTracking) { Entity order = productionTracking.getBelongsToField(ProductionTrackingFields.ORDER); if (order == null) { return false; } Boolean autoCloseOrder = order.getBooleanField(OrderFieldsPC.AUTO_CLOSE_ORDER); Boolean isLastRecord = prod... | OrderClosingHelper { public boolean orderShouldBeClosed(final Entity productionTracking) { Entity order = productionTracking.getBelongsToField(ProductionTrackingFields.ORDER); if (order == null) { return false; } Boolean autoCloseOrder = order.getBooleanField(OrderFieldsPC.AUTO_CLOSE_ORDER); Boolean isLastRecord = prod... | OrderClosingHelper { public boolean orderShouldBeClosed(final Entity productionTracking) { Entity order = productionTracking.getBelongsToField(ProductionTrackingFields.ORDER); if (order == null) { return false; } Boolean autoCloseOrder = order.getBooleanField(OrderFieldsPC.AUTO_CLOSE_ORDER); Boolean isLastRecord = prod... |
@Test public final void shouldOrderCanNotBeClosedWhenTypeIsCummulativeAndAcceptingNotLastRecord() { orderHasEnabledAutoClose(); stubTypeOfProductionRecording(TypeOfProductionRecording.CUMULATED); boolean shouldClose = orderClosingHelper.orderShouldBeClosed(productionTracking); assertFalse(shouldClose); } | public boolean orderShouldBeClosed(final Entity productionTracking) { Entity order = productionTracking.getBelongsToField(ProductionTrackingFields.ORDER); if (order == null) { return false; } Boolean autoCloseOrder = order.getBooleanField(OrderFieldsPC.AUTO_CLOSE_ORDER); Boolean isLastRecord = productionTracking.getBoo... | OrderClosingHelper { public boolean orderShouldBeClosed(final Entity productionTracking) { Entity order = productionTracking.getBelongsToField(ProductionTrackingFields.ORDER); if (order == null) { return false; } Boolean autoCloseOrder = order.getBooleanField(OrderFieldsPC.AUTO_CLOSE_ORDER); Boolean isLastRecord = prod... | OrderClosingHelper { public boolean orderShouldBeClosed(final Entity productionTracking) { Entity order = productionTracking.getBelongsToField(ProductionTrackingFields.ORDER); if (order == null) { return false; } Boolean autoCloseOrder = order.getBooleanField(OrderFieldsPC.AUTO_CLOSE_ORDER); Boolean isLastRecord = prod... | OrderClosingHelper { public boolean orderShouldBeClosed(final Entity productionTracking) { Entity order = productionTracking.getBelongsToField(ProductionTrackingFields.ORDER); if (order == null) { return false; } Boolean autoCloseOrder = order.getBooleanField(OrderFieldsPC.AUTO_CLOSE_ORDER); Boolean isLastRecord = prod... | OrderClosingHelper { public boolean orderShouldBeClosed(final Entity productionTracking) { Entity order = productionTracking.getBelongsToField(ProductionTrackingFields.ORDER); if (order == null) { return false; } Boolean autoCloseOrder = order.getBooleanField(OrderFieldsPC.AUTO_CLOSE_ORDER); Boolean isLastRecord = prod... |
@Test public final void shouldOrderCanNotBeClosedWhenTypeIsForEachOpAndAcceptingNotLastRecord() { orderHasEnabledAutoClose(); stubTypeOfProductionRecording(TypeOfProductionRecording.FOR_EACH); stubSearchCriteriaResults(1L, 2L, 3L); boolean shouldClose = orderClosingHelper.orderShouldBeClosed(productionTracking); assert... | public boolean orderShouldBeClosed(final Entity productionTracking) { Entity order = productionTracking.getBelongsToField(ProductionTrackingFields.ORDER); if (order == null) { return false; } Boolean autoCloseOrder = order.getBooleanField(OrderFieldsPC.AUTO_CLOSE_ORDER); Boolean isLastRecord = productionTracking.getBoo... | OrderClosingHelper { public boolean orderShouldBeClosed(final Entity productionTracking) { Entity order = productionTracking.getBelongsToField(ProductionTrackingFields.ORDER); if (order == null) { return false; } Boolean autoCloseOrder = order.getBooleanField(OrderFieldsPC.AUTO_CLOSE_ORDER); Boolean isLastRecord = prod... | OrderClosingHelper { public boolean orderShouldBeClosed(final Entity productionTracking) { Entity order = productionTracking.getBelongsToField(ProductionTrackingFields.ORDER); if (order == null) { return false; } Boolean autoCloseOrder = order.getBooleanField(OrderFieldsPC.AUTO_CLOSE_ORDER); Boolean isLastRecord = prod... | OrderClosingHelper { public boolean orderShouldBeClosed(final Entity productionTracking) { Entity order = productionTracking.getBelongsToField(ProductionTrackingFields.ORDER); if (order == null) { return false; } Boolean autoCloseOrder = order.getBooleanField(OrderFieldsPC.AUTO_CLOSE_ORDER); Boolean isLastRecord = prod... | OrderClosingHelper { public boolean orderShouldBeClosed(final Entity productionTracking) { Entity order = productionTracking.getBelongsToField(ProductionTrackingFields.ORDER); if (order == null) { return false; } Boolean autoCloseOrder = order.getBooleanField(OrderFieldsPC.AUTO_CLOSE_ORDER); Boolean isLastRecord = prod... |
@Test public final void shouldOrderCanNotBeClosedWhenTypeIsForEachOpAndThereIsNotEnoughtLastRecords() { orderHasEnabledAutoClose(); stubTypeOfProductionRecording(TypeOfProductionRecording.FOR_EACH); productionTrackingIsLast(); stubSearchCriteriaResults(1L, 2L); boolean shouldClose = orderClosingHelper.orderShouldBeClos... | public boolean orderShouldBeClosed(final Entity productionTracking) { Entity order = productionTracking.getBelongsToField(ProductionTrackingFields.ORDER); if (order == null) { return false; } Boolean autoCloseOrder = order.getBooleanField(OrderFieldsPC.AUTO_CLOSE_ORDER); Boolean isLastRecord = productionTracking.getBoo... | OrderClosingHelper { public boolean orderShouldBeClosed(final Entity productionTracking) { Entity order = productionTracking.getBelongsToField(ProductionTrackingFields.ORDER); if (order == null) { return false; } Boolean autoCloseOrder = order.getBooleanField(OrderFieldsPC.AUTO_CLOSE_ORDER); Boolean isLastRecord = prod... | OrderClosingHelper { public boolean orderShouldBeClosed(final Entity productionTracking) { Entity order = productionTracking.getBelongsToField(ProductionTrackingFields.ORDER); if (order == null) { return false; } Boolean autoCloseOrder = order.getBooleanField(OrderFieldsPC.AUTO_CLOSE_ORDER); Boolean isLastRecord = prod... | OrderClosingHelper { public boolean orderShouldBeClosed(final Entity productionTracking) { Entity order = productionTracking.getBelongsToField(ProductionTrackingFields.ORDER); if (order == null) { return false; } Boolean autoCloseOrder = order.getBooleanField(OrderFieldsPC.AUTO_CLOSE_ORDER); Boolean isLastRecord = prod... | OrderClosingHelper { public boolean orderShouldBeClosed(final Entity productionTracking) { Entity order = productionTracking.getBelongsToField(ProductionTrackingFields.ORDER); if (order == null) { return false; } Boolean autoCloseOrder = order.getBooleanField(OrderFieldsPC.AUTO_CLOSE_ORDER); Boolean isLastRecord = prod... |
@Test public final void shouldOrderCanNotBeClosedWhenTypeIsForEachOpAndRecordIsNotLastAndThereIsNotEnoughtLastRecords() { orderHasEnabledAutoClose(); stubTypeOfProductionRecording(TypeOfProductionRecording.FOR_EACH); stubSearchCriteriaResults(1L, 2L); boolean shouldClose = orderClosingHelper.orderShouldBeClosed(product... | public boolean orderShouldBeClosed(final Entity productionTracking) { Entity order = productionTracking.getBelongsToField(ProductionTrackingFields.ORDER); if (order == null) { return false; } Boolean autoCloseOrder = order.getBooleanField(OrderFieldsPC.AUTO_CLOSE_ORDER); Boolean isLastRecord = productionTracking.getBoo... | OrderClosingHelper { public boolean orderShouldBeClosed(final Entity productionTracking) { Entity order = productionTracking.getBelongsToField(ProductionTrackingFields.ORDER); if (order == null) { return false; } Boolean autoCloseOrder = order.getBooleanField(OrderFieldsPC.AUTO_CLOSE_ORDER); Boolean isLastRecord = prod... | OrderClosingHelper { public boolean orderShouldBeClosed(final Entity productionTracking) { Entity order = productionTracking.getBelongsToField(ProductionTrackingFields.ORDER); if (order == null) { return false; } Boolean autoCloseOrder = order.getBooleanField(OrderFieldsPC.AUTO_CLOSE_ORDER); Boolean isLastRecord = prod... | OrderClosingHelper { public boolean orderShouldBeClosed(final Entity productionTracking) { Entity order = productionTracking.getBelongsToField(ProductionTrackingFields.ORDER); if (order == null) { return false; } Boolean autoCloseOrder = order.getBooleanField(OrderFieldsPC.AUTO_CLOSE_ORDER); Boolean isLastRecord = prod... | OrderClosingHelper { public boolean orderShouldBeClosed(final Entity productionTracking) { Entity order = productionTracking.getBelongsToField(ProductionTrackingFields.ORDER); if (order == null) { return false; } Boolean autoCloseOrder = order.getBooleanField(OrderFieldsPC.AUTO_CLOSE_ORDER); Boolean isLastRecord = prod... |
@Test public final void shouldOrderCanBeClosedWhenTypeIsForEachOpAndRecordIsLastAndThereIsEnoughtLastRecords() { orderHasEnabledAutoClose(); stubTypeOfProductionRecording(TypeOfProductionRecording.FOR_EACH); productionTrackingIsLast(); stubSearchCriteriaResults(1L, 2L, 3L); boolean shouldClose = orderClosingHelper.orde... | public boolean orderShouldBeClosed(final Entity productionTracking) { Entity order = productionTracking.getBelongsToField(ProductionTrackingFields.ORDER); if (order == null) { return false; } Boolean autoCloseOrder = order.getBooleanField(OrderFieldsPC.AUTO_CLOSE_ORDER); Boolean isLastRecord = productionTracking.getBoo... | OrderClosingHelper { public boolean orderShouldBeClosed(final Entity productionTracking) { Entity order = productionTracking.getBelongsToField(ProductionTrackingFields.ORDER); if (order == null) { return false; } Boolean autoCloseOrder = order.getBooleanField(OrderFieldsPC.AUTO_CLOSE_ORDER); Boolean isLastRecord = prod... | OrderClosingHelper { public boolean orderShouldBeClosed(final Entity productionTracking) { Entity order = productionTracking.getBelongsToField(ProductionTrackingFields.ORDER); if (order == null) { return false; } Boolean autoCloseOrder = order.getBooleanField(OrderFieldsPC.AUTO_CLOSE_ORDER); Boolean isLastRecord = prod... | OrderClosingHelper { public boolean orderShouldBeClosed(final Entity productionTracking) { Entity order = productionTracking.getBelongsToField(ProductionTrackingFields.ORDER); if (order == null) { return false; } Boolean autoCloseOrder = order.getBooleanField(OrderFieldsPC.AUTO_CLOSE_ORDER); Boolean isLastRecord = prod... | OrderClosingHelper { public boolean orderShouldBeClosed(final Entity productionTracking) { Entity order = productionTracking.getBelongsToField(ProductionTrackingFields.ORDER); if (order == null) { return false; } Boolean autoCloseOrder = order.getBooleanField(OrderFieldsPC.AUTO_CLOSE_ORDER); Boolean isLastRecord = prod... |
@Test public final void shouldOrderCanNotBeClosedWhenTypeIsForEachOpAndRecordIsLastAndThereIsEnoughtLastRecordsButAutoCloseIsNotEnabled() { stubTypeOfProductionRecording(TypeOfProductionRecording.FOR_EACH); productionTrackingIsLast(); stubSearchCriteriaResults(1L, 2L, 3L); boolean shouldClose = orderClosingHelper.order... | public boolean orderShouldBeClosed(final Entity productionTracking) { Entity order = productionTracking.getBelongsToField(ProductionTrackingFields.ORDER); if (order == null) { return false; } Boolean autoCloseOrder = order.getBooleanField(OrderFieldsPC.AUTO_CLOSE_ORDER); Boolean isLastRecord = productionTracking.getBoo... | OrderClosingHelper { public boolean orderShouldBeClosed(final Entity productionTracking) { Entity order = productionTracking.getBelongsToField(ProductionTrackingFields.ORDER); if (order == null) { return false; } Boolean autoCloseOrder = order.getBooleanField(OrderFieldsPC.AUTO_CLOSE_ORDER); Boolean isLastRecord = prod... | OrderClosingHelper { public boolean orderShouldBeClosed(final Entity productionTracking) { Entity order = productionTracking.getBelongsToField(ProductionTrackingFields.ORDER); if (order == null) { return false; } Boolean autoCloseOrder = order.getBooleanField(OrderFieldsPC.AUTO_CLOSE_ORDER); Boolean isLastRecord = prod... | OrderClosingHelper { public boolean orderShouldBeClosed(final Entity productionTracking) { Entity order = productionTracking.getBelongsToField(ProductionTrackingFields.ORDER); if (order == null) { return false; } Boolean autoCloseOrder = order.getBooleanField(OrderFieldsPC.AUTO_CLOSE_ORDER); Boolean isLastRecord = prod... | OrderClosingHelper { public boolean orderShouldBeClosed(final Entity productionTracking) { Entity order = productionTracking.getBelongsToField(ProductionTrackingFields.ORDER); if (order == null) { return false; } Boolean autoCloseOrder = order.getBooleanField(OrderFieldsPC.AUTO_CLOSE_ORDER); Boolean isLastRecord = prod... |
@Test public final void shouldOrderCanBeClosedWhenTypeIsForEachOpAndRecordIsLastAndThereIsMoreThanEnoughtLastRecords() { orderHasEnabledAutoClose(); productionTrackingIsLast(); stubTypeOfProductionRecording(TypeOfProductionRecording.FOR_EACH); stubSearchCriteriaResults(1L, 2L, 3L, 4L, 5L, 6L); boolean shouldClose = ord... | public boolean orderShouldBeClosed(final Entity productionTracking) { Entity order = productionTracking.getBelongsToField(ProductionTrackingFields.ORDER); if (order == null) { return false; } Boolean autoCloseOrder = order.getBooleanField(OrderFieldsPC.AUTO_CLOSE_ORDER); Boolean isLastRecord = productionTracking.getBoo... | OrderClosingHelper { public boolean orderShouldBeClosed(final Entity productionTracking) { Entity order = productionTracking.getBelongsToField(ProductionTrackingFields.ORDER); if (order == null) { return false; } Boolean autoCloseOrder = order.getBooleanField(OrderFieldsPC.AUTO_CLOSE_ORDER); Boolean isLastRecord = prod... | OrderClosingHelper { public boolean orderShouldBeClosed(final Entity productionTracking) { Entity order = productionTracking.getBelongsToField(ProductionTrackingFields.ORDER); if (order == null) { return false; } Boolean autoCloseOrder = order.getBooleanField(OrderFieldsPC.AUTO_CLOSE_ORDER); Boolean isLastRecord = prod... | OrderClosingHelper { public boolean orderShouldBeClosed(final Entity productionTracking) { Entity order = productionTracking.getBelongsToField(ProductionTrackingFields.ORDER); if (order == null) { return false; } Boolean autoCloseOrder = order.getBooleanField(OrderFieldsPC.AUTO_CLOSE_ORDER); Boolean isLastRecord = prod... | OrderClosingHelper { public boolean orderShouldBeClosed(final Entity productionTracking) { Entity order = productionTracking.getBelongsToField(ProductionTrackingFields.ORDER); if (order == null) { return false; } Boolean autoCloseOrder = order.getBooleanField(OrderFieldsPC.AUTO_CLOSE_ORDER); Boolean isLastRecord = prod... |
@Test public final void shouldOrderCanNotBeClosedWhenTypeIsForEachOpAndRecordIsLastAndThereIsMoreThanEnoughtLastRecordsButAutoCloseIsNotEnabled() { stubTypeOfProductionRecording(TypeOfProductionRecording.FOR_EACH); productionTrackingIsLast(); stubSearchCriteriaResults(1L, 2L, 3L, 4L, 5L, 6L); boolean shouldClose = orde... | public boolean orderShouldBeClosed(final Entity productionTracking) { Entity order = productionTracking.getBelongsToField(ProductionTrackingFields.ORDER); if (order == null) { return false; } Boolean autoCloseOrder = order.getBooleanField(OrderFieldsPC.AUTO_CLOSE_ORDER); Boolean isLastRecord = productionTracking.getBoo... | OrderClosingHelper { public boolean orderShouldBeClosed(final Entity productionTracking) { Entity order = productionTracking.getBelongsToField(ProductionTrackingFields.ORDER); if (order == null) { return false; } Boolean autoCloseOrder = order.getBooleanField(OrderFieldsPC.AUTO_CLOSE_ORDER); Boolean isLastRecord = prod... | OrderClosingHelper { public boolean orderShouldBeClosed(final Entity productionTracking) { Entity order = productionTracking.getBelongsToField(ProductionTrackingFields.ORDER); if (order == null) { return false; } Boolean autoCloseOrder = order.getBooleanField(OrderFieldsPC.AUTO_CLOSE_ORDER); Boolean isLastRecord = prod... | OrderClosingHelper { public boolean orderShouldBeClosed(final Entity productionTracking) { Entity order = productionTracking.getBelongsToField(ProductionTrackingFields.ORDER); if (order == null) { return false; } Boolean autoCloseOrder = order.getBooleanField(OrderFieldsPC.AUTO_CLOSE_ORDER); Boolean isLastRecord = prod... | OrderClosingHelper { public boolean orderShouldBeClosed(final Entity productionTracking) { Entity order = productionTracking.getBelongsToField(ProductionTrackingFields.ORDER); if (order == null) { return false; } Boolean autoCloseOrder = order.getBooleanField(OrderFieldsPC.AUTO_CLOSE_ORDER); Boolean isLastRecord = prod... |
@Test public final void shouldOrderCanBeClosedWhenTypeIsForEachOpAndRecordIsLastAndIsAlreadyAcceptedButThereIsEnoughtRecords() { orderHasEnabledAutoClose(); stubTypeOfProductionRecording(TypeOfProductionRecording.FOR_EACH); productionTrackingIsLast(); stubSearchCriteriaResults(1L, 2L, 3L, PRODUCTION_RECORD_ID); boolean... | public boolean orderShouldBeClosed(final Entity productionTracking) { Entity order = productionTracking.getBelongsToField(ProductionTrackingFields.ORDER); if (order == null) { return false; } Boolean autoCloseOrder = order.getBooleanField(OrderFieldsPC.AUTO_CLOSE_ORDER); Boolean isLastRecord = productionTracking.getBoo... | OrderClosingHelper { public boolean orderShouldBeClosed(final Entity productionTracking) { Entity order = productionTracking.getBelongsToField(ProductionTrackingFields.ORDER); if (order == null) { return false; } Boolean autoCloseOrder = order.getBooleanField(OrderFieldsPC.AUTO_CLOSE_ORDER); Boolean isLastRecord = prod... | OrderClosingHelper { public boolean orderShouldBeClosed(final Entity productionTracking) { Entity order = productionTracking.getBelongsToField(ProductionTrackingFields.ORDER); if (order == null) { return false; } Boolean autoCloseOrder = order.getBooleanField(OrderFieldsPC.AUTO_CLOSE_ORDER); Boolean isLastRecord = prod... | OrderClosingHelper { public boolean orderShouldBeClosed(final Entity productionTracking) { Entity order = productionTracking.getBelongsToField(ProductionTrackingFields.ORDER); if (order == null) { return false; } Boolean autoCloseOrder = order.getBooleanField(OrderFieldsPC.AUTO_CLOSE_ORDER); Boolean isLastRecord = prod... | OrderClosingHelper { public boolean orderShouldBeClosed(final Entity productionTracking) { Entity order = productionTracking.getBelongsToField(ProductionTrackingFields.ORDER); if (order == null) { return false; } Boolean autoCloseOrder = order.getBooleanField(OrderFieldsPC.AUTO_CLOSE_ORDER); Boolean isLastRecord = prod... |
@Test public void shouldDisbaleButtonForCopyNorms() throws Exception { String averageLaborHourlyCostValue = ""; when(averageLaborHourlyCost.getFieldValue()).thenReturn(averageLaborHourlyCostValue); orderDetailsHooks.enabledButtonForCopyNorms(view); Mockito.verify(copyToOperationsNorms).setEnabled(false); } | public void enabledButtonForCopyNorms(final ViewDefinitionState view) { WindowComponent window = (WindowComponent) view.getComponentByReference("window"); RibbonActionItem copyToOperationsNorms = window.getRibbon().getGroupByName("hourlyCostNorms") .getItemByName("copyToOperationsNorms"); FieldComponent averageLaborHou... | AvgLaborCostCalcForOrderDetailsHooks { public void enabledButtonForCopyNorms(final ViewDefinitionState view) { WindowComponent window = (WindowComponent) view.getComponentByReference("window"); RibbonActionItem copyToOperationsNorms = window.getRibbon().getGroupByName("hourlyCostNorms") .getItemByName("copyToOperations... | AvgLaborCostCalcForOrderDetailsHooks { public void enabledButtonForCopyNorms(final ViewDefinitionState view) { WindowComponent window = (WindowComponent) view.getComponentByReference("window"); RibbonActionItem copyToOperationsNorms = window.getRibbon().getGroupByName("hourlyCostNorms") .getItemByName("copyToOperations... | AvgLaborCostCalcForOrderDetailsHooks { public void enabledButtonForCopyNorms(final ViewDefinitionState view) { WindowComponent window = (WindowComponent) view.getComponentByReference("window"); RibbonActionItem copyToOperationsNorms = window.getRibbon().getGroupByName("hourlyCostNorms") .getItemByName("copyToOperations... | AvgLaborCostCalcForOrderDetailsHooks { public void enabledButtonForCopyNorms(final ViewDefinitionState view) { WindowComponent window = (WindowComponent) view.getComponentByReference("window"); RibbonActionItem copyToOperationsNorms = window.getRibbon().getGroupByName("hourlyCostNorms") .getItemByName("copyToOperations... |
@Test public final void shouldOrderCanNotBeClosedWhenTypeIsForEachOpAndRecordIsLastButIsAlreadyAccepted() { stubTypeOfProductionRecording(TypeOfProductionRecording.FOR_EACH); productionTrackingIsLast(); stubSearchCriteriaResults(1L, 2L, PRODUCTION_RECORD_ID); boolean shouldClose = orderClosingHelper.orderShouldBeClosed... | public boolean orderShouldBeClosed(final Entity productionTracking) { Entity order = productionTracking.getBelongsToField(ProductionTrackingFields.ORDER); if (order == null) { return false; } Boolean autoCloseOrder = order.getBooleanField(OrderFieldsPC.AUTO_CLOSE_ORDER); Boolean isLastRecord = productionTracking.getBoo... | OrderClosingHelper { public boolean orderShouldBeClosed(final Entity productionTracking) { Entity order = productionTracking.getBelongsToField(ProductionTrackingFields.ORDER); if (order == null) { return false; } Boolean autoCloseOrder = order.getBooleanField(OrderFieldsPC.AUTO_CLOSE_ORDER); Boolean isLastRecord = prod... | OrderClosingHelper { public boolean orderShouldBeClosed(final Entity productionTracking) { Entity order = productionTracking.getBelongsToField(ProductionTrackingFields.ORDER); if (order == null) { return false; } Boolean autoCloseOrder = order.getBooleanField(OrderFieldsPC.AUTO_CLOSE_ORDER); Boolean isLastRecord = prod... | OrderClosingHelper { public boolean orderShouldBeClosed(final Entity productionTracking) { Entity order = productionTracking.getBelongsToField(ProductionTrackingFields.ORDER); if (order == null) { return false; } Boolean autoCloseOrder = order.getBooleanField(OrderFieldsPC.AUTO_CLOSE_ORDER); Boolean isLastRecord = prod... | OrderClosingHelper { public boolean orderShouldBeClosed(final Entity productionTracking) { Entity order = productionTracking.getBelongsToField(ProductionTrackingFields.ORDER); if (order == null) { return false; } Boolean autoCloseOrder = order.getBooleanField(OrderFieldsPC.AUTO_CLOSE_ORDER); Boolean isLastRecord = prod... |
@Test public void shouldSetQuantityTechnologyProductionLineAndTechnicalProductionCostPerUnitFieldsAndSaveEntity() { BigDecimal quantity = BigDecimal.TEN; BigDecimal doneQuantity = BigDecimal.TEN; given(productionBalance.getDecimalField(ProductionBalanceFieldsPCWC.TOTAL_TECHNICAL_PRODUCTION_COSTS)).willReturn( BigDecima... | public void doTheCostsPart(final Entity productionBalance) { Entity order = productionBalance.getBelongsToField(ProductionBalanceFields.ORDER); Entity technology = order.getBelongsToField(OrderFields.TECHNOLOGY); Entity productionLine = order.getBelongsToField(OrderFields.PRODUCTION_LINE); productionBalance.setField(Pr... | GenerateProductionBalanceWithCosts implements Observer { public void doTheCostsPart(final Entity productionBalance) { Entity order = productionBalance.getBelongsToField(ProductionBalanceFields.ORDER); Entity technology = order.getBelongsToField(OrderFields.TECHNOLOGY); Entity productionLine = order.getBelongsToField(Or... | GenerateProductionBalanceWithCosts implements Observer { public void doTheCostsPart(final Entity productionBalance) { Entity order = productionBalance.getBelongsToField(ProductionBalanceFields.ORDER); Entity technology = order.getBelongsToField(OrderFields.TECHNOLOGY); Entity productionLine = order.getBelongsToField(Or... | GenerateProductionBalanceWithCosts implements Observer { public void doTheCostsPart(final Entity productionBalance) { Entity order = productionBalance.getBelongsToField(ProductionBalanceFields.ORDER); Entity technology = order.getBelongsToField(OrderFields.TECHNOLOGY); Entity productionLine = order.getBelongsToField(Or... | GenerateProductionBalanceWithCosts implements Observer { public void doTheCostsPart(final Entity productionBalance) { Entity order = productionBalance.getBelongsToField(ProductionBalanceFields.ORDER); Entity technology = order.getBelongsToField(OrderFields.TECHNOLOGY); Entity productionLine = order.getBelongsToField(Or... |
@Test public void shouldGenerateReportCorrectly() throws Exception { Locale locale = Locale.getDefault(); String localePrefix = "productionCounting.productionBalanceWithCosts.report.fileName"; Entity productionBalanceWithFileName = mock(Entity.class); given(productionBalanceWithFileName.getDataDefinition()).willReturn(... | void generateBalanceWithCostsReport(final Entity productionBalance) { Locale locale = LocaleContextHolder.getLocale(); String localePrefix = "productionCounting.productionBalanceWithCosts.report.fileName"; Entity productionBalanceWithFileName = fileService.updateReportFileName(productionBalance, ProductionBalanceFields... | GenerateProductionBalanceWithCosts implements Observer { void generateBalanceWithCostsReport(final Entity productionBalance) { Locale locale = LocaleContextHolder.getLocale(); String localePrefix = "productionCounting.productionBalanceWithCosts.report.fileName"; Entity productionBalanceWithFileName = fileService.update... | GenerateProductionBalanceWithCosts implements Observer { void generateBalanceWithCostsReport(final Entity productionBalance) { Locale locale = LocaleContextHolder.getLocale(); String localePrefix = "productionCounting.productionBalanceWithCosts.report.fileName"; Entity productionBalanceWithFileName = fileService.update... | GenerateProductionBalanceWithCosts implements Observer { void generateBalanceWithCostsReport(final Entity productionBalance) { Locale locale = LocaleContextHolder.getLocale(); String localePrefix = "productionCounting.productionBalanceWithCosts.report.fileName"; Entity productionBalanceWithFileName = fileService.update... | GenerateProductionBalanceWithCosts implements Observer { void generateBalanceWithCostsReport(final Entity productionBalance) { Locale locale = LocaleContextHolder.getLocale(); String localePrefix = "productionCounting.productionBalanceWithCosts.report.fileName"; Entity productionBalanceWithFileName = fileService.update... |
@Test public void shouldAddTimeBalanceAndProductionCostsIfTypeCumulatedAndHourly() throws Exception { String typeOfProductionRecording = TypeOfProductionRecording.CUMULATED.getStringValue(); String calculateOperationCostMode = CalculateOperationCostMode.HOURLY.getStringValue(); given(order.getStringField(OrderFieldsPC.... | @Override protected void buildPdfContent(final Document document, final Entity productionBalance, final Locale locale) throws DocumentException { String documentTitle = translationService.translate("productionCounting.productionBalance.report.title", locale); String documentAuthor = translationService.translate("smartR... | ProductionBalanceWithCostsPdfService extends PdfDocumentService { @Override protected void buildPdfContent(final Document document, final Entity productionBalance, final Locale locale) throws DocumentException { String documentTitle = translationService.translate("productionCounting.productionBalance.report.title", loc... | ProductionBalanceWithCostsPdfService extends PdfDocumentService { @Override protected void buildPdfContent(final Document document, final Entity productionBalance, final Locale locale) throws DocumentException { String documentTitle = translationService.translate("productionCounting.productionBalance.report.title", loc... | ProductionBalanceWithCostsPdfService extends PdfDocumentService { @Override protected void buildPdfContent(final Document document, final Entity productionBalance, final Locale locale) throws DocumentException { String documentTitle = translationService.translate("productionCounting.productionBalance.report.title", loc... | ProductionBalanceWithCostsPdfService extends PdfDocumentService { @Override protected void buildPdfContent(final Document document, final Entity productionBalance, final Locale locale) throws DocumentException { String documentTitle = translationService.translate("productionCounting.productionBalance.report.title", loc... |
@Test public void shouldNotAddTimeBalanceAndProductionCostsIfTypeIsNotHourly() throws Exception { String typeOfProductionRecording = TypeOfProductionRecording.CUMULATED.getStringValue(); String calculateOperationCostMode = CalculateOperationCostMode.PIECEWORK.getStringValue(); given(order.getStringField(OrderFieldsPC.T... | @Override protected void buildPdfContent(final Document document, final Entity productionBalance, final Locale locale) throws DocumentException { String documentTitle = translationService.translate("productionCounting.productionBalance.report.title", locale); String documentAuthor = translationService.translate("smartR... | ProductionBalanceWithCostsPdfService extends PdfDocumentService { @Override protected void buildPdfContent(final Document document, final Entity productionBalance, final Locale locale) throws DocumentException { String documentTitle = translationService.translate("productionCounting.productionBalance.report.title", loc... | ProductionBalanceWithCostsPdfService extends PdfDocumentService { @Override protected void buildPdfContent(final Document document, final Entity productionBalance, final Locale locale) throws DocumentException { String documentTitle = translationService.translate("productionCounting.productionBalance.report.title", loc... | ProductionBalanceWithCostsPdfService extends PdfDocumentService { @Override protected void buildPdfContent(final Document document, final Entity productionBalance, final Locale locale) throws DocumentException { String documentTitle = translationService.translate("productionCounting.productionBalance.report.title", loc... | ProductionBalanceWithCostsPdfService extends PdfDocumentService { @Override protected void buildPdfContent(final Document document, final Entity productionBalance, final Locale locale) throws DocumentException { String documentTitle = translationService.translate("productionCounting.productionBalance.report.title", loc... |
@Test public void shouldNotAddTimeBalanceAndProductionCostsIfTypeIsNotCumulated() throws Exception { String typeOfProductionRecording = TypeOfProductionRecording.FOR_EACH.getStringValue(); String calculateOperationCostMode = CalculateOperationCostMode.HOURLY.getStringValue(); given(order.getStringField(OrderFieldsPC.TY... | @Override protected void buildPdfContent(final Document document, final Entity productionBalance, final Locale locale) throws DocumentException { String documentTitle = translationService.translate("productionCounting.productionBalance.report.title", locale); String documentAuthor = translationService.translate("smartR... | ProductionBalanceWithCostsPdfService extends PdfDocumentService { @Override protected void buildPdfContent(final Document document, final Entity productionBalance, final Locale locale) throws DocumentException { String documentTitle = translationService.translate("productionCounting.productionBalance.report.title", loc... | ProductionBalanceWithCostsPdfService extends PdfDocumentService { @Override protected void buildPdfContent(final Document document, final Entity productionBalance, final Locale locale) throws DocumentException { String documentTitle = translationService.translate("productionCounting.productionBalance.report.title", loc... | ProductionBalanceWithCostsPdfService extends PdfDocumentService { @Override protected void buildPdfContent(final Document document, final Entity productionBalance, final Locale locale) throws DocumentException { String documentTitle = translationService.translate("productionCounting.productionBalance.report.title", loc... | ProductionBalanceWithCostsPdfService extends PdfDocumentService { @Override protected void buildPdfContent(final Document document, final Entity productionBalance, final Locale locale) throws DocumentException { String documentTitle = translationService.translate("productionCounting.productionBalance.report.title", loc... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.