The reasons may be as follows:
1. Methods with return values cannot be tested directly
2. Methods with parameters cannot be directly tested
3. Methods with access rights under public cannot be directly tested
Static static methods cannot be directly tested
5. Do not add an @test annotation to any of the first four conditions, or an initializationError will occur to any method that meets the @test condition
Only the methods of public void can be tested using @test
Point one: must be public, the following are not allowed
Point two: must be void, no return value, without any modification final, static, etc.
Many bloggers say it could be the lead pack problem:
in addition to introducing junit-4.12.jar, two dependent jars were introduced: hamcrest-core-1.3.rc2.jar, and hamcrest-library-1.3.rc2.jar
(Note: After personal testing, this is usually not the case.)
Read More:
- [Solved] Springcloud Add gateway to Startup Error: Exception encountered during context initialization – cancelling refresh
- [Solved] Junit.test use error: log4j:WARN No appenders could be found for logger
- Error occurred during initialization of VM Could not reserve enough space for 1572864KB object heap
- [Solved] ora 01033 linux,ORA-01033: ORACLE initialization or shutdown in progres
- [Solved] Instantiation of ‘sdram_model_plus‘ failed. The design unit was not found.
- [Solved] Vue initialization error: Cannot Loading the File…
- [Solved] Virtualenvwrapper.sh error: There was a problem running the initialization hooks.
- [Solved] Schema initialization FAILED Metastore state would be inconsistent
- Hbase Shell startup error: [ERROR] Terminal initialization failed; falling back to unsupported
- [Solved] Flyter uses screenutil to obtain screen width and height initialization error
- [Solved] Error: The slice reducer for key “auth“ returned undefined during initialization. If the state pas
- Eureka unit test error creating bean with name ‘Eureka autoservice registration’: Singleton bean
- K8s cluster initialization error: Port 6443 is in use [Solved]
- [ERROR] Terminal initialization failed; falling back to unsupported java.lang.IncompatibleClassChang
- [Solved] Neo4j Error: Error occurred during initialization of VM Incompatible minimum and maximum heap sizes spec
- [Solved] Qt Error: qt.network.ssl: QSslSocket::connectToHostEncrypted: TLS initialization failed
- [Solved] UserWarning: CUDA initialization: CUDA unknown error
- [Solved] Fabric 2.x: error starting container: API error (404): network_test not found
- [Solved] elasticsearch.bat Running Flashback.: Error occurred during initialization of VM, Error occurred during initializatio
- [Solved] hive Caused by: MetaException(message:Version information not found in metastore. )