PlainTextContent { public String getExpression() { String tag = ""; if (hasExpression()) { tag = contentControl.getSdtPr().getTag().getVal(); } return tag; } PlainTextContent(SdtElement sdtElement); static SdtBlock createSdtBlockElement(); String getExpression(); void setExpression(String expression); boolean hasExpression(); void setTitle(String value); void setPlaceHolderContent(String text); void setContent(String value); void hideMarkers(); void showMarkgers(); static boolean isPlainTextContent(SdtElement element);  }
@Test public void testGetExpression() throws Exception { String expressionString = "expression"; Tag tag = new Tag(); tag.setVal(expressionString); SdtElement element = createPlainTextContentControl(SdtBlock.class); element.getSdtPr().setTag(tag); PlainTextContent plainTextContent = new PlainTextContent(element); assertEquals(expressionString, plainTextContent.getExpression()); }
@Test() public void testExpressionNotSet() throws Exception { SdtElement element = createPlainTextContentControl(SdtBlock.class); element.getSdtPr().setTag(null); PlainTextContent plainTextContent = new PlainTextContent(element); assertTrue(StringUtils.isEmpty(plainTextContent.getExpression())); }