Skip to content

Commit fe6a475

Browse files
Sergio Andres Mejia TovarNicolò Bidotti
authored andcommitted
[WIT-3064] Tech Adapter Framework autoconfiguration is not set up correctly
# Bug fixes * Fixes a bug where autoconfiguration would not be scanned by Spring Boot following the recommended usage # Related issue Closes WIT-3064 # Definition of Done So you are going to put your MR in review, but are you sure you have done all things listed here? ## All Developments - [x] **Feature was implemented as per the requirements** - [x] **If some code parts are complex they must be commented with code documentation** - [x] **Unit, integration and E2E tests have been performed and code coverage is not reduced**, so that new code is covered - [x] **CI/CD is successful** - [x] **Exceptions and errors are handled, returning meaningful errors to the user**, without letting the underlying framework to respond with a generic Internal Server Error. Technical details are stored in the errors/problems and not in the user message - [x] **Documentation (user documentation, HLD and others) has been updated** - Documentation has been updated with explanation of the new feature if it's user-facing (e.g. component now has additional setting) or it impacts them in some other way (e.g. optional field that becomes mandatory) - If it is a breaking change, we have documented it as such in the MR description in a "Breaking Changes" section - [x] **Helm chart and other DevOps artifacts** have been updated and are valid deployment tools for the new version - [x] **Problematic information (sensitive information, credentials, customer information or other intellectual property) is not included in the changes** as they could end up being public (most SPs are already published and automatically mirrored on every merge) - [x] **Feature doesn't negatively affect any existing environments**, especially the clients Playgrounds. This means that merging it to master and deploying it to these environments will not break them and **no manual operations that are not reported in the documentation will be needed** - [x] **If dependencies were changed, be sure that they will not impact the project**, that their license is compatible, and that they introduce no vulnerabilities - [x] **Security, Authentication and Authorization have been considered**. No SQL injection, tokens handling, RBAC integration. Common security vulnerabilities identified and resolved - [x] **The Java Scaffold is updated to support and test the new features**, especially if they're breaking changes ## API related Development - [ ] **API Parameters and return body are compliant** with the API specification - [ ] **Errors are correctly handled**, respecting the type of errors return bodies and responses for each endpoint - [ ] **API is logging in compliance with audit standards**, presence of sensitive information for GDPR has been assessed and removed or managed in case is needed ## DB related Development - [ ] **The database schema is designed to accurately** represent the data model and meet the requirements - [ ] **Tables, relationships, and constraints (e.g. primary keys, foreign keys, unique constraints) are defined appropriately**, following best practices and a common naming convention - [ ] **Sensitive data is stored securely**, encrypted if required, and access is restricted to authorized users - [ ] **Migration scripts to upgrade and downgrade the database have been implemented and tested**
1 parent d3794c5 commit fe6a475

File tree

7 files changed

+50
-14
lines changed

7 files changed

+50
-14
lines changed

RELEASE_NOTES.md

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,46 @@
22

33
All notable changes to this project will be documented in this file.
44

5-
## v2.2.0
5+
## v1.0.0-2.2.0
66

77
### Commits
88

9+
- **[WIT-3064] Tech Adapter Framework autoconfiguration is not set up correctly**
10+
>
11+
> ##### Bug fixes
12+
>
13+
> * Fixes a bug where autoconfiguration would not be scanned by Spring Boot following the recommended usage
14+
>
15+
> ##### Related issue
16+
>
17+
> Closes WIT-3064
18+
>
19+
20+
- **[WIT-2944] Publish java tech adapter framework to maven central**
21+
>
22+
> ##### Bug fixes
23+
>
24+
> Fixes on Central publish
25+
>
26+
> ##### Related issue
27+
>
28+
> Closes WIT-2944
29+
>
30+
>
31+
32+
- **[WIT-2944] Publish java tech adapter framework to maven central**
33+
>
34+
> ##### New features and improvements
35+
>
36+
> * Added Maven profile to publish artifacts on Sonatype Central with all necessary plugins
37+
> * Reintroduces the publish step on the CI
38+
>
39+
> ##### Related issue
40+
>
41+
> Closes WIT-2944
42+
>
43+
>
44+
945
- **[WIT-2983] Add support for data contract and tags on java framework**
1046
>
1147
> ##### New features and improvements
@@ -17,7 +53,7 @@ All notable changes to this project will be documented in this file.
1753
>
1854
> Closes WIT-2983
1955
>
20-
>
56+
>
2157
2258
- **[WIT-2829] Implement the sync java tech adapter framework**
2359
>
@@ -70,5 +106,3 @@ All notable changes to this project will be documented in this file.
70106
> Closes WIT-2826
71107
>
72108
>
73-
74-
- **Add README**
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.witboost.provisioning.framework;
1+
package com.witboost.provisioning;
22

