BioentityPropertyFile extends AtlasResource<Stream<BioentityProperty>> { public String cleanUpPropertyValue(String propertyValue) { return propertyValue .replaceFirst(STUFF_IN_CURLY_BRACKETS_AT_THE_END, "") .replaceFirst(STUFF_IN_SQUARE_BRACKETS_AT_THE_END, "") .trim(); } BioentityPropertyFile(Path path, Species species); String cleanUpPropertyValue(String propertyValue); final Species species; }
@Test public void testCleanUpPropertyValue() { assertThat( testFile.cleanUpPropertyValue("BRCA1"), is("BRCA1") ); assertThat( testFile.cleanUpPropertyValue("zinc finger"), is("zinc finger") ); assertThat( testFile.cleanUpPropertyValue("words with space "), is("words with space") ); assertThat( testFile.cleanUpPropertyValue( "shoot apex {http: "\\\"http: is("shoot apex") ); assertThat( testFile.cleanUpPropertyValue( "Homeodomain-like/winged-helix DNA-binding family protein [Source:TAIR;Acc:AT1G17520]"), is("Homeodomain-like/winged-helix DNA-binding family protein") ); }