Skip to content

Commit

Permalink
Merge two @before Methods in AASAggregatorSuite into one to clean up (#…
Browse files Browse the repository at this point in the history
…350)


Signed-off-by: Zai Zhang <[email protected]>
  • Loading branch information
zhangzai123 authored Sep 12, 2023
1 parent 121fbaa commit 8080b56
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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();
Expand Down

0 comments on commit 8080b56

Please sign in to comment.