@Test public void deprecatedExtensionWithInvalidVersion() { when(extensionModel.isDeprecated()).thenReturn(true); when(extensionModel.getDeprecationModel()) .thenReturn(of(new ImmutableDeprecationModel("This extension is deprecated.", "hola", null))); ProblemsReporter problemsReporter = new ProblemsReporter(extensionModel); validator.validate(extensionModel, problemsReporter); assertTrue(problemsReporter.hasErrors()); assertThat(problemsReporter.getErrors().get(0).getMessage(), is("The extension named extensionName was deprecated with an invalid 'since' version : 'hola' . This version must follow the semver convention")); }
@Before public void doSetup() { when(extensionModel.getOperationModels()).thenReturn(asList(operationModel)); when(extensionModel.getConfigurationModels()).thenReturn(emptyList()); when(extensionModel.getConstructModels()).thenReturn(emptyList()); when(extensionModel.getFunctionModels()).thenReturn(emptyList()); when(extensionModel.getConnectionProviders()).thenReturn(emptyList()); when(extensionModel.getSourceModels()).thenReturn(emptyList()); when(extensionModel.getDeprecationModel()).thenReturn(empty()); when(extensionModel.getName()).thenReturn("extensionName"); when(operationModel.getParameterGroupModels()).thenReturn(asList(parameterGroupModel)); when(operationModel.getDeprecationModel()).thenReturn(empty()); when(operationModel.getName()).thenReturn("extensionOperation"); when(parameterGroupModel.getParameterModels()).thenReturn(asList(parameterModel)); when(parameterModel.isDeprecated()).thenReturn(false); when(parameterModel.getDeprecationModel()).thenReturn(empty()); when(parameterModel.getName()).thenReturn("parameterName"); when(extensionModel.getModelProperty(CompileTimeModelProperty.class)).thenReturn(ofNullable(new CompileTimeModelProperty())); }