Powermockito private method mock NullPointerException. Calls the private method - java

I'm trying to mock a private method (executeGetRequest) and in the line that I'm declaring the mock that I want returned for the private method, the private method is actually being executed with null arguments, therefore throwing a NullPointerException.
VlcPlayerMinimal.java:
package com.nicobrest.kamehouse.vlcrc.model;
public class VlcPlayerMinimal {
public static void main(String[] args) {
String vlcRcStatus = new VlcPlayerMinimal().getVlcRcStatus();
System.out.println(vlcRcStatus);
}
public String getVlcRcStatus() {
Client client = new Client();
GetRequest getRequest = new GetRequest();
String vlcRcStatus = executeGetRequest(client, getRequest);
return vlcRcStatus;
}
private String executeGetRequest(Client client, GetRequest getRequest) {
return client.execute(getRequest);
}
private class Client {
public String execute(GetRequest getRequest) {
return "{status: playing, id: 1}";
}
}
private class GetRequest {
}
}
VlcPlayerMinimalTest.java:
package com.nicobrest.kamehouse.model;
import static org.junit.Assert.*;
import static org.mockito.ArgumentMatchers.any;
import com.nicobrest.kamehouse.vlcrc.model.VlcPlayerMinimal;
import org.junit.Test;
import org.powermock.api.mockito.PowerMockito;
public class VlcPlayerMinimalTest {
#Test
public void getVlcRcStatusTest() {
VlcPlayerMinimal vlcPlayerSpy = PowerMockito.spy(new VlcPlayerMinimal());
try {
PowerMockito.doReturn("{status: stopped, id: 2}").when(vlcPlayerSpy, "executeGetRequest", any(), any());
String vlcRcStatus = vlcPlayerSpy.getVlcRcStatus();
System.out.println(vlcRcStatus);
} catch (Exception e) {
e.printStackTrace();
fail("Unexpected exception thrown.");
}
}
}
Stack trace:
java.lang.NullPointerException
at com.nicobrest.kamehouse.vlcrc.model.VlcPlayerMinimal.executeGetRequest(VlcPlayerMinimal.java:18)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.powermock.reflect.internal.WhiteboxImpl.performMethodInvocation(WhiteboxImpl.java:1846)
at org.powermock.reflect.internal.WhiteboxImpl.doInvokeMethod(WhiteboxImpl.java:810)
at org.powermock.reflect.internal.WhiteboxImpl.invokeMethod(WhiteboxImpl.java:675)
at org.powermock.reflect.Whitebox.invokeMethod(Whitebox.java:401)
at org.powermock.api.mockito.internal.expectation.PowerMockitoStubberImpl.when(PowerMockitoStubberImpl.java:95)
at com.nicobrest.kamehouse.model.VlcPlayerMinimalTest.getVlcRcStatusTest(VlcPlayerMinimalTest.java:17)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
...
It appears PowerMockito is actually calling the method that I'm trying to mock in the line PowerMockito.doReturn("{status: stopped, id: 2}").when(vlcPlayerSpy, "executeGetRequest", any(), any());
And it's throwing the exception because client is null, so it's calling execute(getClient) on null, but that's the method I'm trying to avoid to call in the test.
Any ideas how to fix this? I've been trying for a while without success.
I'm using Java 8, powermock 1.7.3 and junit 4.12

This Test is Succesful:
package foo.bar;
import static org.junit.Assert.*;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mockito;
import org.powermock.api.mockito.PowerMockito;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;
#RunWith(PowerMockRunner.class)
#PrepareForTest(VlcPlayerMinimal.class)
public class VlcPlayerMinimalTest {
#Test
public void getVlcRcStatusTest() {
VlcPlayerMinimal vlcPlayerSpy = PowerMockito.spy(new VlcPlayerMinimal());
try {
PowerMockito.doReturn("{status: stopped, id: 2}").when(vlcPlayerSpy, "executeGetRequest", Mockito.any(), Mockito.any());
String vlcRcStatus = vlcPlayerSpy.getVlcRcStatus();
System.out.println(vlcRcStatus);
} catch (Exception e) {
e.printStackTrace();
fail("Unexpected exception thrown.");
}
}
}
You need these Class Level Annotations:
#RunWith(PowerMockRunner.class)
#PrepareForTest(VlcPlayerMinimal.class)
Console Output:
{status: stopped, id: 2}

Related

Mock whenever new instance created without PowerMockito JUnit5

