Skip to content

Commit 0b71f39

Browse files
Reusable Execution Context (#792)
* It removes all programmatically created instances of ExecutionContext in main code. * The ExecutionContext is now a Spring bean with @ExecutionScope * execution scope and ends with a successful recipe run * TestProjectContext uses Spring and components scan now to create the ProjectConetxtInitializer * A new test helper ActionTest was created which allows testing actions that require the ExecutionContext that is now created together with beans to create a ProjectConetxtInitializer instance * The execution times of tests might have become even worse as potential too many beans are created when org.springframework.sbm is scanned * An ArchUnit test was introduced to flag invalid instance creations of any class implementing ExecutionContext. --------- Co-authored-by: Fabian Krüger <[email protected]> Co-authored-by: Fabian Krüger <[email protected]>
1 parent 4db1427 commit 0b71f39

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

components/sbm-core/src/main/java/org/springframework/sbm/scopes/ProjectMetadata.java

+19-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
<<<<<<<< HEAD:components/sbm-core/src/main/java/org/springframework/sbm/scopes/ProjectMetadata.java
1617
package org.springframework.sbm.scopes;
1718

1819
import lombok.Getter;
@@ -24,4 +25,21 @@
2425
public class ProjectMetadata {
2526
private String metadata;
2627
private MavenSettings mavenSettings;
27-
}
28+
}
29+
========
30+
package org.springframework.sbm.scopeplayground;
31+
32+
import org.springframework.stereotype.Component;
33+
34+
/**
35+
* Scope implementation for beans marked with {@link org.springframework.sbm.scopeplayground.annotations.ScanScope}.
36+
*
37+
* @author Fabian Krüger
38+
*/
39+
@Component
40+
public class ScanScope extends AbstractBaseScope {
41+
42+
public final static String SCOPE_NAME = "scanScope";
43+
44+
}
45+
>>>>>>>> a55974ea (Reusable Execution Context (#792)):components/sbm-core/src/main/java/org/springframework/sbm/scopeplayground/ScanScope.java

0 commit comments

Comments
 (0)