From 8080b56021ec189b6caeb3f97e50ed68c04ffb83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zai=20M=C3=BCller-Zhang?= <97607180+zhangzai123@users.noreply.github.com> Date: Tue, 12 Sep 2023 06:13:57 +0200 Subject: [PATCH] Merge two @Before Methods in AASAggregatorSuite into one to clean up (#350) Signed-off-by: Zai Zhang --- .../aas/aggregator/AASAggregatorSuite.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/test/java/org/eclipse/basyx/testsuite/regression/aas/aggregator/AASAggregatorSuite.java b/src/test/java/org/eclipse/basyx/testsuite/regression/aas/aggregator/AASAggregatorSuite.java index f434073b..fe30fe55 100644 --- a/src/test/java/org/eclipse/basyx/testsuite/regression/aas/aggregator/AASAggregatorSuite.java +++ b/src/test/java/org/eclipse/basyx/testsuite/regression/aas/aggregator/AASAggregatorSuite.java @@ -66,8 +66,7 @@ public abstract class AASAggregatorSuite { private static final String aas2Category = "TestCategory2"; // initializing dummy test data - @Before - public void initAASDummies() { + private void initAASDummies() { aas1 = new AssetAdministrationShell(aas1Id, new Identifier(IdentifierType.CUSTOM, aas1Id), new Asset("asset1IdShort", new Identifier(IdentifierType.CUSTOM, "asset1"), AssetKind.INSTANCE)); aas1.setDescription(description1); aas1.setCategory(aas1Category); @@ -79,12 +78,17 @@ public void initAASDummies() { protected abstract IAASAggregator getAggregator(); - @Before - public void clearAASAggregator() { + private void clearAASAggregator() { IAASAggregator aggregator = getAggregator(); aggregator.getAASList().stream().map(a -> a.getIdentification()).forEach(id -> aggregator.deleteAAS(id)); } + @Before + public void setup() { + initAASDummies(); + clearAASAggregator(); + } + @Test public void testCreateAndGetAAS() { IAASAggregator aggregator = getAggregator();