use of com.hedera.test.mocks.MockAppender in project hedera-services by hashgraph.
the class BasicFcfsUsagePricesTest method returnsDefaultUsagePricesForUnsupported.
@Test
void returnsDefaultUsagePricesForUnsupported() {
// setup:
MockAppender mockAppender = new MockAppender();
var log = (org.apache.logging.log4j.core.Logger) LogManager.getLogger(BasicFcfsUsagePrices.class);
log.addAppender(mockAppender);
Level levelForReset = log.getLevel();
log.setLevel(Level.DEBUG);
// given:
subject.loadPriceSchedules();
Timestamp at = Timestamp.newBuilder().setSeconds(currentExpiry - 1).build();
// when:
Map<SubType, FeeData> actual = subject.pricesGiven(UNRECOGNIZED, at);
// then:
assertEquals(DEFAULT_RESOURCE_PRICES, actual);
assertEquals(1, mockAppender.size());
assertEquals("DEBUG - Default usage price will be used, no specific usage prices available for function " + "UNRECOGNIZED" + " @ 1970-01-15T06:56:06Z!", mockAppender.get(0));
// tearDown:
log.setLevel(levelForReset);
log.removeAppender(mockAppender);
mockAppender.clear();
}
Aggregations