33
/**
44
* Empty class to be used as a hook to enable package scanning by Spring Boot. It is intended to be part of the {@code @SpringBootApplication scanBasePackageClasses} and

core/src/main/java/com/witboost/provisioning/autoconfigure/ProvisionAutoConfiguration.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ public class ProvisionAutoConfiguration {
2222

2323
@Bean
2424
@ConditionalOnMissingBean
25-
public ProvisionConfiguration provisionConfiguration() {
25+
public ProvisionConfiguration defaultProvisionConfiguration() {
2626
return new ProvisionConfiguration(
2727
new ProvisionService() {}, new ProvisionService() {}, new ProvisionService() {});
2828
}
2929

3030
@Bean
3131
@ConditionalOnMissingBean
32-
ProvisionService provisionService() {
32+
ProvisionService defaultProvisionService() {
3333
return new ProvisionService() {};
3434
}
3535
}

core/src/main/java/com/witboost/provisioning/autoconfigure/ValidationAutoConfiguration.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public class ValidationAutoConfiguration {
2828

2929
@Bean
3030
@ConditionalOnMissingBean
31-
public ValidationConfiguration validationConfiguration() {
31+
public ValidationConfiguration defaultValidationConfiguration() {
3232
return new ValidationConfiguration(
3333
new ComponentValidationService() {},
3434
new ComponentValidationService() {},
@@ -37,13 +37,13 @@ public ValidationConfiguration validationConfiguration() {
3737

3838
@Bean
3939
@ConditionalOnMissingBean
40-
public SpecificClassProvider specificMapper() {
40+
public SpecificClassProvider defaultSpecificMapper() {
4141
return SpecificClassProviderImpl.builder().build();
4242
}
4343

4444
@Bean
4545
@ConditionalOnMissingBean
46-
public ComponentClassProvider componentClassProvider() {
46+
public ComponentClassProvider defaultComponentClassProvider() {
4747
return ComponentClassProviderImpl.builder().build();
4848
}
4949
}

core/src/test/java/com/witboost/provisioning/framework/service/SyncTechAdapterServiceTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ public class SyncTechAdapterServiceTest {
3939
private ValidationService validationService;
4040

4141
@Spy
42-
private ProvisionConfiguration provisionConfiguration = new ProvisionAutoConfiguration().provisionConfiguration();
42+
private ProvisionConfiguration provisionConfiguration =
43+
new ProvisionAutoConfiguration().defaultProvisionConfiguration();
4344

4445
@InjectMocks
4546
private SyncTechAdapterService techAdapterService;

core/src/test/java/com/witboost/provisioning/framework/service/validation/ValidationServiceTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ public class ValidationServiceTest {
3434
ComponentClassProvider componentClassProvider;
3535

3636
@Spy
37-
ValidationConfiguration validationConfiguration = new ValidationAutoConfiguration().validationConfiguration();
37+
ValidationConfiguration validationConfiguration =
38+
new ValidationAutoConfiguration().defaultValidationConfiguration();
3839

3940
@Mock
4041
SpecificClassProvider specificClassProvider;

docs/usage.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Where `X.X.X-Y.Y.Y` is the desired version of the framework. See [Publishing](..
3939
After including the dependencies, define you Main class as follows:
4040

4141
```java
42-
import com.witboost.provisioning.framework.JavaTechAdapterFramework;
42+
import com.witboost.provisioning.JavaTechAdapterFramework;
4343

4444
@SpringBootApplication (scanBasePackageClasses = {JavaTechAdapterFramework.class, Main.class})
4545
@ConfigurationPropertiesScan(basePackageClasses = {JavaTechAdapterFramework.class, Main.class})
@@ -52,7 +52,7 @@ public class Main {
5252
}
5353
```
5454

55-
By adding `com.witboost.provisioning.framework.JavaTechAdapterFramework` on the Spring Boot annotations, you are instructing your application to scan the framework package as well for the service beans, regardless of your package definition.
55+
By adding `com.witboost.provisioning.JavaTechAdapterFramework` on the Spring Boot annotations, you are instructing your application to scan the framework package as well for the service beans, regardless of your package definition.
5656

5757
With a single class, you now have a fully-functional Tech Adapter that receives and parses requests. At this point however, it will always return some kind of error, as it falls into its default configuration, so the next step is to implement your own business logic:
5858

0 commit comments

Comments
 (0)