NpmFieldMatcher { public boolean matches(final JsonParser parser) throws IOException { String currentName = parser.getCurrentName(); return nonNull(currentName) && matchesFieldName(currentName) && matchesPath(parser); } NpmFieldMatcher(final String fieldName, final String pathRegex, final NpmFieldDeserializer deserializer); boolean allowDeserializationOnMatched(); boolean matches(final JsonParser parser); NpmFieldDeserializer getDeserializer(); String getFieldName();  }
@Test public void should_Match_Current_Path() throws IOException { underTest = new NpmFieldMatcher(FIELD_NAME, FIELD_PATH, fieldDeserializer); assertTrue(underTest.matches(parser)); }
@Test public void should_Match_By_Field_And_Regex_Path() throws IOException { underTest = new NpmFieldMatcher(FIELD_NAME, "/t(.*)t", fieldDeserializer); assertTrue(underTest.matches(parser)); }
@Test public void should_NotMatch_Current_Path() throws IOException { underTest = new NpmFieldMatcher("", "", fieldDeserializer); assertFalse(underTest.matches(parser)); }
@Test public void should_NotMatch_By_Name() throws IOException { underTest = new NpmFieldMatcher("", FIELD_PATH, fieldDeserializer); assertFalse(underTest.matches(parser)); }
@Test public void should_NotMatch_By_Path() throws IOException { underTest = new NpmFieldMatcher(FIELD_NAME, "", fieldDeserializer); assertFalse(underTest.matches(parser)); }
@Test public void should_Match_By_Field_But_Not_By_Regex_Path() throws IOException { underTest = new NpmFieldMatcher(FIELD_NAME, "/b(.*)b", fieldDeserializer); assertFalse(underTest.matches(parser)); }