JUnit5 does not support PowerMockRunner hence the following code will not work whenever you migrate from JUnit4 to JUnit5.
Eg.
Code you trying to inject mock
import javax.naming.InvalidNameException;
public class Main {
public static void main(String[] args) {
Main main = new Main();
main.publish();
}
public void publish() {
try {
Sample s = new Sample();
s.invoke("Hello");
} catch (InvalidNameException e) {
throw new ServiceFailureException(e.getMessage());
}
}
}
Here you are trying to test publish method where you mock the Sample instance to respond with different responses.
In JUnit4 you could have use PowerMockito to achieve that.
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mockito;
import org.powermock.api.mockito.PowerMockito;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;
import javax.naming.InvalidNameException;
#RunWith(PowerMockRunner.class)
#PrepareForTest({Main.class})
public class MainTest {
#Test
public void testPublishSuccess() {
Main m = new Main();
Assert.assertEquals("Expected result not found", "success", m.publish());
}
#Test
public void testPublishFailure() throws Exception{
Sample sample = new Sample();
PowerMockito.when(sample.invoke(Mockito.anyString())).thenReturn("failure");
PowerMockito.whenNew(Sample.class).withNoArguments().thenReturn(sample);
Main m = new Main();
Assert.assertEquals("Expected result not found", "failure", m.publish());
}
#Test(expected = ServiceFailureException.class)
public void testPublishException() throws Exception{
Sample sample = new Sample();
PowerMockito.when(sample.invoke(Mockito.anyString())).thenThrow(new InvalidNameException("Invalid name provided"));
PowerMockito.whenNew(Sample.class).withNoArguments().thenReturn(sample);
Main m = new Main();
m.publish();
}
}
With the introduction of JUnit5, the test cases are failing at mock creating new instances because PowerMockRunner does not support JUnit5.
What is the alternate for using PowerMockito with JUnit5.
As PowerMockito does not support JUnit5, we can use Mockito inline. Here is the code which replace the PowerMockito.
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.mockito.MockedConstruction;
import org.mockito.Mockito;
import org.powermock.api.mockito.PowerMockito;
import javax.naming.InvalidNameException;
public class MainTestJunit5 {
#Test
public void testPublishSuccess() {
Main m = new Main();
Assertions.assertEquals("success", m.publish(), "Expected result not found");
}
#Test
public void testPublishFailure() throws Exception{
try (MockedConstruction<Sample> mockedConstruction = Mockito.mockConstruction(Sample.class, (sampleMock, context) -> {
Mockito.when(sampleMock.invoke(Mockito.anyString())).thenReturn("failure");
})) {
Sample sample = new Sample();
PowerMockito.when(sample.invoke(Mockito.anyString())).thenReturn("failure");
PowerMockito.whenNew(Sample.class).withNoArguments().thenReturn(sample);
Main m = new Main();
Assertions.assertEquals("Expected result not found", "failure", m.publish());
}
}
#Test
public void testPublishException() throws Exception{
try (MockedConstruction<Sample> mockedConstruction = Mockito.mockConstruction(Sample.class, (sampleMock, context) -> {
Mockito.when(sampleMock.invoke(Mockito.anyString())).thenThrow(new InvalidNameException("Invalid name found"));
})){
Main m = new Main();
boolean error = false;
try {
m.publish();
} catch (ServiceFailureException e) {
error = true;
}
Assertions.assertTrue(error, "Exception throwing expected");
}
}
}
Couple of things you need to pay attention
Setting up mockito-inline need additional dependency and an additional configuration.
Extra test runners (PowerMockRunner) and preparation for testing is not needed.
MockedConstruction is scoped, so you have to put all the mocking and processing done within that code block.
JUnit5 messages are the final method argument.
Mockito documentation: https://javadoc.io/doc/org.mockito/mockito-core/latest/org/mockito/Mockito.html#49

Basic Pact/Junit5 Test Setup fails. No method annotated with #Pact was found for provider error

