Skip to content

Commit 74459a8

Browse files
bsrikanaebadirad
authored andcommitted
Updating test for DHFPROD-1581 (#1740)
1 parent b2b5f9e commit 74459a8

File tree

2 files changed

+25
-3
lines changed

2 files changed

+25
-3
lines changed

ml-data-hub-plugin/src/test/groovy/com/marklogic/gradle/task/CreateEntityTaskTest.groovy

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
15-
*
15+
*
1616
*/
1717

1818
package com.marklogic.gradle.task
@@ -56,8 +56,11 @@ class CreateEntityTaskTest extends BaseTest {
5656
notThrown(UnexpectedBuildFailure)
5757
result.task(":hubCreateEntity").outcome == SUCCESS
5858

59-
File entityDir = Paths.get(testProjectDir.root.toString(), "plugins", "entities", "my-new-entity").toFile()
60-
entityDir.isDirectory() == true
59+
File entityFile = Paths.get(testProjectDir.root.toString(), "plugins", "entities", "my-new-entity", "my-new-entity.entity.json").toFile()
60+
entityFile.isFile() == true
61+
String entityActual = entityFile.getText('UTF-8')
62+
String entityExpected = new File("src/test/resources/my-new-entity.entity.json").getText('UTF-8')
63+
assert(entityActual == entityExpected)
6164
}
6265

6366
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"info" : {
3+
"title" : "my-new-entity",
4+
"version" : "0.0.1",
5+
"baseUri" : "http://example.com/",
6+
"description" : "An my-new-entity entity"
7+
},
8+
"definitions" : {
9+
"my-new-entity" : {
10+
"description" : "The my-new-entity entity root.",
11+
"required" : [ ],
12+
"rangeIndex" : [ ],
13+
"elementRangeIndex" : [ ],
14+
"wordLexicon" : [ ],
15+
"pii" : [ ],
16+
"properties" : { }
17+
}
18+
}
19+
}

0 commit comments

Comments
 (0)