<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>junit - maven</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=104520464" />
  <subtitle>junit - maven</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=104520464</id>
  <updated>2026-04-04T21:35:19Z</updated>
  <dc:date>2026-04-04T21:35:19Z</dc:date>
  <entry>
    <title>RE: junit - maven</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=117311262" />
    <author>
      <name>Joaquin Cabal</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=117311262</id>
    <updated>2019-09-27T19:12:03Z</updated>
    <published>2019-09-27T19:12:03Z</published>
    <summary type="html">Anybody could fix this?</summary>
    <dc:creator>Joaquin Cabal</dc:creator>
    <dc:date>2019-09-27T19:12:03Z</dc:date>
  </entry>
  <entry>
    <title>RE: junit - maven</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=112036144" />
    <author>
      <name>Sana Yafai</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=112036144</id>
    <updated>2019-01-17T09:21:22Z</updated>
    <published>2019-01-17T09:21:22Z</published>
    <summary type="html">I  am also stuck same way. Do you resolved this?</summary>
    <dc:creator>Sana Yafai</dc:creator>
    <dc:date>2019-01-17T09:21:22Z</dc:date>
  </entry>
  <entry>
    <title>junit - maven</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=104520463" />
    <author>
      <name>Bartlomiej Knabel</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=104520463</id>
    <updated>2018-02-26T18:56:50Z</updated>
    <published>2018-02-26T18:56:50Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;Hi,&lt;br&gt;&lt;br&gt;is there any place where can I check simple project with liferay 7 + junit + @inject ?&lt;br&gt;I'm trying to do simple test with documentation https://dev.liferay.com/de/develop/tutorials/-/knowledge_base/7-0/injecting-service-components-into-tests&lt;br&gt;but still strange problems.&lt;br&gt;&lt;br&gt;For example - what scope of kernel dependency should I use? Provided?&lt;br&gt;In such cache I'm receiving: Caused by: java.lang.ClassNotFoundException: com.liferay.petra.concurrent.ConcurrentReferenceKeyHashMap&lt;br&gt;&lt;br&gt;in short I have:&lt;br&gt;MVC project&lt;br&gt;1 @Component with small logic -&amp;gt; I'd like to add test for some methods.&lt;br&gt;&lt;br&gt;I've added dependencies:&lt;br&gt;&lt;br&gt;&lt;pre&gt;&lt;code&gt;	&amp;lt;groupid&amp;gt;com.liferay.portal&amp;lt;/groupid&amp;gt;
			&amp;lt;artifactid&amp;gt;com.liferay.portal.test&amp;lt;/artifactid&amp;gt;
			&amp;lt;version&amp;gt;4.0.1&amp;lt;/version&amp;gt;
			&amp;lt;scope&amp;gt;test&amp;lt;/scope&amp;gt;
		
		&amp;lt;dependency&amp;gt;
			&amp;lt;groupid&amp;gt;com.liferay.portal&amp;lt;/groupid&amp;gt;
			&amp;lt;artifactid&amp;gt;com.liferay.portal.test.integration&amp;lt;/artifactid&amp;gt;
			&amp;lt;version&amp;gt;4.1.0&amp;lt;/version&amp;gt;
			&amp;lt;scope&amp;gt;test&amp;lt;/scope&amp;gt;
		&amp;lt;/dependency&amp;gt;
		&amp;lt;dependency&amp;gt;
			&amp;lt;groupid&amp;gt;junit&amp;lt;/groupid&amp;gt;
			&amp;lt;artifactid&amp;gt;junit&amp;lt;/artifactid&amp;gt;
			&amp;lt;scope&amp;gt;test&amp;lt;/scope&amp;gt;
		&amp;lt;/dependency&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;&lt;br&gt;and in Test class I have:&lt;br&gt;&lt;pre&gt;&lt;code&gt;    @ClassRule
    @Rule
    public static final AggregateTestRule aggregateTestRule = new LiferayIntegrationTestRule();

    @Inject
    private MyService myService;

&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;&lt;br&gt;It is not working - because kernel classes are not accessible.&lt;br&gt;&lt;br&gt;Does anyone have working example how to implement junit tests?&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Bartlomiej Knabel</dc:creator>
    <dc:date>2018-02-26T18:56:50Z</dc:date>
  </entry>
</feed>
