### Question:
QuestionsAndAnswersPlugin extends WebControllerPlugin implements TopicPlugin { @Override protected Map<PluginProperty, String> applyConfiguration(List<PluginProperty> properties) throws PluginConfigurationException { if (properties.size() == 1 && ORDER_PROPERTY.equalsIgnoreCase(properties.get(0).getName())) { order = properties.get(0).getValue() == null ? DEFAULT_ORDER_VALUE : Integer.parseInt(properties.get(0).getValue()); properties.get(0).setHint(ORDER_HINT); return new HashMap<>(); } else { throw new PluginConfigurationException( "Can't apply configuration: incorrect parameters count or order not found"); } }  @Override String getName(); @Override List<PluginProperty> getConfiguration(); @Override boolean supportsJCommuneVersion(String version); @Override List<PluginProperty> getDefaultConfiguration(); @Override String translateLabel(String code, Locale locale); @SuppressWarnings("unchecked") @Override List<T> getBranchPermissions(); @Override CreateTopicBtnDto getCreateTopicBtnDto(long branchId); @Override JtalksPermission getCreateTopicPermission(); @Override JtalksPermission getBranchPermissionByMask(int mask); @Override JtalksPermission getBranchPermissionByName(String name); @Override PluginController getController(); @Override String getTopicType(); @Override JtalksPermission getCommentPermission(); @Override SubscribersFilter getSubscribersFilter(); static final String TOPIC_TYPE; static final String CONTEXT; static final String MESSAGE_PATH; }### Answer:
@Test public void testApplyConfiguration() throws PluginConfigurationException { PluginProperty property = new PluginProperty(ORDER_PROPERTY, PluginProperty.Type.INT, "103"); QuestionsAndAnswersPlugin plugin = new QuestionsAndAnswersPlugin(); plugin.applyConfiguration(Arrays.asList(property)); assertEquals(plugin.getConfiguration().size(), 1); assertEquals(plugin.getConfiguration().get(0).getValue(), "103"); }
@Test(expectedExceptions = PluginConfigurationException.class) public void applyConfigurationShouldThrowRuntimeExceptionIfPassedEmptyProperties() throws PluginConfigurationException { new QuestionsAndAnswersPlugin().applyConfiguration(Collections.<PluginProperty>emptyList()); }