@Test public void getType_returnsForm() { // given FormParameter param = new FormParameter(KEY, VALUE_1, null, urlUtils); // when Type type = param.getType(); // then assertThat(type).isSameAs(Type.FORM); }
@Test public void getEntries_anyValue_encodesValue() { // given FormParameter param = new FormParameter(KEY, VALUE_1, null, urlUtils); // when List<Entry<String, String>> entries = param.getEncodedEntries(); // then assertThat(entries) .hasSize(1) .extracting("key", "value") .containsExactly(tuple(ENCODED_KEY, ENCODED_VALUE_1)); }
@Test public void getEntries_collection_returnMultipleEntries() { // given Collection<String> objects = Arrays.asList(VALUE_1, VALUE_2); FormParameter param = new FormParameter(KEY, objects, null, urlUtils); // when List<Entry<String, String>> entries = param.getEncodedEntries(); // then assertThat(entries) .hasSameSizeAs(objects) .extracting("key", "value") .containsExactly(tuple(ENCODED_KEY, ENCODED_VALUE_1), tuple(ENCODED_KEY, ENCODED_VALUE_2)); }