mmiklavc commented on a change in pull request #1399: METRON-2073: Create
in-memory use case for enrichment with map type and flatfile summarizer
URL: https://github.com/apache/metron/pull/1399#discussion_r286708059
##########
File path:
metron-platform/metron-enrichment/metron-enrichment-common/src/test/java/org/apache/metron/enrichment/stellar/ObjectGetTest.java
##########
@@ -18,73 +18,88 @@
package org.apache.metron.enrichment.stellar;
-import com.google.common.collect.ImmutableMap;
-import org.apache.commons.io.IOUtils;
-import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.fs.FileSystem;
-import org.apache.hadoop.fs.Path;
-import org.apache.metron.common.utils.SerDeUtils;
-import org.apache.metron.stellar.common.utils.StellarProcessorUtils;
-import org.junit.Assert;
+import org.apache.metron.enrichment.cache.ObjectCache;
+import org.apache.metron.enrichment.cache.ObjectCacheConfig;
+import org.apache.metron.stellar.dsl.Context;
import org.junit.Before;
+import org.junit.Rule;
import org.junit.Test;
+import org.junit.rules.ExpectedException;
+import org.junit.runner.RunWith;
+import org.powermock.core.classloader.annotations.PrepareForTest;
+import org.powermock.modules.junit4.PowerMockRunner;
-import java.io.BufferedOutputStream;
-import java.io.IOException;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.HashMap;
-import java.util.List;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+import static org.powermock.api.mockito.PowerMockito.whenNew;
+
+@RunWith(PowerMockRunner.class)
+@PrepareForTest({ObjectGet.class, ObjectCache.class})
public class ObjectGetTest {
- FileSystem fs;
- List<String> data;
+ @Rule
+ public ExpectedException thrown = ExpectedException.none();
+
+ private ObjectGet objectGet;
+ private ObjectCache objectCache;
+ private Context context;
@Before
- public void setup() throws IOException {
- fs = FileSystem.get(new Configuration());
- data = new ArrayList<>();
- {
- data.add("apache");
- data.add("metron");
- data.add("is");
- data.add("great");
- }
+ public void setup() throws Exception {
+ objectGet = new ObjectGet();
+ objectCache = mock(ObjectCache.class);
Review comment:
I think the issue is that you never actually test the integration between
those classes. It's only ever a mock interaction from the tests you've provided.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services