StringNode extends Node { public String expectOneOf(String... validValues) { return expectOneOf(Arrays.asList(validValues)); } StringNode(String value, SourceLocation sourceLocation); @SmithyInternalApi static Pair<StringNode, Consumer<String>> createLazyString(
            String placeholder, SourceLocation sourceLocation); @Override NodeType getType(); @Override R accept(NodeVisitor<R> visitor); @Override StringNode expectStringNode(String errorMessage); @Override Optional<StringNode> asStringNode(); String getValue(); String expectOneOf(String... validValues); String expectOneOf(Collection<String> validValues); ShapeId expectShapeId(String namespace); ShapeId expectShapeId(); @Override boolean equals(Object other); @Override int hashCode(); @Override String toString();  }
@Test public void expectValueReturnsString() { StringNode node = Node.from("abc"); assertEquals("abc", node.expectOneOf("abc")); }
@Test public void expectValueAcceptsMultiplePossibleValues() { StringNode node = Node.from("xyz"); assertEquals("xyz", node.expectOneOf("abc", "mno", "xyz")); }
@Test public void expectValueAcceptsList() { StringNode node = Node.from("xyz"); assertEquals("xyz", node.expectOneOf(Arrays.asList("abc", "mno", "xyz"))); }
@Test public void expectValueThrowsOnUnexpectedValue() { Throwable thrown = Assertions.assertThrows(ExpectationNotMetException.class, () -> { StringNode node = Node.from("hjk"); node.expectOneOf("abc", "mno", "xyz"); }); assertThat(thrown.getMessage(), containsString("Expected one of `abc`, `mno`, `xyz`; got `hjk`.")); }