@Test public void mergeShouldReturnNewInstanceWithMergedMap() throws Exception { Map map = mock(Map.class); Map mergedMap = mock(Map.class); DefaultCRestConfig expected = mock(DefaultCRestConfig.class); mockStatic(Maps.class); when(Maps.merge(config, map)).thenReturn(mergedMap); whenNew(DefaultCRestConfig.class).withArguments(mergedMap).thenReturn(expected); assertSame(expected, toTest.merge(map)); }
public CRestConfig merge(Map<String, Object> m){ return new DefaultCRestConfig(Maps.merge(this.config, m)); }
DefaultCRestConfig implements CRestConfig { public CRestConfig merge(Map<String, Object> m){ return new DefaultCRestConfig(Maps.merge(this.config, m)); } }
DefaultCRestConfig implements CRestConfig { public CRestConfig merge(Map<String, Object> m){ return new DefaultCRestConfig(Maps.merge(this.config, m)); } DefaultCRestConfig(Map<String, Object> m); }
DefaultCRestConfig implements CRestConfig { public CRestConfig merge(Map<String, Object> m){ return new DefaultCRestConfig(Maps.merge(this.config, m)); } DefaultCRestConfig(Map<String, Object> m); CRestConfig merge(Map<String, Object> m); T get(String key); T get(String propName, T defaultIfNotFound); T get(Class<?> key); T get(Class<?> key, T defaultIfNotFound); int getMaxAttempts(); String getDateFormat(); String getBooleanTrue(); String getBooleanFalse(); int getConcurrencyLevel(); }
DefaultCRestConfig implements CRestConfig { public CRestConfig merge(Map<String, Object> m){ return new DefaultCRestConfig(Maps.merge(this.config, m)); } DefaultCRestConfig(Map<String, Object> m); CRestConfig merge(Map<String, Object> m); T get(String key); T get(String propName, T defaultIfNotFound); T get(Class<?> key); T get(Class<?> key, T defaultIfNotFound); int getMaxAttempts(); String getDateFormat(); String getBooleanTrue(); String getBooleanFalse(); int getConcurrencyLevel();  }