I tried to follow the documentation on Pact.io to write a simple integration test.
Unfortunately i get an exception as follows:
org.junit.jupiter.api.extension.ParameterResolutionException: Failed to resolve parameter [au.com.dius.pact.consumer.MockServer mockServer] in method [public void com.example.demo.integration.pact.PactTest.setUp(au.com.dius.pact.consumer.MockServer)]: No method annotated with #Pact was found on test class PactTest for provider 'node_server'
It says that I don't have any method annotated with #Pact. However I do have a method, which is annotated with #Pact.
I tried to run the test manually and with 'mvn test' as well.
The application in general is providing some Rest Controllers, which should be tested.
Following is all I have implemented regarding my Pact Test Implementation. Am I missing something?
package com.example.demo.integration.pact;
import au.com.dius.pact.consumer.MockServer;
import au.com.dius.pact.consumer.dsl.PactDslWithProvider;
import au.com.dius.pact.consumer.junit5.PactConsumerTestExt;
import au.com.dius.pact.consumer.junit5.PactTestFor;
import au.com.dius.pact.core.model.RequestResponsePact;
import au.com.dius.pact.core.model.annotations.Pact;
import org.apache.http.HttpResponse;
import org.apache.http.client.fluent.Request;
import org.json.JSONArray;
import org.json.JSONObject;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import java.io.IOException;
import static org.junit.jupiter.api.Assertions.assertEquals;
#ExtendWith(PactConsumerTestExt.class)
#PactTestFor(providerName = PactTest.PACT_PROVIDER_NAME)
public class PactTest {
public static final String PACT_PROVIDER_NAME = "node_server";
public static final String PACT_CONSUMER_NAME = "spring_application";
#BeforeEach
public void setUp(MockServer mockServer) {
System.out.println("Mockserver check called");
Assertions.assertTrue(mockServer != null);
}
#Pact(provider = PACT_PROVIDER_NAME, consumer = PACT_CONSUMER_NAME)
public RequestResponsePact createPact(PactDslWithProvider builder) {
return builder
.uponReceiving("notes")
.path("/notes")
.method("GET")
.willRespondWith()
.matchHeader("Content-Type","application/json")
.status(200)
.body(
getJsonArrayOfNotes(2).toString())
.toPact();
}
#Test
#PactTestFor(pactMethod = "notes")
void test(MockServer mockServer) throws IOException {
HttpResponse httpResponse = Request.Get(mockServer.getUrl() + "/notes").execute().returnResponse();
assertEquals(200, httpResponse.getStatusLine().getStatusCode());
assertEquals(getJsonArrayOfNotes(2).toString(),httpResponse.getEntity().getContent().toString());
}
private JSONArray getJsonArrayOfNotes(int size) {
var responseJsonObject = new JSONArray();
for (int i = 0; i < size; i++) {
var note = new JSONObject();
try {
note.put("title", String.format("Title %s", i + 1));
note.put("content", String.format("Some Note Content of Note %s", i + 1));
} catch (Exception exception) {
}
responseJsonObject.put(note);
}
return responseJsonObject;
}
}
Seems like the method name with the #Pact annotation must be the same as the pactMethod in the #PactTestFor annotation...
In my case I had to write following:
#Test
#PactTestFor(pactMethod = "getNotes")
void test(MockServer mockServer) throws IOException {
HttpResponse httpResponse = Request.Get(mockServer.getUrl() + "/notes").execute().returnResponse();
assertEquals(200, httpResponse.getStatusLine().getStatusCode());
assertEquals(getJsonArrayOfNotes(2).toString(),httpResponse.getEntity().getContent().toString());
}
#Pact(provider = PACT_PROVIDER_NAME, consumer = PACT_CONSUMER_NAME)
public RequestResponsePact getNotes(PactDslWithProvider builder) {
return builder
.uponReceiving("notes")
.path("/notes")
.method("GET")
.willRespondWith()
.matchHeader("Content-Type","application/json")
.status(200)
.body(
getJsonArrayOfNotes(2).toString())
.toPact();
}

EasyMock/PowerMock - Mocking Static Methods Throws Error: no last call on a mock available

