Home>
@RunWith (PowerMockRunner.class)
public class test1 {
@InjectMocks
test1 target = new test ();
@Test
public void testCase01 () {
assertEquals ("777", target.encode (null));
}
}
After executing the above, java.lang.AssertionError: expected<777>but was
have become.
How can I return assertEquals ("777", target.encode (null));as the correct result instead of an error?
assertEquals Should I change this method?
-
Answer # 1
Related articles
- java - an error occurred while casting the reference type
- java - i want to resolve an error that occurs when running a spring application
- java - error: incompatible type: unable to convert string [] to string
- i want to resolve a java error
- python - i get an error when running ffmpeg inside a daemonized process
- fighting ice execution error [java]
- java - an error occurs when executing the jar file
- java - i want to get the entire list from the db and display it, but an error occurs when executing the application
- python - an error occurred in the code of "from smbus2 import smbus" on raspberry pi 4 (smbus2 installed)
- python - error occurred on raspberry pi 4 (type error)
- java - i got an error when trying to execute a class that overloaded the constructor
- javascript - gas: an error occurred due to the last sentence output to spreadsheet from google calendar
- i get the following error in java code please tell me what is wrong
- eclipse - when running on tomcat, i get a listener error saying "http status 404 – not found"
- java - web-app shows error in webxml
- java bigdecimal acceleration error when dividing by 0
- java - i ran the junit test method, but i want to know if it matches what i expected
- java - i want to eliminate the springboot error
- java - what the junit code is doing
Related questions
- java : Not processing Mockito stubs when using PowerMock
- java : How to create fake input stream and fake output stream?
- PowerMock + Java + Groovy
- java : JUnit Test service of the springboot layer, servis does not see the object in the database [duplicate]
- java : Multithreading in test automation
- java : Write a test for a class method that checks divisibility by 3
- java : Junit (DisplayName annotation) and instantiation in BeforeEach annotated method
Is the message that I expected "777" but returned null.
If so
You can use assertNull.