package Ġuk . ac . war wick . cam cat . s its . services Ċ Ċ import Ġorg . hamcrest . Matchers . contains Ċ import Ġorg . junit . Assert .* Ċ import Ġorg . junit . Test Ċ import Ġorg . springframework . beans . factory . annotation . Autowired Ċ import Ġuk . ac . war wick . cam cat . context . Context Test Ċ import Ġuk . ac . war wick . util . ter md ates . A cademic Year Ċ Ċ class ĠModule Service Test Ġ: ĠContext Test () Ġ{ ĊĠ Ġ@ Autowired ĊĠ Ġprivate Ġlateinit Ġvar Ġmodule Service : ĠModule Service ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Find Module By Module Code () Ġ{ ĊĠĠĠ Ġval Ġmodule Ġ= Ġmodule Service . findBy Module Code (" CS 2 6 1 - 1 5 ") ĊĊĠĠĠ ĠassertNotNull ( module ) ĊĠĠĠ Ġmodule !! ĊĊĠĠĠ ĠassertEquals (" CS 2 6 1 - 1 5 ", Ġmodule . code ) ĊĠĠĠ ĠassertEquals (" Software ĠEngineering ", Ġmodule . title ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Find Related Modules () Ġ{ ĊĠĠĠ Ġval Ġrules Ġ= Ġmodule Service . find Related Modules (" CS 2 6 1 - 1 5 ", ĠA cademic Year . starting ( 2 0 2 0 )) ĊĊĠĠĠ ĠassertThat ( rules . pre Re quis ites . map Ġ{ Ġit . code Ġ}, Ġcontains (" CS 1 1 8 - 1 5 ", Ġ" CS 1 2 6 - 1 5 ")) ĊĠ Ġ} Ċ } Ċ