I'm writing a simple Java Class to test EasyMock/PowerMock functionality to mock static methods from class.
So I'm just mocking Math.random method to return a constant value for testing purpose.
Here is my code:
package x.y.z;
import org.easymock.EasyMock;
import org.junit.runner.RunWith;
import org.powermock.api.easymock.PowerMock;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
#RunWith(PowerMockRunner.class)
#PrepareForTest(Math.class)
public class PowerMockStaticTestExample {
#BeforeClass
public static void setupBeforeClass() {
try {
PowerMock.mockStatic(Math.class);
EasyMock.expect(Math.random()).andReturn(0.50).anyTimes();
PowerMock.replay(Math.class);
}
catch(Exception e)
{
e.printStackTrace();
}
}
#Test
public void dummyTest()
{
System.out.println("DummyTest Called!");
assert true==true;
}
#Test
public void testMath()
{
System.out.println("Math Test Start "+Math.random());
assert true==true;
}
}
Dependencies:
I'm using: easyMock: org.easymock:easymock:3.1,
powerMockEasyMockFull: org.powermock:powermock-easymock-release-full:1.5.1
with java 1.7.0_80.
But Everytime I try to run this test class using testng; It throws following Exception:
java.lang.IllegalStateException: no last call on a mock available
at org.easymock.EasyMock.getControlForLastCall(EasyMock.java:520)
at org.easymock.EasyMock.expect(EasyMock.java:498)
at x.y.z.PowerMockStaticTestExample.setupBeforeClass(PowerMockStaticTestExample.java:40)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84)
at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:564)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:213)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:138)
at org.testng.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:175)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:107)
at org.testng.TestRunner.privateRun(TestRunner.java:767)
at org.testng.TestRunner.run(TestRunner.java:617)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
After going through lot of posts on SO and Google; I finally thought of asking this question here.
Hope experts here will help me out. Thanks in Advance!
You seem to use TestNG (seeing the imports). But the runner used is a JUnit runner.
Then, PowerMock doesn't work with BeforeClass. You need to use a Before. Here is a working example.
import org.easymock.EasyMock;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.powermock.api.easymock.PowerMock;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;
#RunWith(PowerMockRunner.class)
#PrepareForTest(Math.class)
public class PowerMockStaticTestExample {
#Before
public void setupBeforeClass() {
PowerMock.mockStatic(Math.class);
EasyMock.expect(Math.random()).andReturn(0.50).anyTimes();
PowerMock.replay(Math.class);
}
#Test
public void dummyTest() {
System.out.println("DummyTest Called!");
}
#Test
public void testMath() {
System.out.println("Math Test Start "+Math.random());
}
}

com.sun.jdi.ClassNotLoadException: Type has not been loaded occurred invoking methods

