Two Canadian citizens this week marked their 100th day of detention in Chinese custody. Michael Kovrig, a senior adviser to the International Crisis Group — an organisation whose board I chair — and Michael Spavor were separately arrested in December in what has been widely seen as a response to the Canadian detention of the Huawei chief financial officer, Meng Wanzhou, at the behest of the US authorities.

While the Canadian action followed the book — they were acting on an Interpol notice of a US arrest warrant pursuant to their extradition treaty — the Chinese action appeared to be a crude political response.

Years ago, as a UN official, I watched China’s long coming out. After focusing in the early years of Deng Xiaoping’s leadership on economic reform and development, China shifted to a focus on international commercial relations and then took on the international political and security responsibilities of a world power.

When President Xi Jinping spoke at Davos in January 2017 of China’s role as defender of the international rule of law, it briefly seemed that a new global power was stepping up to the plate just as the US was stepping back. As a former head of the UN Development Programme, which was for many years arguably China’s closest multilateral partner, I felt proud to have been a privileged observer on parts of this new Long March.

Chinese authorities would no doubt argue that they did not seek a confrontation with the US over Huawei — or, for that matter, over trade relations, cyber security, artificial intelligence or security in the Asia-Pacific region. They remain in their own minds reluctant political players on the global stage, more content to focus on economic issues at home and abroad and aware of their unfinished development challenges.

Yet China finds itself in the sights of a Washington that no longer views it as a fellow stakeholder in a liberal global order but rather as a rival. The dispute over whether Huawei violated sanctions on Iran and poses a threat to US security is one front in this new more conflicted relationship. China may not have picked the fight but how it responds will help shape the way the world views it.

Mr Kovrig’s case matters. The way Beijing handles it will go a long way in answering the following questions: Is China a country of laws, where a foreign national going about his legitimate business is safe? Or is it a country where such a foreign national risks becoming the victim of arbitrary detention?

The detention raises another sensitive issue. As a former Canadian diplomat, Mr Kovrig should benefit from the protections of the Vienna Convention for work undertaken in that capacity. To the extent that he is being held on the basis of, and questioned about, those activities, the message sent by China would be that diplomats too are at risk, in violation of international standards.

Beijing is jeopardising its own standing in the world with its behaviour, as academics, business organisations, journalists and diplomats who have expressed concerns about Mr Kovrig’s detention, have made clear.

After all, China’s modern openness only goes back 40 years, to 1978, and is less than complete. This is why the Kovrig case poses such a litmus test of the country’s direction. Will Beijing respond to American pressure by closing down further, or reassert and reinvigorate its openness and respect for the rule of law? If it chooses the latter course and continues to hold Mr Kovrig, China will validate the image its foes seek to depict and hurt itself far more than those it unjustly detains.