Skip to content

Commit

Permalink
Added metrics to writable store
Browse files Browse the repository at this point in the history
Signed-off-by: ibankov <[email protected]>
  • Loading branch information
ibankov committed Jun 4, 2024
1 parent ffda2ee commit 5b3f501
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public StoreMetricsServiceImpl(@NonNull final Metrics metrics) {
this.storeMetricsMap = new EnumMap<>(StoreType.class);
storeMetricsMap.put(StoreType.TOPIC, new StoreMetricsImpl(metrics, "topics"));
storeMetricsMap.put(StoreType.ACCOUNT, new StoreMetricsImpl(metrics, "accounts"));
storeMetricsMap.put(StoreType.AIRDROPS, new StoreMetricsImpl(metrics, "airdrops"));
storeMetricsMap.put(StoreType.NFT, new StoreMetricsImpl(metrics, "nfts"));
storeMetricsMap.put(StoreType.TOKEN, new StoreMetricsImpl(metrics, "tokens"));
storeMetricsMap.put(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ void getsValueIfAirdropContainsFungibleToken() {
assertThat(subject.getFungibleAirdropAmount(fungibleAirdrop)).isEqualTo(airdropValue);
}


@Test
void getsFungibleThatDoesnotExist() {
var fungibleAirdrop = getFungibleAirdrop();
Expand All @@ -89,12 +88,12 @@ void getsFungibleThatDoesnotExist() {

@Test
void getsFungibleWithNullParam() {
assertThatThrownBy(()->subject.getFungibleAirdropAmount(null)).isInstanceOf(NullPointerException.class);
assertThatThrownBy(() -> subject.getFungibleAirdropAmount(null)).isInstanceOf(NullPointerException.class);
}

@Test
void testConsturctorCallWithNull() {
assertThatThrownBy(()->subject=new ReadableAirdropStoreImpl(null)).isInstanceOf(NullPointerException.class);
assertThatThrownBy(() -> subject = new ReadableAirdropStoreImpl(null)).isInstanceOf(NullPointerException.class);
}

@Test
Expand Down Expand Up @@ -130,8 +129,7 @@ void testExists() {
void testDoesntExists() {
var fungibleAirdrop = getFungibleAirdrop();

airdrops = emptyReadableAirdropStateBuilder()
.build();
airdrops = emptyReadableAirdropStateBuilder().build();
given(readableStates.<PendingAirdropId, PendingAirdropValue>get(AIRDROPS))
.willReturn(airdrops);
subject = new ReadableAirdropStoreImpl(readableStates);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,12 +183,13 @@ void getForModifyNonExisting() {

@Test
void testConsturctorCallWithNull() {
assertThatThrownBy(()->subject=new WritableAirdropStore(null,configuration,storeMetricsService)).isInstanceOf(NullPointerException.class);
assertThatThrownBy(() -> subject = new WritableAirdropStore(null, configuration, storeMetricsService))
.isInstanceOf(NullPointerException.class);
}

@Test
void testGetWithNullParam() {
assertThatThrownBy(()->subject.getForModify(null)).isInstanceOf(NullPointerException.class);
assertThatThrownBy(() -> subject.getForModify(null)).isInstanceOf(NullPointerException.class);
}

private PendingAirdropId getNonFungibleAirDrop() {
Expand Down

0 comments on commit 5b3f501

Please sign in to comment.