Need help on writing Junit.
i am getting error "com.sun.jdi.ClassNotLoadException: Type has not been loaded occurred invoking methods." while hitting controller method from my Junit test class.
modelView = avamar.getCompGuidePage(productVersion , avamarComponent, model ); above line showing the classNotLoadException dut to this.
Debug is not allow me to enter in the controller method breakpoint.
Here is the test and Actual class.
Test class
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.ui.Model;
import org.springframework.web.servlet.ModelAndView;
import com.emc.brsit.avamar.vo.AvamarAllComponentsVO;
import com.emc.brsit.common.util.CustomCompGuideException;
#RunWith(SpringJUnit4ClassRunner.class)
#ContextConfiguration(locations = "classpath*:/Project/applicationContext servlet.xml")
public class AvamarControllerTest {
private final static Logger LOGGER = LoggerFactory
.getLogger(AvamarControllerTest.class);
#Mock
private AvamarController avamar;
#Mock
private AvamarAllComponentsVO avamarComponent;
/*#Before
public void setupMock() {
avamar = mock(AvamarController.class);
avamarComponent = mock(AvamarAllComponentsVO.class);
}*/
#Before
public void setupMock() {
MockitoAnnotations.initMocks(this);
}
#Test
public void testGetCompGuidePage() {
String productVersion ="7.5";
Model model = null;
ModelAndView modelView = new ModelAndView();
try {
modelView = avamar.getCompGuidePage(productVersion , avamarComponent, model );
} catch (CustomCompGuideException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
String abc = "new";
}
}
Actual Controller Class method
#RequestMapping(value = "/getAvamarCompGuidePage", method = RequestMethod.GET)
public ModelAndView getCompGuidePage(
#ModelAttribute("productVersion") String productVersion,
#ModelAttribute("allComponentsVO") AvamarAllComponentsVO allComponentsVO,
Model model) throws CustomCompGuideException{
LOGGER.debug("AvamarController::getCompGuidePage()::Start::");
//System.out.println("--------------Controller--------------");
try {
model.addAttribute("featureInstant",
avamarOSBO.getApp_Hype_Feat_Filters("Features"));
model.addAttribute("clientOSGrouped",avamarOSBO.getClientOSGroupedBY());
model.addAttribute("clientOSGroupedos_vendor",
avamarOSBO.getClientOSGroupedByVendor());
model.addAttribute("clientOS", avamarOSBO.getClientOS());
model.addAttribute("ndmpOSGrouped",avamarOSBO.getNDMPOSGroupedBY());
// model.addAttribute("features",
// avamarOSBO.getApp_Hype_Feat_Filters("Extended Retention"));
// model.addAttribute("featOS", avamarOSBO.getFeatType2OS());
model.addAttribute("hypeOSGroupedType2",avamarOSBO.getHypeOSGroupedBYType2());
model.addAttribute("featOSGroupedos_vendor",
avamarOSBO.getFeatType2OSGroupedByVendor());
// Important for Navigation
model.addAttribute("link",productVersion);
}catch(Exception ex) {
LOGGER.debug("SITE DOWN DUE TO ERROR::-->" + ex.getMessage());
throw new CustomCompGuideException(ex.getMessage());
}
LOGGER.debug("AvamarController::getCompGuidePage()::END::");
return new ModelAndView("AvamarCompGuideApp");
}
You are executing method on mock of AvamarController.
Try below code. Have added comments in caps where ever made change
#RunWith(SpringJUnit4ClassRunner.class)
#ContextConfiguration(locations = "classpath*:/Project/applicationContext servlet.xml")
public class AvamarControllerTest {
private final static Logger LOGGER = LoggerFactory
.getLogger(AvamarControllerTest.class);
// REMOVED MOCK HERE
private AvamarController avamar;
#Mock
private AvamarAllComponentsVO avamarComponent;
/*#Before
public void setupMock() {
avamar = mock(AvamarController.class);
avamarComponent = mock(AvamarAllComponentsVO.class);
}*/
#Before
public void setupMock() {
MockitoAnnotations.initMocks(this);
// INJECT MOCKED DEPENDENCES IF ANY
avamar = new AvamarController(...inject mocked dependencies if any....);
// DEPENDING ON WHAT YOU WANNA TEST, MOCK RETURN VALUES...One example below
Mockito.when(avamarComponent. getApp_Hype_Feat_Filters(any()))
.thenReturn(null);
}
#Test
public void testGetCompGuidePage() {
String productVersion ="7.5";
// THIS WILL THROW NULL EXCEPTION. NOT SURE IF ITS INTENTSIONAL
Model model = null;
ModelAndView modelView = new ModelAndView();
try {
modelView = avamar.getCompGuidePage(productVersion , avamarComponent, model );
} catch (CustomCompGuideException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
String abc = "new";
}
}

NullPointerException in while doing mockito unit test

I am new to mockito Junit testing. This one is my main class which I want to test:
import java.math.BigInteger;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Component;
#Component
public class IlinqChecksumCalculator {
private static Logger DATA_LOADER_CHECKSUM_CALCULATOR_LOGGER = Logger.getLogger(IlinqChecksumCalculator.class);
public String calculateCheckSum(String rfsdata) throws IOException {
System.out.println(rfsdata);
String checkSumValue = null;
if (StringUtils.isNotBlank(rfsdata)) {
try {
// Create MessageDigest object for MD5
MessageDigest digest = MessageDigest.getInstance("MD5");
// Update input string in message digest
digest.update(rfsdata.getBytes(), 0, rfsdata.getBytes().length);
// Converts message digest value in base 16 (hex)
checkSumValue = new BigInteger(1, digest.digest()).toString(16);
} catch (NoSuchAlgorithmException exception) {
DATA_LOADER_CHECKSUM_CALCULATOR_LOGGER.error(
"Error in determineInputCheckSum() method during calculation of checksum for Input JSON String for ",
exception);
}
}
System.out.println("Final checksum value is:" + checkSumValue);
return checkSumValue;
}
}
This one is my test class:
import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.when;
import java.io.IOException;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.MockitoAnnotations;
import org.mockito.runners.MockitoJUnitRunner;
#RunWith(MockitoJUnitRunner.class)
public class IlinqChecksumCalculatorTest {
private IlinqChecksumCalculator ilinqCheckSum;
#Before
public void setUp() throws Throwable {
MockitoAnnotations.initMocks(this);
}
#Test
public void testCheckSum() throws IOException {
when(ilinqCheckSum.calculateCheckSum("abcde")).thenReturn("defgh");
assertEquals("defgh", ilinqCheckSum.calculateCheckSum("abcde"));
}
}
I am getting a null pointer exception.
Just to answer your question: to handle ilinqCheckSum as mock, you shouuld annotate it with #Mock.
But here you should not use mockito! You want to test IlinqChecksumCalculator and not a mock! You should create a real instance of it and inject the dependendencies as mock if necessary.
By mocking calculateCheckSum method you are not covering any code in your unit test. I think you should not use Mock here. Try below test method.
public void testCheckSum() throws IOException {
String result = ilinqCheckSum.calculateCheckSum("abcde")
assertNotNull(result );
}

Categories

Resources