Skip to content

Commit

Permalink
gh-3059 Nullpointers and Test cache clearing
Browse files Browse the repository at this point in the history
  • Loading branch information
GCHQDev404 committed Nov 3, 2023
1 parent a3f2597 commit 11f406e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,9 @@ private static ViewElementDefinition getUpdatedViewElementDef(final SchemaElemen
if (view != null) {
final ViewElementDefinition viewElementDef = view.getElement(elementKey);
//Add View Validation
updatedFilterFunctions.addAll(viewElementDef.getPostAggregationFilter().getComponents());

if (viewElementDef != null && viewElementDef.hasPostAggregationFilters()) {
updatedFilterFunctions.addAll(viewElementDef.getPostAggregationFilter().getComponents());
}
//Init Builder with contents of the view.
updatePreAggregationFiler = new ViewElementDefinition.Builder(viewElementDef);
} else {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2022 Crown Copyright
* Copyright 2022-2023 Crown Copyright
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -42,6 +42,7 @@
import static uk.gov.gchq.gaffer.federatedstore.FederatedStoreTestUtil.addGraphToAccumuloStore;
import static uk.gov.gchq.gaffer.federatedstore.FederatedStoreTestUtil.contextTestUser;
import static uk.gov.gchq.gaffer.federatedstore.FederatedStoreTestUtil.loadSchemaFromJson;
import static uk.gov.gchq.gaffer.federatedstore.FederatedStoreTestUtil.resetForFederatedTests;

public class FederatedStoreViewAggregationTest {

Expand All @@ -50,6 +51,8 @@ public class FederatedStoreViewAggregationTest {

@BeforeEach
public void before() throws Exception {
resetForFederatedTests();

federatedStore = new FederatedStore();
federatedStore.initialise(GRAPH_ID_TEST_FEDERATED_STORE, new Schema(), new FederatedStoreProperties());

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2016-2022 Crown Copyright
* Copyright 2016-2023 Crown Copyright
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -55,6 +55,7 @@
import static uk.gov.gchq.gaffer.federatedstore.FederatedStoreTestUtil.GRAPH_ID_ACCUMULO_WITH_EDGES;
import static uk.gov.gchq.gaffer.federatedstore.FederatedStoreTestUtil.GRAPH_ID_ACCUMULO_WITH_ENTITIES;
import static uk.gov.gchq.gaffer.federatedstore.FederatedStoreTestUtil.GRAPH_ID_TEST_FEDERATED_STORE;
import static uk.gov.gchq.gaffer.federatedstore.FederatedStoreTestUtil.resetForFederatedTests;
import static uk.gov.gchq.gaffer.federatedstore.util.FederatedStoreUtil.getDefaultMergeFunction;
import static uk.gov.gchq.gaffer.federatedstore.util.FederatedStoreUtil.getFederatedOperation;

Expand Down Expand Up @@ -91,8 +92,7 @@ public class FederatedOperationChainHandlerTest {
@BeforeEach
@AfterEach
public void after() {
HashMapGraphLibrary.clear();
CacheServiceLoader.shutdown();
resetForFederatedTests();
}

@SuppressWarnings({"unchecked", "rawtypes"})
Expand Down

0 comments on commit 11f406e

Please sign in to comment.